Skip to content

Instantly share code, notes, and snippets.

@simple
Created August 26, 2012 09:44
Show Gist options
  • Save simple/3476671 to your computer and use it in GitHub Desktop.
Save simple/3476671 to your computer and use it in GitHub Desktop.
Virtual Host conf example for zend project
#
# Virtual Hosts
#
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHosts
#
# use host FQDN as PROJECT_NAME, e.g., api.github.com
# ln -s $HOME/workspaces/juno-jee/PROJECT_NAME $HOME/www/sites/
# DocumentRoot $HOME/www/sites/PROJECT_NAME/public
# ServerName PROJECT_NAME
# ServerAlias LOCAL_DOMAIN for PROJECT_NAME, e.g., api.github.com => api.github.local
# Add "127.0.0.1 LOCAL_DOMAIN" to /etc/hosts
# ErrorLog $HOME/www/logs/PROJECT_NAME-error_log
# CustomLog $HOME/www/logs/PROJECT_NAME-access_log combined
<Directory "/Users/simple/www/sites">
Options FollowSymLinks MultiViews
AllowOverride FileInfo
Order allow,deny
Allow from all
</Directory>
# PROJECT_NAME = api.pickat.com
<VirtualHost *:80>
ServerAdmin cherry@kiwiple.com
DocumentRoot "/Users/simple/www/sites/api.pickat.com/public"
ServerName api.pickat.com
ServerAlias api.pickat.local
ErrorLog "/Users/simple/www/logs/api.pickat.com-error_log"
CustomLog "/Users/simple/www/logs/api.pickat.com-access_log" combined
<Location />
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</Location>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment