Last active
August 29, 2015 14:13
-
-
Save leo-cheron/cd6027a61ce2cf8a93d3 to your computer and use it in GitHub Desktop.
Apache2 virtual host macro template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Macro VHost $name $domain> | |
<Directory /var/www/$name/*> | |
Options FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all | |
</Directory> | |
<VirtualHost *:80> | |
ServerName $domain | |
DocumentRoot /var/www/$name/www | |
php_admin_value open_basedir /var/www/$name/:/tmp/ | |
ErrorLog ${APACHE_LOG_DIR}/$name.log | |
</VirtualHost> | |
<VirtualHost *:80> | |
ServerName $domain | |
ServerAlias *.$domain | |
VirtualDocumentRoot /var/www/$name/%1 | |
php_admin_value open_basedir /var/www/$name/:/tmp/ | |
#RewriteEngine On | |
#RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ | |
#RewriteRule ^\/?(.*?)$ http://www.%{HTTP_HOST}/$1 [L,R=301] | |
</VirtualHost> | |
</Macro> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use VHost folderName domain.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment