Help in setting up one http server for two different domains
CodeHeads
ch at code-heads.com
Sat Dec 3 01:29:25 UTC 2005
Jim Christiansen wrote:
> Hello, I've got a server that is currently serving one website with a
> registered domain and dns. I would like to use the same server to also
> serve another domain. Reading about name-based virtual hosting at
> http://httpd.apache.org/docs/1.3/vhosts/name-based.html I can't seem to
> get the second url to load- I keep getting the same first domain's
> webpage. The path for the first domain is from /var/www/html. The path
> for the second domain is set right now to /var/www/html/seconddomain...
>
> So anywhoooo... Comments???
>
> Thanks,
>
> Jim
>
>
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
~WILL~
More information about the fedora-list
mailing list