Skip to content

Instantly share code, notes, and snippets.

@jasny
Last active August 29, 2015 13:56
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 jasny/9171488 to your computer and use it in GitHub Desktop.
Save jasny/9171488 to your computer and use it in GitHub Desktop.
Apache2 localhost
<VirtualHost *:80>
ServerName localhost
DocumentRoot /home/arnold/Projects/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/arnold/Projects/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
SetEnv APPLICATION_ENV dev
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName ALL4.localhost
ServerAlias *.*.*.*.localhost
VirtualDocumentRoot /home/arnold/Projects/%-2/%-3/%-4/%-5
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/arnold/Projects/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
SetEnv APPLICATION_ENV dev
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
php_admin_value auto_prepend_file /usr/share/apache2/fix_docroot.php
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName ALL3.localhost
ServerAlias *.*.*.localhost
VirtualDocumentRoot /home/arnold/Projects/%-2/%-3/%-4
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/arnold/Projects/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
SetEnv APPLICATION_ENV dev
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
php_admin_value auto_prepend_file /usr/share/apache2/fix_docroot.php
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName ALL2.localhost
ServerAlias *.*.localhost
VirtualDocumentRoot /home/arnold/Projects/%-2/%-3+
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/arnold/Projects/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
SetEnv APPLICATION_ENV dev
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
php_admin_value auto_prepend_file /usr/share/apache2/fix_docroot.php
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName ALL.localhost
ServerAlias *.localhost
VirtualDocumentRoot /home/arnold/Projects/%-2
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/arnold/Projects/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
SetEnv APPLICATION_ENV dev
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<?php
$_SERVER["ORG_DOCUMENT_ROOT"] = $_SERVER["DOCUMENT_ROOT"];
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["SCRIPT_NAME"], '',$_SERVER["SCRIPT_FILENAME"]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment