View Full Version : 1 Ip and 4 Severs and 8 Websites ... and a pear tree
coolbeansdude51
2006-08-05, 07:35 PM CDT
Question ...
Can I have 1 ip address with 4 servers and 2 domains on each server.
If so ...
HOW? :rolleyes:
Thanks,
Adam
JordanN
2006-08-05, 10:20 PM CDT
The following message is based on theory. I have been wanting to do this for awhile, but have not yet achieved it.
It sounds like you need a reverse proxy system. You have a machine in front to do name-based virtual hosting. The machines behind it handle requests that need processing, such as PHP files. Apache made reverse proxy setups easier in the new version.
http://httpd.apache.org/docs/2.2/vhosts/
http://httpd.apache.org/docs/2.2/caching.html
coolbeansdude51
2006-08-05, 10:35 PM CDT
Cool.
I was thinking something along the lines of using the Apache Virtual host functions and I am wondering if in the virtual host you can put the hostname instead of the ip address and do it that way ... does that make sense?
coolbeansdude51
2006-08-05, 10:38 PM CDT
Cool.
I was thinking something along the lines of using the Apache Virtual host functions and I am wondering if in the virtual host you can put the hostname instead of the ip address and do it that way ... does that make sense?
AAAAHHHAAA
Ok so in the Literature that greelead so generously provided it says I can!!!
And I quote!
"IP-based virtual hosts use the IP address of the connection to determine the correct virtual host to serve. Therefore you need to have a separate IP address for each host. With name-based virtual hosting, the server relies on the client to report the hostname as part of the HTTP headers. Using this technique, many different hosts can share the same IP address." -- http://httpd.apache.org/docs/2.2/vhosts/name-based.html
It seems all I have to do is add a virtual host ...
Is that right? Am I reading this correctly?
JordanN
2006-08-06, 09:40 AM CDT
Yep. You have to tell it where to listen (ie: NameVirtualHost *:80 #from memory), and then provide the domain name in each VirtualHost container. Just remember that the first VirtualHost is the default.
Like this:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>
<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
ccrvic
2006-08-06, 02:12 PM CDT
Can I have 1 ip address with 4 servers and 2 domains on each server.
2 domains on each server is trivial - look up Virtual Hosting.
4 servers on one IP address gets interesting - you'll have to work out how to switch packets between them, and that depends on exactly what you're trying to do. I suspect you want one machine as a proxy front-end for the others.
However, the one thing that will kill you stone dead on this is HTTPS. You need one IP address/port combination fior each server. If you want to do HTTPS on the standard port, that means you need an IP address per domain.
Vic.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.