Skip to content

Instantly share code, notes, and snippets.

@endersonmaia
Created June 22, 2012 15:01
Show Gist options
  • Save endersonmaia/2973292 to your computer and use it in GitHub Desktop.
Save endersonmaia/2973292 to your computer and use it in GitHub Desktop.
Apache Dynamic VHosts, PHP and Pow on Mac OS X
#
# Use this file to make all directories in /Users/enderson/Sites/ available via localtest.me
#
# Example:
#
# www.example.com.localtest.me --> /Users/enderson/Sites/www.example.com
# a.www.example.com.localtest.me --> /Users/enderson/Sites/a.www.example.com
# example.com.localtest.me --> /Users/enderson/Sites/example.com
#
# Change enderson to fit your username.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
UseCanonicalName Off
LogFormat "%V %h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"" dynamic_vhosts
CustomLog /var/log/apache2/access_log dynamic_vhosts
<VirtualHost *:80>
<Directory "/Users/enderson/Sites/">
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<IfModule mod_vhost_alias.c>
VirtualDocumentRoot /Users/enderson/Sites/%-3+
VirtualScriptAlias /Users/enderson/Sites/%-3+/cgi
<DirectoryMatch "^/srv/www/vhosts/[^/]+/cgi">
AllowOverride None
Options ExecCGI
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
</DirectoryMatch>
</IfModule>
</VirtualHost>
<VirtualHost *:80>
ServerName pow
ServerAlias *.dev
ServerAlias *.xip.io
ProxyPass / http://localhost:20559/
ProxyPassReverse / http://localhost:20559/
ProxyPreserveHost On
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment