Thursday, April 18, 2013

Ubuntu: Add new domain / subdomain in apache

Navigate to /etc/apache2/sites-available. Create a file with your new domain name and add the following:

#file: mydomain.com
<VirtualHost *:80>
        ServerName mydomain.com
        DocumentRoot /root/directory/of/site
</VirtualHost>

Enable the configuration for the new domain with the following command:

a2ensite mydomain.com

 Restart Apache

service apache2 restart

No comments:

Post a Comment