Skip to content

Instantly share code, notes, and snippets.

@anilnautiyal
Last active February 13, 2020 12:59
Show Gist options
  • Save anilnautiyal/8778012517a278590a3ced61b614c48c to your computer and use it in GitHub Desktop.
Save anilnautiyal/8778012517a278590a3ced61b614c48c to your computer and use it in GitHub Desktop.
VirtualHost Conf File
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /home/user/example.com/public/
<Directory /home/user/example.com/public/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
CustomLog /var/log/apache2/example.com-access.log forwarded
ErrorLog /var/log/apache2/example.com-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
</VirtualHost>
<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /home/user/example.com/public/
<Directory /home/user/example.com/public/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
CustomLog /var/log/apache2/example.com-access.log combined
ErrorLog /var/log/apache2/example.com-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment