Apache Virtual Host Examples
Standard
Stored in dummy-host.conf under the sites-available/ etc apache directory:
<VirtualHost *:8080>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/usr/local/opt/httpd/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "/usr/local/var/log/httpd/dummy-host.example.com-error_log"
CustomLog "/usr/local/var/log/httpd/dummy-host.example.com-access_log" common
</VirtualHost>
Path Alias
Allows you to map a /path to another folder
<VirtualHost *:8080>
ServerName dummy-host.example.com
DocumentRoot /usr/local/opt/httpd/docs/dummy-host.example.com
Alias /code /srv/git/public
<Directory /srv/git/public>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>