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.




341 posts

Ultimate Geek


# 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
1700 posts

Uber Geek

Trusted

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

28440 posts

Uber Geek

Moderator
Trusted
Biddle Corp
Lifetime subscriber

  # 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.

 
 
 
 


621 posts

Ultimate Geek


  # 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


  # 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.

488 posts

Ultimate Geek


  # 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



341 posts

Ultimate Geek


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

28440 posts

Uber Geek

Moderator
Trusted
Biddle Corp
Lifetime subscriber

  # 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


  # 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

488 posts

Ultimate Geek


  # 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



341 posts

Ultimate Geek


  # 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



341 posts

Ultimate Geek


  # 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 and LinkedIn »



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 »

Intel introduces cryogenic control chip to enable quantum computers
Posted 10-Dec-2019 21:32


Vodafone 5G service live in four cities
Posted 10-Dec-2019 08:30


Samsung Galaxy Fold now available in New Zealand
Posted 6-Dec-2019 00:01


NZ company oDocs awarded US$ 100,000 Dubai World Expo grant
Posted 5-Dec-2019 16:00


New Zealand Rugby Selects AWS-Powered Analytics for Deeper Game Insights
Posted 5-Dec-2019 11:33


IMAGR and Farro bring checkout-less supermarket shopping to New Zealand
Posted 5-Dec-2019 09:07


Wellington Airport becomes first 5G connected airport in the country
Posted 3-Dec-2019 08:42


MetService secures Al Jazeera as a new weather client
Posted 28-Nov-2019 09:40


NZ a top 10 connected nation with stage one of ultra-fast broadband roll-out completed
Posted 24-Nov-2019 14:15


Microsoft Translator understands te reo Māori
Posted 22-Nov-2019 08:46


Chorus to launch Hyperfibre service
Posted 18-Nov-2019 15:00


Microsoft launches first Experience Center worldwide for Asia Pacific in Singapore
Posted 13-Nov-2019 13:08


Disney+ comes to LG Smart TVs
Posted 13-Nov-2019 12:55


Spark launches new wireless broadband "Unplan Metro"
Posted 11-Nov-2019 08:19


Malwarebytes overhauls flagship product with new UI, faster engine and lighter footprint
Posted 6-Nov-2019 11:48



Geekzone Live »

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


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



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.