apache map single subdomain to folder apache map single subdomain to folder apache apache

apache map single subdomain to folder


You should be making uglysite into a second file instead of modifying 000-default

So, take a copy of the 000-default file, change the subdomain as you have done up there and modify the directory to /path/to/site

000-default:

<Virtualhost *:80>       ServerName mydomain.com       ServerAdmin www@localhost       ServerAlias mydomain.com       DocumentRoot "/var/www/goodsite"       AccessFileName .htaccess       <Directory "/var/www/goodiste">               Order allow,deny               Allow from All               AllowOverride All       </Directory></VirtualHost>

uglysite:

<Virtualhost *:80>       ServerName uglysite.mydomain.com       ServerAlias uglysite.mydomain.com       ServerAdmin www@localhost       DocumentRoot "/var/www/uglysite"       AccessFileName .htaccess       <Directory "/var/www/uglysite">               Order allow,deny               Allow from All               AllowOverride All       </Directory></VirtualHost>

Also note that in the above samples, I have modified the DocumentRoot to point to the directory that you want file served from

EDIT: virtualhosts set to *:80 since your sites point to your own ip anyway