What is the correct way to setup my virtual hosts in Apache to serve 2 differnt domains?

Posted by Michael on Server Fault See other posts from Server Fault or by Michael
Published on 2010-03-17T18:18:38Z Indexed on 2010/03/17 18:21 UTC
Read the original article Hit count: 533

I have a current website on an Apache server (foo.com) and I want the same server to serve a new site (bar.com), is this the correct way to setup my virtual hosts?


<VirtualHost *:80>
    ServerName foo.com
    ServerAlias www.foo.com
    Include conf.d/foo.conf
</VirtualHost>

<VirtualHost *:80>
    ServerName bar.com
    ServerAlias www.bar.com
    Include conf.d/bar.conf
</VirtualHost>

I'm hesitant to do an /etc/init.d/httpd reload without someone double checking! :)

© Server Fault or respective owner

Related posts about apache

Related posts about apache-config