Последняя активность 1747695966

My default config file for a domain for Apache.

Версия 3f0a77c869eb88921cc7bd1f6c2e616053e55e9a

gistfile1.txt Исходник
1Protocols h2 h2c http/1.1
2
3<VirtualHost *:80>
4 <Directory /var/www/html/website/>
5 Options Indexes FollowSymLinks MultiViews
6 AllowOverride All
7 Order allow,deny
8 allow from all
9 </Directory>
10
11 ServerAdmin email@address.tld
12 ServerName domain.tld
13 DocumentRoot /var/www/html/website
14
15 ErrorLog ${APACHE_LOG_DIR}/website.error.log
16
17 RewriteEngine On
18 RewriteCond %{SERVER_NAME} =domain.tld
19 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
20</VirtualHost>
21
22<VirtualHost *:443>
23 <Directory /var/www/html/website/>
24 Options Indexes FollowSymLinks MultiViews
25 AllowOverride All
26 Order allow,deny
27 allow from all
28 </Directory>
29
30# Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
31
32 ServerAdmin email@address.tld
33 ServerName domain.tld
34 DocumentRoot /var/www/html/website
35
36 ErrorLog ${APACHE_LOG_DIR}/website.error.log
37
38 RewriteEngine On
39 RewriteCond %{SERVER_NAME} =domain.tld
40 RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
41 RewriteCond %{THE_REQUEST} !HTTP/1.1$
42 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
43
44 SSLCertificateFile /etc/letsencrypt/live/domain-tld/fullchain.pem
45 SSLCertificateKeyFile /etc/letsencrypt/live/domain.tld/privkey.pem
46 Include /etc/letsencrypt/options-ssl-apache.conf
47</VirtualHost>