Skip to content

Instantly share code, notes, and snippets.

@progrium
Created December 8, 2009 01:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save progrium/251329 to your computer and use it in GitHub Desktop.
Save progrium/251329 to your computer and use it in GitHub Desktop.
# WARNING: Beware of magic beyond just variable replacement.
# See Rakefile task that uses this file for details.
# Macros
Include <root>/config/macros.conf
# SVN
Include <root>/projects/svn.conf
# Site
<VirtualHost *:80>
ServerName <domain>
ServerAlias www.<domain>
DocumentRoot <root>/site/src/newsite/public
Use Logging site
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.*$ [NC]
RewriteRule ^/(.*) http://www.%{HTTP_HOST}/$1 [L,R=301]
AliasMatch ^/(images|stylesheets|javascripts)/(.+) <root>/site/src/newsite/public/$1/$2
WSGIApplicationGroup %{SERVER}
WSGIDaemonProcess <env>-site user=devjavu group=devjavu
WSGIProcessGroup <env>-site
WSGIScriptAlias / <root>/site/newsite.wsgi
<Location />
Allow from all
Order allow,deny
</Location>
Use Deflate
</VirtualHost>
# Trac
<VirtualHost *:80>
ServerName trac.<domain>
ServerAlias *.<domain>
#Live:ServerAlias *
Use Logging trac
Alias /chrome/common <root>/trac/share/htdocs
<Directory "<root>/trac/share/htdocs">
Order allow,deny
Allow from all
</Directory>
RewriteEngine on
RewriteRule ^/projects/([^/]+)(/.*)?$ $2 [R=permanent,QSA]
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias / <root>/trac/share/cgi-bin/trac.wsgi
<Location />
WSGIPassAuthorization On
Allow from all
</Location>
Use Deflate
</VirtualHost>
# Secure proxy
<VirtualHost *:443>
ServerName <domain>:443
ServerAlias *.<domain>:443
Use Logging ssl
RewriteEngine on
RewriteMap hosts-deny txt:<root>/projects/ssl-hosts.deny
RewriteMap svn-deny txt:<root>/projects/ssl-svn.deny
RewriteCond %{HTTP_HOST} ^svn.*
RewriteRule ^/([^/]+)(.*) - [E=PROJECT:$1]
RewriteCond ${hosts-deny:%{HTTP_HOST}|NOT-FOUND} !=NOT-FOUND [OR]
RewriteCond ${svn-deny:%{ENV:PROJECT}|NOT-FOUND} !=NOT-FOUND
RewriteRule ^/(.*) http://%{HTTP_HOST}/$1 [L,R=302]
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile <root>/config/certs/devjavu-<env>.crt
SSLCertificateKeyFile <root>/config/certs/devjavu-<env>.key.unsecure
ProxyPreserveHost On
<Directory />
ProxyPass http://127.0.0.1/
ProxyPassReverse http://127.0.0.1/
SSLRequireSSL
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment