Warning: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in ..../includes/class_bbcode.php on line 2958
Hosting 2 web servers from 1 ip
Results 1 to 10 of 10

Thread: Hosting 2 web servers from 1 ip

  1. #1

    Hosting 2 web servers from 1 ip

    I'm trying to get 2 webservers working from 1 connection. I'm not even sure if it is possible.

    Firstly though my setup is this:

    Code:
    Cable Modem <--> Linux Router (iptables)<--->[LAN]
    I can run a webserver from the gateway machine, or I can run a webserver from a machine behind the firewall by forwarding requests on port 80. But can I do both?

    I suspect there is a way to have the router figure out which server it should be trying to load the page from but I have no idea how.

    Any ideas?

  2. #2
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,760

    Re: Hosting 2 web servers from 1 ip

    You can do that and have the two webservers on different ports, but one would need to specify for at least on e of them what port is desired. OTOH, if you use dns2go, you could setup 2 domain names and have each point to the proper IP. I do that for all of my services (since Time Warner blocks all incoming ports for servers -- 21,22,23,25,80,etc....)

    But to keep it short -- Each server needs its own port.

  3. #3

    Re: Hosting 2 web servers from 1 ip

    What about virtual host, in apache? Is that not what they do? all be it on one box.

  4. #4
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    Re: Hosting 2 web servers from 1 ip


    What about virtual host, in apache? Is that not what they do? all be it on one box.
    Yes. Check out Virtual Host section of Apache. I used to host 5 sites with one IP.

  5. #5

    Re: Hosting 2 web servers from 1 ip

    I nearly said 'noone mention virtual hosting'.

    I wanted to keep the 2 boxes totally seperate so I could mess around with one of them without fear of destroying the other.

    I think I'll be putting the servers on different ports. Thanks.

  6. #6

    Re: Hosting 2 web servers from 1 ip

    have the dns for the two sites point to different ports, say
    ports 80 for httpd1 and 81 for httpd2. Now I will assume you
    want them behind the firewall, so forward the ports to the
    the proper webserver address and ports, they can be different
    machines including the firewall machine or on a single machine
    in both instances. Virtual hosting would be easier, it is up to
    you. What you want may require running a virtual machine to
    contain totally seperate instances of apache (in the setup to
    work), but this is totally possible with chroot (but not necessarily
    easy once again).

    ~Guitarlynn

  7. #7
    Senior Member
    Join Date
    Nov 2001
    Posts
    419

    Re: Hosting 2 web servers from 1 ip

    Mine might be a little harder. I'd like to setup at least 6 different types of servers behind a Linksys Router with 1 IP. The main 3 are a web server, irc server, and gaming server. Since I don't get a lot if hits I don't mind if one server is hogging bandwidth for a while. So, will port forwarding work for the router of will something else be needed?

  8. #8

    Re: Hosting 2 web servers from 1 ip

    It probably won't work with the linksys router unless you can
    specify 6 off ports to forward. I'm assuming that you won't
    use port 80 because of ISP port 80 scans that are norm since
    the CodeRed outbreak. You can however do this from any
    linux router.

    Fix: portforward ports 81-84 to different instances of Apache
    forward proper ports for irc and game servers

    set the different instances of Apache, whether different boxes or
    or vmware or a seperate distro on another partition running
    another instance of Apache using the same iface on a different port.


    A DMZ setup on the router going to a bank of 486DX2's w/12+ Megs of RAM would be ideal. You can even get some cheap 4U rackmount boxes at http://www.computergeeks.com and rack mount them all.

    All in all this would be the ideal way of doing it with a distro like 'bare' Debian/Slack, E-Smith, Coyote Embedded, or Dachstein CD mounting a hd for the /var partition.

    Be prepared to spend some time setting this up if you haven't done something like this before.
    Run into any problems/questions, let us know.

    ~Guitarlynn

  9. #9
    Senior Member
    Join Date
    Nov 2001
    Posts
    419

    Re: Hosting 2 web servers from 1 ip

    I'm new to Linux and I'm sure the router can forward more ports. Take a look at this


  10. #10
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,760

    Re: Hosting 2 web servers from 1 ip

    Yeah the Linksys routers are nice and easy to setup. My Netgear is pretty powerful but has like nothing for a gui. All configurations are from the telnet option. You should have no problems. My boss uses one of those and it works well

Similar Threads

  1. Web Hosting
    By cmoughan in forum Linux - General Topics
    Replies: 2
    Last Post: 11-07-2004, 07:02 PM
  2. Web Hosting
    By trickster in forum General Chat
    Replies: 6
    Last Post: 10-05-2004, 01:43 PM
  3. web hosting
    By knight in forum General Chat
    Replies: 16
    Last Post: 02-11-2003, 04:58 AM
  4. Hosting this site
    By cloverm in forum Announcements and Suggestions
    Replies: 23
    Last Post: 02-05-2002, 10:32 PM
  5. web hosting
    By imported_Derango in forum General Chat
    Replies: 13
    Last Post: 12-01-2001, 09:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •