Help in setting up one http server for two different domains

CodeHeads ch at code-heads.com
Sat Dec 3 04:35:12 UTC 2005


>>This is how I would do it.
>>Main domain would be setup at /var/www/html/firstdomain
>>and the second /var/www/html/seconddomain
>>
>><VirtualHost *:80>
>>	ServerAdmin email at email.com
>>	DocumentRoot /var/www/html/firstdomain
>>	ServerName firstdomain.com
>>	ServerAlias www.firstdomain.com
>>	ErrorLog logs/firstdomain-error_log
>>	CustomLog logs/firstdomain-access_log common
>></VirtualHost>
>>
>><VirtualHost *:80>
>>	ServerAdmin email at email.com
>>	DocumentRoot /var/www/html/seconddomain
>>	ServerName seconddomain.com
>>	ServerAlias www.firstdomain.com
>>	ErrorLog logs/seconddomain-error_log
>>	CustomLog logs/seconddomain-access_log common
>></VirtualHost>
>>
>>Hope this helps
> 
> 
> Note that you need a:
> NameVirtualHost *:80
> in the global section above those to make it work.  (And
> fix the typo in the second ServerAlias).  Also you can
> add additional names in the ServerAlias entry if you want.
> 
> --
>   Les Mikesell
>     lesmikesell at gmail.com
> 
> 

OOPS, sorry for the typo guys.  Yes, I did forget, by default the 
NameVirtualHost *:80 is commented out in the conf file.

It should read:
<VirtualHost *:80>
	ServerAdmin email at email.com
	DocumentRoot /var/www/html/seconddomain
	ServerName seconddomain.com
	ServerAlias www.seconddomain.com
	ErrorLog logs/seconddomain-error_log
	CustomLog logs/seconddomain-access_log common
</VirtualHost>

~WILL~




More information about the fedora-list mailing list