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@xxxxxxxxx
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@xxxxxxxxx
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@xxxxxxxxx
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@xxxxxxxxx
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~