Last active
June 28, 2018 09:02
-
-
Save sergioska/95b20f23306031fe5844201a0d7b493a to your computer and use it in GitHub Desktop.
https apache2
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
<VirtualHost *:443> | |
SSLEngine on | |
SSLCertificateFile "/etc/ssl/ssl_certificate.crt" | |
SSLCertificateKeyFile "/etc/ssl/ssl_certificate.key" | |
SSLCACertificateFile "/etc/ssl/ssl_certificate.ca-bundle" | |
ServerAdmin admin@mysite.com | |
DocumentRoot /var/www/html/mysite | |
ServerName www.mysite.com | |
ServerAlias www.mysite.com | |
ErrorLog logs/ssl.mysite.com-error_log | |
CustomLog logs/ssl.mysite.com-access_log common | |
RewriteEngine On | |
# redirect no www to www | |
RewriteCond %{HTTP_HOST} !^www\. | |
RewriteRule ^\/?(.*)$ https://www.mysite.com/$1 [R=301,L] | |
<Directory "/var/www/html/mysite"> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Require all granted | |
AddDefaultCharset UTF-8 | |
AddType application/vnd.ms-fontobject eot | |
AddType font/opentype otf | |
AddType font/truetype ttf | |
AddType application/x-font-woff woff | |
</Directory> | |
</VirtualHost> |
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
<VirtualHost *:80> | |
DocumentRoot /var/www/html/mysite | |
ServerName www.mysite.com | |
ServerAlias mysite.com | |
Redirect permanent / https://www.mysite.com/ | |
ErrorLog /var/log/httpd/www.mysite.com-error_log | |
CustomLog /var/log/httpd/www.mysite.com-access_log common | |
<Directory "/var/www/html/mysite"> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride all | |
Require all granted | |
</Directory> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
VirtualHost per configurazione https apache2.
Post completo al link qua sotto:
http://www.comemonetizzo.it/passare-da-http-a-https-apache2/