Skip to content

Instantly share code, notes, and snippets.

@timcrider
Created November 23, 2011 20:54
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timcrider/1389882 to your computer and use it in GitHub Desktop.
Save timcrider/1389882 to your computer and use it in GitHub Desktop.
Apache 'no reboot needed' virtual host configuration for development sites.
###############################################################################
#
# Apache virtual host 'no reboot needed' template.
#
# This apache virtualhost configuration allows a user to create development
# sites on the fly. This will not work out of the box however, you will need
# to replace the {variables} in this conf with values explained below. This
# can be done with a script, or a simple find and replace in your favorite
# editor.
#
###############################################################################
# Examples
#
# TESTING.dev.mysite.com = /path/to/development/TESTING/html/
# blog.dev.mysite.com = /path/to/development/blog/html/
# simple.dev.mysite.com = /path/to/development/simple/html/
#
###############################################################################
# Known Issues
#
# All of the development sites are logged into the same access/error files.
#
###############################################################################
# Variables
#
# {serverip} - IP apache is bound to, may include port. (ex: 127.0.0.1 or 127.0.0.1:80)
# {root} - Path to the development root. (ex: /path/to/home/devsites/)
# {logroot} - Path to the development site logs. (ex: /path/to/home/logs/)
# {domain} - Domain that will host the development. (ex: devsites.mysite.com)
# {adminemail} - Email address of the server admin. (ex: me@domain.com)
#
###############################################################################
<VirtualHost {serverip}>
DocumentRoot {root}dev/html/
ServerName {domain}
ServerAlias *.{domain}
AccessFileName .htaccess
ServerSignature Off
UseCanonicalName Off
DirectoryIndex index.php index.html index.htm
ErrorLog {logroot}{domain}-error.log
CustomLog {logroot}{domain}-access.log combined
LogLevel debug
ServerAdmin {adminemail}
<Directory "{root}">
allow from all
Options -Indexes
AllowOverride All
</Directory>
VirtualDocumentRoot {root}%1/html/
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment