Skip to content

Instantly share code, notes, and snippets.

@zvineyard
Created June 17, 2015 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zvineyard/075f4b1db4999617149e to your computer and use it in GitHub Desktop.
Save zvineyard/075f4b1db4999617149e to your computer and use it in GitHub Desktop.
Example vhost file with SSL
<VirtualHost *:80>
ServerAdmin admin@yourdomain.com
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /home/yourdomain/public_html
<Directory />
Options None
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
<Directory /home/yourdomain/public_html>
Options None +FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
Require all granted
</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
</VirtualHost>
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/yourdomain_com.crt
SSLCertificateKeyFile /etc/apache2/ssl/yourdomain_com.key
SSLCACertificateFile /etc/apache2/ssl/yourdomain_com.cer
ServerAdmin admin@yourdomain.com
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /home/yourdomain/public_html
<Directory />
Options None
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
<Directory /home/yourdomain/public_html>
Options None +FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
Require all granted
</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
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment