Skip to content

Instantly share code, notes, and snippets.

@cesc1989
Last active April 5, 2017 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cesc1989/59bee8a8fb6b2785c000 to your computer and use it in GitHub Desktop.
Save cesc1989/59bee8a8fb6b2785c000 to your computer and use it in GitHub Desktop.
Correctly setup subdomain in apache conf file
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin user@mail.com
ServerName sub.domain.com
ServerAlias www.sub.domain.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/subdomainfolder/public_html
# Log file locations
LogLevel warn
ErrorLog /var/www/subdomainfolder/log/error.log
CustomLog /var/www/subdomainfolder/log/access.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment