Apache Virtual Hosts

Automatic Virtual Hosts

The configuration for setting up the dynamic vhosts is in /etc/apache2/vhosts.d/99_magic_vhosts.conf

<VirtualHost *:80>
        VirtualDocumentRoot "/home/steve/public_html/%1"
        ServerName dev.beandog.org
        ServerAlias *.beandog.org
        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
</VirtualHost>

If you want to set permissions on a specific directory, the Directory initiative will not accept '%1', although it can use '*'.

Using this configuration, permission to the directory will be denied by default, per Apache's default setup. Create a Directory group to prefix the virtual hosts to allow access:

<Directory "/home/steve/public_html/*">
        Order allow,deny
        Allow from all
</Directory>

Virtual Hosts

Other virtual hosts have configuration files in /etc/apache2/vhosts.d There is one configuration file for each virtual host.