Skip to content

Instantly share code, notes, and snippets.

@Preacher
Created June 28, 2011 20:52
Show Gist options
  • Save Preacher/1052175 to your computer and use it in GitHub Desktop.
Save Preacher/1052175 to your computer and use it in GitHub Desktop.
Wedding/Coding sites apache conf
<VirtualHost *:80>
ServerAdmin david.stites@afewguyscoding.com
ServerName afewguyscoding.com
ServerAlias www.afewguyscoding.com, davidstites.com, www.davidstites.com, 5280software.com, www.5280software.com, milehigh-software.com, www.milehigh-software.com, milehighsoftware.org, www.milehighsoftware.org,
# this tells rails that it will run in production mode
# this is for rails < 3.x
RailsEnv production
DocumentRoot /var/www/afewguyscoding/current/public
DirectoryIndex index.html
# custom log file locations
# possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel alert
ErrorLog /var/www/afewguyscoding/current/log/error.log
CustomLog /var/www/afewguyscoding/current/log/access.log combined
# allows compression of text based mime.types
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
FileETag None
RewriteEngine On
# check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{REQUEST_URI} !\.(css|jpg|png|gif)$
RewriteCond %{REQUEST_URI} !^/ws/
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html
RewriteCond %{HTTP_HOST} ^davidstites.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^afewguyscoding.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.davidstites.com$ [NC]
RewriteRule ^(.*)$ http://www.afewguyscoding.com$1 [L,R=301]
<Directory /var/www/afewguyscoding/current/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
# In case I ever need CGI
#ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
#<Directory "/usr/lib/cgi-bin">
# AllowOverride None
# Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
# Order allow,deny
# Allow from all
#</Directory>
# how we can restrict access to documents from the local subnet
#Order deny,allow
#Deny from all
#Allow from 127.0.0.0/255.0.0.0 ::1/128
<Location /blog>
PassengerEnabled off
</Location>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin info@afewguyscoding.com
ServerName blog.afewguyscoding.com
DocumentRoot /var/www/wpress
DirectoryIndex index.php
<Directory /var/www/wpress>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin info@davidheartsrachel.com
ServerName davidheartsrachel.com
ServerAlias www.davidheartsrachel.com, rachelanddavid.net, www.rachelanddavid.net, rachelanddavidstites.com, www.rachelanddavidstites.com, rachelanddavidwedding.com, www.rachelanddavidwedding.com
# this tells rails that it will run in production mode
# this is for rails < 3.x
RailsEnv production
# this is for rails >= 3.x
RackEnv production
DocumentRoot /var/www/davidheartsrachel/current/public
DirectoryIndex index.html
# Custom log file locations
# Possible values include: debug, info, notice, warn, error, crit, alert and emerg,
LogLevel alert
ErrorLog /var/www/davidheartsrachel/current/log/error.log
CustomLog /var/www/davidheartsrachel/current/log/access.log combined
# Allows compression of text based mime types
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
FileETag None
RewriteEngine On
# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{REQUEST_URI} !\.(css|jpg|png|gif)$
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
RewriteCond %{HTTP_HOST} ^rachelanddavid.net$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.rachelanddavid.net$ [NC,OR]
RewriteCond %{HTTP_HOST} ^rachelanddavidstites.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.rachelanddavidstites.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^rachelanddavidwedding.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.rachelanddavidwedding.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^davidheartsrachel$ [NC]
RewriteRule ^(.*)$ http://www.davidheartsrachel.com$1 [R=301,L]
# Static cache
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteCond /var/www/davidheartsrachel/current/tmp/cache/static$1/index.html -f
RewriteRule ^(.*)$ /var/www/davidheartsrachel/current/tmp/cache/static$1/index.html [L]
<Directory /var/www/davidheartsrachel/current/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from All
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment