Skip to content

Instantly share code, notes, and snippets.

@skinofstars
Created September 18, 2013 15:02
Show Gist options
  • Save skinofstars/6610472 to your computer and use it in GitHub Desktop.
Save skinofstars/6610472 to your computer and use it in GitHub Desktop.
sub domains in apache VirtualHost
<VirtualHost *:80>
ServerName foo.kevin.dev
ServerAlias foo.local.dev
ServerAlias foo.local.test
DocumentRoot /home/kevin/projects/foo/web/
<Directory /home/kevin/projects/foo/web/>
Options Indexes FollowSymLinks MultiViews
# pcw AllowOverride None
AllowOverride All
Order allow,deny
Allow from all
RewriteEngine On
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ServerSignature On
</VirtualHost>
<VirtualHost *:80>
ServerName bar.foo.kevin.dev
ServerAlias *.foo.kevin.dev
DocumentRoot /home/kevin/projects/foo/web/
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment