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.




295 posts

Ultimate Geek
+1 received by user: 3


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?

25691 posts

Uber Geek
+1 received by user: 5445

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.

 
 
 
 


570 posts

Ultimate Geek
+1 received by user: 75


  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



295 posts

Ultimate Geek
+1 received by user: 3


  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?

25691 posts

Uber Geek
+1 received by user: 5445

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



295 posts

Ultimate Geek
+1 received by user: 3


  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



295 posts

Ultimate Geek
+1 received by user: 3


  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 »

New Zealand government to create digital advisory group
Posted 16-Dec-2017 08:47


Australia datum changes means whole country moving 1.8 metres north-east
Posted 16-Dec-2017 08:39


UAV Traffic Management Trial launching today in New Zealand
Posted 12-Dec-2017 16:06


UFB connections pass 460,000
Posted 11-Dec-2017 11:26


The Warehouse Group to adopt IBM Cloud to support digital transformation
Posted 11-Dec-2017 11:22


Dimension Data peeks into digital business 2018
Posted 11-Dec-2017 10:55


2018 Cyber Security Predictions
Posted 7-Dec-2017 14:55


Global Govtech Accelerator to drive public sector innovation in Wellington
Posted 7-Dec-2017 11:21


Stuff Pix media strategy a new direction
Posted 7-Dec-2017 09:37


Digital transformation is dead
Posted 7-Dec-2017 09:31


Fake news and cyber security
Posted 7-Dec-2017 09:27


Dimension Data New Zealand strengthens cybersecurity practice
Posted 5-Dec-2017 20:27


Epson NZ launches new Expression Premium Photo range
Posted 5-Dec-2017 20:26


Eventbrite and Twickets launch integration partnership in Australia and New Zealand
Posted 5-Dec-2017 20:23


New Fujifilm macro lens lands in New Zealand
Posted 5-Dec-2017 20:16



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.