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?

25206 posts

Uber Geek
+1 received by user: 5042

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.

 
 
 
 


555 posts

Ultimate Geek
+1 received by user: 60


  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.

482 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?

25206 posts

Uber Geek
+1 received by user: 5042

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

482 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 »

How Oppo shakes New Zealand’s phone market
Posted 22-Aug-2017 18:32


Recognition for top small business advisors
Posted 22-Aug-2017 17:23


OPPO R11 dual 20MP camera phone debuts in New Zealand
Posted 22-Aug-2017 15:45


Intel introduces new 8th Generation processors
Posted 21-Aug-2017 19:02


Trend Micro launches Home Network Security
Posted 21-Aug-2017 18:38


Avondale College students at top of Microsoft Office Specialist World Championship
Posted 21-Aug-2017 14:11


Garmin introduces inReach SE+ and inReach Explorer+
Posted 21-Aug-2017 14:05


Public Wi-Fi plus cloud file sharing
Posted 18-Aug-2017 11:20


D-Link NZ launches professional Wireless AC Wave 2 Access Point for businesses
Posted 17-Aug-2017 19:25


Garmin introduces the Rino 700 five-watt two-way handheld radio
Posted 17-Aug-2017 19:04


Garmin announces the Foretrex 601 and Foretrex 701 Ballistic Edition for outdoor and tactical use
Posted 17-Aug-2017 19:02


Brightstar announces new distribution partnership with Samsung Knox platform in Australia
Posted 17-Aug-2017 17:07


Free gig-enabled WiFi network extends across Dunedin
Posted 17-Aug-2017 17:04


Samsung expands with connect Gear S3 Frontier
Posted 17-Aug-2017 15:55


Fact-checking Southern Cross Next cable is fastest to USA
Posted 17-Aug-2017 13:57



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.