Last active
May 30, 2018 16:20
-
-
Save aamnah/4ceb275b6e095894bd8d to your computer and use it in GitHub Desktop.
Vhost sample file for Apache2
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
| # domain: domain.com | |
| # public: /var/www/domain.com/public_html/ | |
| <VirtualHost *:80> | |
| # Admin email, Server Name (domain name), and any aliases | |
| ServerAdmin [email protected] | |
| ServerName www.domain.com | |
| ServerAlias domain.com | |
| # Index file and Document Root (where the public files are located) | |
| DirectoryIndex index.html index.php | |
| DocumentRoot /var/www/domain.com/public_html | |
| # Allow .htaccess and Rewrites | |
| <Directory /var/www/domain.com/public_html> | |
| Options FollowSymLinks | |
| AllowOverride All | |
| </Directory> | |
| # Log file locations | |
| LogLevel warn | |
| ErrorLog /var/www/domain.com/log/error.log | |
| CustomLog /var/www/domain.com/log/access.log combined | |
| </VirtualHost> |
Author
Author
The other way of enabling the site is by creating a symlink
sudo ln -s /etc/apache2/sites-available/domain.com.conf /etc/apache2/sites-enabled/domain.com.conf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create the conf file in sites-available. Once created, run
sudo a2ensite domain.com.confto enable the site in sites-enabled.