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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i configure multiple web site at one IP?

Status
Not open for further replies.

atanoli

Technical User
Oct 28, 1999
156
PK
Is there any possibility like Ineternet Information Server that i can host multiple web sites at one IP address?

I have RedHat 7.1 installed with apache.
 
Hi,





This is called virtual hosting in apache and there are two main variations :





1) IP based virtual hosting. This is where you have multiple real ip addresses and want to serve them all from a single http server. You have to get the IP routing set up thru your ISP to send all of the ip addresses to you. See -->




2) More common nowadays is where you only have a single real IP address but want to run multiple sites on the same address. This is called name based virtual hosting. You just configure the dns records for all the sites you want to host to point to the same IP address. Then you configure apaches' httpd.conf file to discriminate between the traffic based on whats in the http/1.1 header record, i.e. url. See -->




Here is an example :





NameVirtualHost 172.16.16.1:80





<VirtualHost 172.16.16.1>


UseCanonicalname off


ServerName

DocumentRoot /var/

</VirtualHost>





<VirtualHost 172.16.16.1>


UseCanonicalname off


ServerName

DocumentRoot /var/

</VirtualHost>




(The content for each virtual server is in the DocumentRoot directory)




Apache is very good at this and you can also do mass virtual hosting to easily host hundreds of such sites on one box - for that and other stuff see the other docs at --> .





Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top