Created
June 4, 2012 14:00
-
-
Save Mouad-BGD/2868601 to your computer and use it in GitHub Desktop.
virtual host
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
| for start we suggest that you combine all configuration on virtual hosting into a single file called vhost.conf located in the /etc/httpd/conf.d/ directory. |
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
| simple Example: | |
| --------------- | |
| NameVirtualHost *:80 | |
| <VirtualHost *:80> | |
| ServerAdmin webmaster@example.com | |
| ServerName example.com | |
| ServerAlias www.example.com | |
| DocumentRoot /srv/www/example.com/public_html/ | |
| ErrorLog /srv/www/example.com/logs/error.log | |
| CustomLog /srv/www/example.com/logs/access.log combined | |
| </VirtualHost> | |
| <VirtualHost *:80> | |
| ServerAdmin webmaster@example.org | |
| ServerName example.org | |
| ServerAlias www.example.org | |
| DocumentRoot /srv/www/example.org/public_html/ | |
| ErrorLog /srv/www/example.org/logs/error.log | |
| CustomLog /srv/www/example.org/logs/access.log combined | |
| </VirtualHost> | |
| **All of the files for the sites that you host will be located in directories that exist underneath /srv/www You can symbolically link these directories into other locations if you need them to exist in other places. | |
| **ErrorLog and CustomLog entries are suggested for more fine-grained logging, but are not required. If they are defined (as shown above), the logs directories must be created before you restart Apache. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment