Skip to content

Instantly share code, notes, and snippets.

@rturowicz
Last active December 15, 2015 07:59
Show Gist options
  • Save rturowicz/5227807 to your computer and use it in GitHub Desktop.
Save rturowicz/5227807 to your computer and use it in GitHub Desktop.
apache2 zend framework application vhost
#application:
<VirtualHost *:80>user
DocumentRoot "/home/user/WorkspacePHP/zftemplate/public"
ServerAdmin [email protected]
ServerName zftemplate.desktop
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "/home/user/WorkspacePHP/zftemplate/public">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/zftemplate.desktop/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug
CustomLog ${APACHE_LOG_DIR}/zftemplate.desktop/access.log combined
</VirtualHost>
#statics:
<VirtualHost *:80>
DocumentRoot "/home/user/WorkspacePHP/zftemplate/public"
ServerAdmin [email protected]
ServerName i.zftemplate.desktop
<Directory "/home/user/WorkspacePHP/zftemplate/public">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
#.htaccess (in public directory)
ExpiresActive on
ExpiresByType image/gif "access plus 1 years"
ExpiresByType image/jpeg "access plus 1 years"
ExpiresByType image/png "access plus 1 years"
ExpiresByType image/x-icon "access plus 1 years"
ExpiresByType text/css "access plus 1 years"
ExpiresByType text/js "access plus 1 years"
ExpiresByType text/javascript "access plus 1 years"
ExpiresByType application/javascript "access plus 1 years"
ExpiresByType application/x-javascript "access plus 1 years"
RewriteEngine On
RewriteRule ^(.+)/img/(.+)?$ img/$2 [NC,L]
RewriteRule ^(.+)/js/(.+)?$ js/$2 [NC,L]
RewriteRule ^(.+)/css/(.+)?$ css/$2 [NC,L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment