Created
June 17, 2015 05:12
-
-
Save zvineyard/075f4b1db4999617149e to your computer and use it in GitHub Desktop.
Example vhost file with SSL
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
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
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 [email protected] | |
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