Skip to content

Instantly share code, notes, and snippets.

@thomasjbradley
Created January 21, 2013 02:32
Show Gist options
  • Save thomasjbradley/4583242 to your computer and use it in GitHub Desktop.
Save thomasjbradley/4583242 to your computer and use it in GitHub Desktop.
Dynamic vhost setup with Apache
NameVirtualHost *:80
NameVirtualHost *:443
<Virtualhost *:80>
VirtualDocumentRoot /www/%1
UseCanonicalName Off
SetEnv ENV dev
ServerName vhosts.dev
ServerAlias *.dev
ServerAlias *.xip.io
ServerAlias *.nip.io
ServerAlias *.teletraan.thomasjbradley.ca
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
ErrorLog /db/www-config/vhosts-error.log
<Directory /www/*>
Allow From All
AllowOverride All
Options All
Order allow,deny
</Directory>
</Virtualhost>
<Virtualhost *:443>
VirtualDocumentRoot /www/%1
UseCanonicalName Off
SetEnv ENV dev
ServerName vhosts.dev
ServerAlias *.dev
ServerAlias *.xip.io
ServerAlias *.nip.io
ServerAlias *.teletraan.thomasjbradley.ca
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
ErrorLog /db/www-config/vhosts-error.log
SSLEngine on
SSLCertificateFile /db/www-config/ssl/dev.crt
SSLCertificateKeyFile /db/www-config/ssl/dev.pem
<Directory /www/*>
Allow From All
AllowOverride All
Options All
Order allow,deny
</Directory>
</Virtualhost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment