Skip to content

Instantly share code, notes, and snippets.

@jasny
Last active Aug 29, 2015
Embed
What would you like to do?
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