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.


314 posts

Ultimate Geek
+1 received by user: 5


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?

26624 posts

Uber Geek
+1 received by user: 6116

Moderator
Trusted
Biddle Corp
Lifetime 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.

584 posts

Ultimate Geek
+1 received by user: 90


  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.

485 posts

Ultimate Geek
+1 received by user: 6


  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



314 posts

Ultimate Geek
+1 received by user: 5


  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?

26624 posts

Uber Geek
+1 received by user: 6116

Moderator
Trusted
Biddle Corp
Lifetime 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

485 posts

Ultimate Geek
+1 received by user: 6


  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



314 posts

Ultimate Geek
+1 received by user: 5


  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



314 posts

Ultimate Geek
+1 received by user: 5


  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 »

Hawaiki Transpacific cable ready-for-service
Posted 20-Jul-2018 11:29


Microsoft Dynamics 365 Business Central launches
Posted 10-Jul-2018 10:40


Spark completes first milestone in voice platform upgrade
Posted 10-Jul-2018 09:36


Microsoft ices heated developers
Posted 6-Jul-2018 20:16


PB Technologies charged for its extended warranties and warned for bait advertising
Posted 3-Jul-2018 15:45


Almost 20,000 people claim credits from Spark
Posted 29-Jun-2018 10:40


Cove sells NZ's first insurance policy via chatbot
Posted 25-Jun-2018 10:04


N4L helping TAKA Trust bridge the digital divide for Lower Hutt students
Posted 18-Jun-2018 13:08


Winners Announced for 2018 CIO Awards
Posted 18-Jun-2018 13:03


Logitech Rally sets new standard for USB-connected video conference cameras
Posted 18-Jun-2018 09:27


Russell Stanners steps down as Vodafone NZ CEO
Posted 12-Jun-2018 09:13


Intergen recognised as 2018 Microsoft Country Partner of the Year for New Zealand
Posted 12-Jun-2018 08:00


Finalists Announced For Microsoft NZ Partner Awards
Posted 6-Jun-2018 15:12


Vocus Group and Vodafone announce joint venture to accelerate fibre innovation
Posted 5-Jun-2018 10:52


Kogan.com to launch Kogan Mobile in New Zealand
Posted 4-Jun-2018 14:34



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.