Two webservers on the same network?

DDRtists

ɹoʇɐɹǝpoɯ ɹǝdns
Reaction score
415
Okay, heres would I'm hoping I can do.

I run a few boxes for different game servers here at my house, and I'd like to run a webserver on a few of them separate from my production webserver, as to not use all the resources for videogame related stuff and slow down my actual sites. Note, I mean actual servers that people can access from the outside. I currently have them set up, but only I can access all of them but my production webserver. The production one is the only one people can see from the outside, currently.

My question: Is it possible to run multiple webservers on the same network, and decide what site goes where based on the domain requested? My whole network is behind a Ubuntu NAT Router/DNS/DHCP Server, if it makes any difference.

Example:
mysite1.com requests go to webserver 1
mysite2.com requests go to webserver 2

Possible? If so, how?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
The easiest thing to do would be to use different ports for each webserver and forward accordingly. Assuming that's not what you want to do....

You could set up a box running something like lighttpd and direct all traffic there. Lighttpd has a module to do proxying to other webservers. This is not something that I have setup before, but I have seen such things in the lighttpd documentation mentioned before. I don't know if Apache has a similar module, but it may. Anyway, the general strategy is to use one webserver to examine where the requests need to go and then forward them accordingly.
 

Samuraid

Advisor
Reaction score
81
A proxy is really the only way to do it, assuming you have only 1 IP address and you want all the webservers to accept traffic from port 80.

You can use something like lighttpd, nginx, varnish, or haproxy to act as a reverse proxy. They can be configured to send traffic to any number of back-end servers based on domain, URL, cookies, and many other parameters.
 

DDRtists

ɹoʇɐɹǝpoɯ ɹǝdns
Reaction score
415
Sweet, okay. My production server is running apache 2.2.17 on server 2003, but I just recently set up a ubuntu box with lighttpd and have figured that out. So now I'm going to be moving my production server to a ubuntu box with lighttpd, as it runs so much better. So I guess I shall go with that route then, thanks guys! :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top