It's very simple to setup NameBase Virtual Host in Apache:

Like we have server with 10.0.0.1 IP which should serve over port 80 and we 
want to setup Apache for domains abc.com and xyz.com. Follow below given notes.

Add following lines in httpd.conf file:

NameVirtualHost 10.0.0.1:80

<VirtualHost 10.0.0.1:80>
ServerName abc.com
DocumentRoot /path/to/doc/root
CustomLog /path/to/create/access/log/for/abc_access.log common
</VirtualHost>

<VirtualHost 10.0.0.1:80>

ServerName xyz.com

DocumentRoot /path/to/doc/root
CustomLog /path/to/create/access/log/for/xyz_access.log common

</VirtualHost>

Reload Apache. This should work. ;-)

Thanks,
Manoj
Date: Mon, 7 Jun 2010 12:20:43 +0500
From: nasir...@gmail.com
To: users@httpd.apache.org
Subject: [us...@httpd] Recommended way to setup Virtual Host

Hi,

Can anyone tell me the recommended way to setup Virtual Host with one Physical 
IP on the server and multiple domains. ?

Name Based Virtual Host Vs IP Based Virtual Host what is the best to choose/


Regards
Nasir  
                                          
_________________________________________________________________
Bollywood, beauties and the latest flicks on MSN entertainment
http://entertainment.in.msn.com/

Reply via email to