1

I run-up server at home and currently I've got 2 servers running separately on 2 lines of internet cable. Now I want to close down one internet line, so I want 2 servers run only one internet line; that means 2 PCs running as servers on one static IP address. Is it possible and how do I set it up?

Note: Both servers use wampserver and Static IP.

3
  • 1
    What about one server with virtual hosts?
    – gronostaj
    Oct 29, 2013 at 11:12
  • 6
    Get two static IPs from your ISP, and a router that supports network ranges on the WAN (most business-grade routers do this). Oct 29, 2013 at 11:19
  • I dont want one server, it makes that server work too much, reason why I wanna sepearate 2 servers. I afraid that ISP wont provide me 2 static IPs. Any way else? 2 servers, 2 domains but 1 static IP
    – Nick
    Oct 30, 2013 at 15:31

2 Answers 2

2

2 PCs running as servers on one static IP address. Is it possible and how do I set it up?

You can have as many servers listening on a single IP address (including your static, public one) as you like, as long as:

  • each server is listening on a different port (or NATted to a unique port on your router), or
  • there is some sort of front-end service that routes requests to the right physical server on your LAN

In the case of "WAMP" or Apache, the "front-end" service that can do this would be reverse proxies or vhosts.

So your options are:

  • Continue running two physical web servers on your LAN, assigning each a static private LAN IP. Set your router to port forward incoming traffic on port 80 or 443 to one of your servers, and a different port to the other, such as 8080 or 44344. To access this server, people will have to enter something like http://your-public-ip:8080 or https://your-public-ip:44344 in browsers. There is no way to make DNS specify the port for you.

  • Continue running two physical web servers on your LAN, assigning each a static private LAN IP. Set your router to port forward incoming traffic on port 80 or 443 to one of your servers. Configure Apache to reverse proxy a specific directory to your other, second server on its LAN IP. Since all traffic for the second server must pass through the first, this can increase load on the first.

  • If you have two DNS records available to you, you can set both DNS records to point to your single remaining static IP. Run only a single server, and consolidate the site housed on your other server to this remaining server. Use Apache's vhosts feature to deliver the correct site to incoming requests according to the Host header in the requests, which should be different depending on which domain name was used to access.

0

As techie007 pointed out the 'correct' way to deal with this is to get another public IP from your ISP.

Another solution is to get creative with port-forwarding.

Just tell your router to forward TCP request on port 8080 (for example) to on port 80.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .