Created
September 18, 2012 07:15
-
-
Save quoidautre/3741745 to your computer and use it in GitHub Desktop.
UBUNTU: Virtual Hosts
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
| -1- | |
| <VirtualHost *:80> | |
| ServerAdmin webmaster@localhost | |
| DocumentRoot /var/www | |
| <Directory /> | |
| Options FollowSymLinks | |
| AllowOverride None | |
| </Directory> | |
| <Directory /var/www/> | |
| Options Indexes FollowSymLinks MultiViews | |
| AllowOverride None | |
| Order allow,deny | |
| allow from all | |
| </Directory> | |
| ScriptAlias /cgi-bin/ /var/www/cgi-bin/ | |
| <Directory "/var/www/cgi-bin"> | |
| AllowOverride None | |
| Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch | |
| Order allow,deny | |
| Allow from all | |
| </Directory> | |
| 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 | |
| Alias /doc/ "/usr/share/doc/" | |
| <Directory "/usr/share/doc/"> | |
| Options Indexes MultiViews FollowSymLinks | |
| AllowOverride None | |
| Order deny,allow | |
| Deny from all | |
| Allow from 127.0.0.0/255.0.0.0 ::1/128 | |
| </Directory> | |
| </VirtualHost> | |
| ------------------------------------------------------------------------------------------------------------------ | |
| -2- | |
| <VirtualHost *:80> | |
| ServerName qda-new-website | |
| DocumentRoot /var/www/qda-new-website/trunk/web/www | |
| <directory "/var/www/qda-new-website/trunk/web/www"> | |
| Options Indexes FollowSymLinks | |
| AllowOverride all | |
| Order Deny,Allow | |
| Allow from all | |
| </directory> | |
| </VirtualHost> | |
| -1- This file : /etc/apache2/sites-available/default | |
| -2- a new host : /etc/apache2/sites-available/qda-new-website.conf | |
| and do this to link sites available and enable : sudo a2ensite qda-new-website.conf | |
| + add : "127.0.0.1 qda-new-website" in "/etc/hosts" file | |
| + sudo find /var/www/qda-new-website/trunk/web/www -type d -exec chmod 755 {} \; | |
| + sudo find /var/www/qda-new-website/trunk/web/www -type f -exec chmod 640 {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment