Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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