You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Nasir Zia <na...@gmail.com> on 2010/06/07 09:20:43 UTC

[users@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

RE: [users@httpd] Recommended way to setup Virtual Host

Posted by Manoj Samtani <ma...@hotmail.com>.
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: nasir381@gmail.com
To: users@httpd.apache.org
Subject: [users@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/

Re: [users@httpd] Recommended way to setup Virtual Host

Posted by Eric Covener <co...@gmail.com>.
On Mon, Jun 7, 2010 at 3:20 AM, Nasir Zia <na...@gmail.com> wrote:
> 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/

name-based is mandatory based on your requirements.

http://httpd.apache.org/docs/2.1/vhosts/name-based.html#using

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org