View Full Version : [ubuntu] How to use 2 Server boxes with 1 static ip address
R.Bucky
July 10th, 2009, 12:06 AM
I host over 6 domains on my primary server box at home using Apache Named Based Virtual Hosting. I would like to add another box to my network to serve up pages. However, I only have 1 static ip. What is the best way of doing this? Any ideas?
My primary box is more than adequate - no problems. But, I wonder if it can be accomplished?
Operating Ubuntu Server 8.04, RAID1 w/hot spare. The other box would be a standard 1-disk installation.
guilly
July 10th, 2009, 07:30 AM
Ahh maybe I'm not understanding the question correctly so ignore this if this is true.
But a simple router would do the trick would it not? One static ip will be seen from the outside world while multiple private ip's can be used inside your LAN...
credobyte
July 10th, 2009, 07:37 AM
I would go for a router - 1 static + 2 local IP's should work just fine :)
R.Bucky
July 10th, 2009, 07:51 AM
Naaaa. Could it really be that simple? Going to give that a shot tonight.
windependence
July 10th, 2009, 07:59 AM
You are not going to be able to forward port 80 to two different local IPs. You could run it on a different port, but I would just buy a block of IPs from your ISP. I have a block of 8 for $14.95 a month.
-Tim
R.Bucky
July 10th, 2009, 08:06 AM
My ISP charges $4.95/ip. It would be nice to have a block of 8 for that low price! If it were uber critical, I would go ahead with that. My current server is more than adequate for hosting my multiple domains. Just tossing around an idea...
guilly
July 10th, 2009, 08:35 AM
That's what I was afraid of... the port 80 thing. There must be some sort of work around for that though, no???
Cheesemill
July 10th, 2009, 09:08 AM
Check out mod_proxy for apache, it will allow your current server to forward requests for specific sites to a different web-server on your internal network. I've never used it myself so can't give you a more detailed solution. Google is your friend here.
R.Bucky
July 10th, 2009, 09:09 AM
If I used two routers off my modem... i wonder if Named Based hosting would still work.
So many experiments to try!!!
Cheesemill
July 10th, 2009, 09:39 AM
If I used two routers off my modem... i wonder if Named Based hosting would still work.
So many experiments to try!!!
Nope, this won't work. Take a look at my post above for the solution.
kustomjs
July 10th, 2009, 11:02 AM
I am using apache with virtual hosting and I am hosting 3 sites on one static IP and all my sites are on port 80. how I am doing this is by smoothwall and using internal ports.
also here is how I got mine setup:
under /etc/apache2/sites-available:
you need to have a file setup under domain.com.conf
<VirtualHost *:80>
ServerName domain.com
DocumentRoot /var/www/domain/
</VirtualHost>
the key is the servername.
under this setup I have 3 different websites under port 80 like that
Cheesemill
July 10th, 2009, 11:18 AM
The OP is already doing this, the question is how to use more than one internal server with only one external IP.
kustomjs
July 10th, 2009, 11:58 AM
if he wants to that he would have to change the different port to 8080 and look at mod_rewrite.
windependence
July 11th, 2009, 01:44 AM
You should all be aware that messing around with the default port will kill some traffic to your site. Many many corporate sites will block any traffic they think is being redirected. When I first started hosting sites in house I hosted several on 8080, but my clientele soon informed me that they could not access the site. As soon as I fixed that, everyone could view the content. You may never know if it's a sales site or a blog, but I run message boards, and I got tons of people letting me know it wasn't working. If you are just hosting a private site and don't care then it's fine, but if you are trying to run a site that everyone can access, you should not do this. I know, I know, many people here are doing it but they are not informed and probably don't know people can't see their site. Fact is, most people surf at work. My traffic goes way down on the weekends.
-Tim
doogy2004
July 13th, 2009, 10:58 PM
Just an idea...
How about trying some type of load balancer?
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.