Created
February 26, 2019 09:13
-
-
Save imanilchaudhari/230e0fc91826006fdd63ff6b2bd02502 to your computer and use it in GitHub Desktop.
Apache Virtual hosts examples http, https both
This file contains 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
# example.com.conf: | |
<VirtualHost *:80> | |
ServerName example.com | |
ServerAdmin [email protected] | |
DocumentRoot /var/www/example.com/html | |
<Directory /var/www/example.com/html> | |
Options FollowSymLinks | |
AllowOverride None | |
Require all granted | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . index.php | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/example.com.frontend.error.log | |
CustomLog ${APACHE_LOG_DIR}/example.com.frontend.access.log combined | |
</VirtualHost> | |
# example.com-le-ssl.conf | |
<VirtualHost *:443> | |
ServerName example.com | |
ServerAdmin [email protected] | |
Include /etc/letsencrypt/options-ssl-apache.conf | |
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem | |
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem | |
DocumentRoot /var/www/example.com/html | |
<Directory /var/www/example.com/html> | |
Options FollowSymLinks | |
AllowOverride None | |
Require all granted | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . index.php | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/example.com.frontend.error.log | |
CustomLog ${APACHE_LOG_DIR}/example.com.frontend.access.log combined | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment