Created
September 25, 2013 16:00
-
-
Save inlanger/6701831 to your computer and use it in GitHub Desktop.
Apache virtualhost with gzip, expires and mod_wsgi django settings.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin webmaster@sitename.com | |
ServerName sitename.com | |
DocumentRoot /var/www/sitename.com | |
WSGIScriptAlias / /var/www/sitename.com/django.wsgi | |
ErrorLog /var/www/sitename.com/error.log | |
ExpiresActive on | |
ExpiresByType application/javascript "access plus 1 months" | |
ExpiresByType image/gif "access plus 1 months" | |
ExpiresByType image/png "access plus 1 months" | |
ExpiresByType image/jpg "access plus 1 months" | |
ExpiresByType image/jpeg "access plus 1 months" | |
ExpiresByType font/ttf "access plus 1 months" | |
ExpiresByType text/css "access plus 1 months" | |
<IfModule mod_deflate.c> | |
<FilesMatch "\.(ttf|otf|eot|svg)$" > | |
SetOutputFilter DEFLATE | |
</FilesMatch> | |
</IfModule> | |
Alias /media /var/www/sitename.com/media | |
Alias /static /var/www/sitename.com/static | |
Alias /robots.txt /var/www/sitename.com/static/robots.txt | |
<Location "/robots.txt"> | |
SetHandler None | |
</Location> | |
<Location "/static/"> | |
SetHandler None | |
</Location> | |
<Location "/media/"> | |
SetHandler None | |
</Location> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment