Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple websites on Linux Apache server? 1

Status
Not open for further replies.

opensky

Technical User
Aug 9, 2001
32
PK
Can any body guide my from start to end that how can i bind multiple IP address and then assign eachone to a website?

Thanks in advance.
 
Hi,

Sounds like you need IP-based virtual hosts. This is very simple and all you need to do is make sure that all the different IP addresses are routed to the apache box. This would obviously be arranged with your ISP(s). Once you've got the traffic arriving at your apache box the server will use the VirtualHost containers that match the IP address invoked by the browser user. So, you'd have two or more blocks like this in your /etc/httpd/conf/httpd.conf file :

<VirtualHost 172.16.16.1>
DocumentRoot /var/ ServerName </VirtualHost>
<VirtualHost 172.16.16.2>
DocumentRoot /var/ ServerName </VirtualHost>

So, in this example a request for (IP address 172.16.16.1) would cause apache to serve up content from the /var/ directory and a request for (172.16.16.2) would cause apache to serve up content from the /var/ directory.

The other version of virtual hosts is name based virtual hosts. Here you have only one IP address and get the DNS records configured so that all your sites resolve to a single IP address. Then you configure it such so that apache will choose a virtual host container based on the http header, e.g. For example :

NameVirtualHost 172.16.16.1
<VirtualHost 172.16.16.1>
UseCanonicalName off
DocumentRoot /var/ ServerName </VirtualHost>
<VirtualHost 172.16.16.1>
UseCanonicalName off
DocumentRoot /var/ ServerName </VirtualHost>

See --> for more info.

Hope this helps
 
Thank u ifincham :)

I will try.

Thank you agian for ur response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top