Skip to content

Instantly share code, notes, and snippets.

@edavis10
Created September 18, 2009 18:16
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save edavis10/189206 to your computer and use it in GitHub Desktop.
Save edavis10/189206 to your computer and use it in GitHub Desktop.
<VirtualHost *:80>
ServerName projects.littlestreamsoftware.com
RewriteEngine On
# Redirect any non HTTPS requests to the HTTPS server
RewriteCond %{HTTP_HOST} ^projects.littlestreamsoftware.com$ [NC]
RewriteRule ^(.*)$ https://projects.littlestreamsoftware.com$1 [R=301,L]
Include /etc/apache2/common/hide-svn
Include /etc/apache2/common/deflate
</VirtualHost>
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine on
# Self-signed
# SSLCertificateFile /etc/apache2/apache.pem
SSLCertificateFile /etc/apache2/ssl/2009/projects.littlestreamsoftware.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/2009/projects.littlestreamsoftware.com.key
# this is only needed for GoDaddy certificates
SSLCertificateChainFile /etc/apache2/ssl/2009/gd_bundle.crt
RequestHeader set X_FORWARDED_PROTO 'https'
ServerAdmin webmaster@localhost
RewriteEngine On
## Bit faster by storing the Rails Framework in memory but not needed at this scale
# RailsSpawnMethod smart
RailsAppSpawnerIdleTime 0
DocumentRoot /home/websites/projects.littlestreamsoftware.com/current/public
<Directory "/home/websites/projects.littlestreamsoftware.com/current/public">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Uncomment for rewrite debugging
# RewriteLog /tmp/myapp_rewrite_log
# RewriteLogLevel 9
# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
# Rewrite index to check for static
RewriteRule ^/$ /cache/index.html [QSA]
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ /cache/$1.html [QSA]
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/admin-access.log combined
ServerSignature Off
Include /etc/apache2/common/hide-svn
Include /etc/apache2/common/deflate
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment