This shows you the differences between two versions of the page.
|
virtual_host_templates [2009/02/06 09:45] danux created |
virtual_host_templates [2009/02/06 10:07] (current) danux |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ====== Virtual Host Templates ====== | ====== Virtual Host Templates ====== | ||
| + | All folders are lower case, with underscores (_) to denote spaces between words. In event of a long name, separate initials or logical abbreviations with underscores | ||
| + | |||
| + | ===== Django Sites ===== | ||
| + | |||
| + | # SITE NAME | ||
| + | <VirtualHost *> | ||
| + | ServerName www.mysite.com | ||
| + | ServerAlias mysite.com | ||
| + | SetHandler python-program | ||
| + | PythonPath "['/<sitepath>/<sitename>'] + sys.path" | ||
| + | PythonHandler django.core.handlers.modpython | ||
| + | SetEnv DJANGO_SETTINGS_MODULE <appname>.settingshttp://creativecommons.org/licenses/by-nc-sa/3.0/ | ||
| + | # Logs | ||
| + | CustomLog /web/logs/<sitename>/site-access.log "combined" | ||
| + | ErrorLog /web/logs/<sitename>/site-error.log | ||
| + | # 301 Redirects | ||
| + | RewriteEngine on | ||
| + | RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC] | ||
| + | RewriteRule .? http://www.mysite.com%{REQUEST_URI} [R=301,L] | ||
| + | </VirtualHost> | ||
| + | |||
| + | # SITE NAME MEDIA | ||
| + | <VirtualHost *> | ||
| + | ServerName media.mysite.com | ||
| + | DocumentRoot /web/sites/<sitename>/media | ||
| + | CustomLog /web/logs/<sitename>/media-access.log "combined" | ||
| + | ErrorLog /web/logs/<sitename>/media-error.log | ||
| + | FileETag MTime Size | ||
| + | ExpiresActive On | ||
| + | ExpiresByType image/* "access plus 7 days" | ||
| + | ExpiresByType text/css "access plus 7 days" | ||
| + | ExpiresByType application/x-javascript "access plus 7 days" | ||
| + | Options FollowSymlinks | ||
| + | SetOutputFilter DEFLATE | ||
| + | SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \ | ||
| + | no-gzip dont-vary | ||
| + | SetEnvIfNoCase Request_URI \ | ||
| + | \.(?:exe|t?gz|zip|bz2|sit|rar)$ \ | ||
| + | no-gzip dont-vary | ||
| + | SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary | ||
| + | </VirtualHost> | ||