Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




289 posts

Ultimate Geek
+1 received by user: 2


Topic # 50171 23-Nov-2009 23:36
Send private message


Is it possible to have two http (apache) servers in one public IP, how?

My problem is that I haven't figure out how to forward 80 port to two servers in my LAN simutaneous.


Create new topic
1677 posts

Uber Geek
+1 received by user: 7

Trusted

  Reply # 275676 24-Nov-2009 00:05
Send private message

don't see why not. You could run one on 80 and the other on 8080 (or any port for that matter)


Apache server 1 on PC A: 80 -> 80
Apache server 2 on PC B: 80 -> 8080

or something like that....

or did I miss the point?

25454 posts

Uber Geek
+1 received by user: 5267

Moderator
Trusted
Biddle Corp
Subscriber

  Reply # 275695 24-Nov-2009 06:56
Send private message

Is there a reason why are you trying to run two web servers on the same port and don't just use different ports? Or forward different ports on the router to port 80 on the PC's as mentioned above?

Microsoft ISA can do what you want but my suggestion would be that if you don't understand what you are doing now then it's not a product for you.

 
 
 
 


564 posts

Ultimate Geek
+1 received by user: 73


  Reply # 275698 24-Nov-2009 07:02
Send private message

Since you're using Apache, you can use virtual hosts to achieve this easily.

http://httpd.apache.org/docs/2.2/vhosts/


268 posts

Ultimate Geek


  Reply # 275703 24-Nov-2009 07:22
Send private message

Or if you really need two separate servers you could use apache reverse proxy coupled with vhosts to do it.

484 posts

Ultimate Geek
+1 received by user: 5


  Reply # 275706 24-Nov-2009 07:37
Send private message

Virtual Hosts in apache are exactly what you are after (I think!)

If they MUST run on seperate machines then you can do the following

Foward port 80 to Box 1
On box one have two virtual hosts, 1 serving content, the other doing using the ProxyPass directive to get content from the other Apache instance (by using the internal IP)




pɐǝɥ sıɥ uo ƃuıpuɐʇs



289 posts

Ultimate Geek
+1 received by user: 2


  Reply # 275710 24-Nov-2009 08:17
Send private message

thanks for the excellent answers!

In fact I don't really need two separate servers, and I had one machine with virtual host (still trying to figure out how to use it beyond the simplest case). But since I already got two servers with synchronized version on both, I think it would be nice to have them both available online.

So I think simply forward one port from single public IP to two separate machines doesn't work, is it? If I want be able to SSH to two of my machines, I need either forward two ports from outside for each machine or some other workarounds such as SSH through one of them first?

25454 posts

Uber Geek
+1 received by user: 5267

Moderator
Trusted
Biddle Corp
Subscriber

  Reply # 275719 24-Nov-2009 08:59
Send private message

You can't port forward the same port to two different machines inside your network.

You can port forward two different ports to port 80 inside your network. Likewise if you want to be able to SSH into two different machines you'd set up two different port forwards on your router, maybe with port 22 and 222 for example. These can forward to port 22 on the internal machine.

407 posts

Ultimate Geek
+1 received by user: 3


  Reply # 275735 24-Nov-2009 10:02
Send private message

pstar008: thanks for the excellent answers!

In fact I don't really need two separate servers, and I had one machine with virtual host (still trying to figure out how to use it beyond the simplest case). But since I already got two servers with synchronized version on both, I think it would be nice to have them both available online.

So I think simply forward one port from single public IP to two separate machines doesn't work, is it? If I want be able to SSH to two of my machines, I need either forward two ports from outside for each machine or some other workarounds such as SSH through one of them first?


If you want to load balance then what you should do is check out the howtoforge tutorial: http://www.howtoforge.com/high_availability_loadbalanced_apache_cluster

Otherwise yeah just get rid of one box. Better yet. Make a NAS or something! :D

484 posts

Ultimate Geek
+1 received by user: 5


  Reply # 275758 24-Nov-2009 11:35
Send private message

pstar008: and I had one machine with virtual host (still trying to figure out how to use it beyond the simplest case).


Just yell out if you need help with this - I have a server with about 20 virtual hosts configured :)




pɐǝɥ sıɥ uo ƃuıpuɐʇs



289 posts

Ultimate Geek
+1 received by user: 2


  Reply # 275820 24-Nov-2009 15:20
Send private message

Filterer:
pstar008: and I had one machine with virtual host (still trying to figure out how to use it beyond the simplest case).


Just yell out if you need help with this - I have a server with about 20 virtual hosts configured :)


Thanks. My experience with virtual hosts/Apache is that it is really hard to find error message when it didn't work



289 posts

Ultimate Geek
+1 received by user: 2


  Reply # 275822 24-Nov-2009 15:26
Send private message

chrisjunkie:
If you want to load balance then what you should do is check out the howtoforge tutorial: http://www.howtoforge.com/high_availability_loadbalanced_apache_cluster

Don't need that for my personal web site yet :)

Otherwise yeah just get rid of one box. Better yet. Make a NAS or something! :D


One of these are already a file server thing, another is for development and once tested, I just push the changes to the main server. thus I got one experimental version and one tested version.

Create new topic



Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

Vodafone TV — television in the cloud
Posted 17-Oct-2017 19:29


Nokia 8 review: Classy midrange pure Android phone
Posted 16-Oct-2017 07:27


Why carriers might want to embrace Commerce Commission study, MVNOs
Posted 13-Oct-2017 09:42


Fitbit launches Ionic, its health and fitness smartwatch
Posted 12-Oct-2017 15:52


Xero launches machine learning automation to improve coding accuracy for small businesses
Posted 12-Oct-2017 15:45


Bank of New Zealand uses Intel AI to detect financial crime
Posted 12-Oct-2017 15:39


Sony launches Xperia XZ1, a smartphone with real-time 3D capture
Posted 11-Oct-2017 10:26


Notes on Nokia’s phone comeback
Posted 10-Oct-2017 10:06


Air New Zealand begins Inflight Wi-Fi rollout
Posted 9-Oct-2017 20:16


The latest mobile phones in perspective
Posted 9-Oct-2017 18:34


Review: Acronis True Image 2018 — serious backup
Posted 8-Oct-2017 11:22


Lenovo launches ThinkPad Anniversary Edition 25
Posted 7-Oct-2017 23:16


Less fone, more tech as Vodafone gets brand make-over
Posted 6-Oct-2017 08:16


API Talent Achieves AWS MSP Partner Status
Posted 5-Oct-2017 21:20


Stellar Consulting Group now a Domo Partner
Posted 5-Oct-2017 21:03



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.