43 lines
1.1 KiB
Plaintext
43 lines
1.1 KiB
Plaintext
<VirtualHost *:80>
|
|
ServerName wp.example.net
|
|
|
|
ErrorLog ${APACHE_LOG_DIR}/wp-error.log
|
|
CustomLog ${APACHE_LOG_DIR}/wp-access.log combined
|
|
|
|
RewriteEngine On
|
|
RewriteCond %{HTTPS} off
|
|
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
|
|
</VirtualHost>
|
|
|
|
<VirtualHost *:443>
|
|
ServerName wp.example.net
|
|
DocumentRoot /var/www/html
|
|
|
|
# TLS1.3無効化
|
|
SSLProtocol all -SSLv2 -SSLv3 -TLSv1.3
|
|
|
|
ErrorLog ${APACHE_LOG_DIR}/wp-error.log
|
|
CustomLog ${APACHE_LOG_DIR}/wp-access.log combined
|
|
|
|
SSLEngine on
|
|
SSLCertificateFile /etc/letsencrypt/live/wp.example.net/fullchain.pem
|
|
SSLCertificateKeyFile /etc/letsencrypt/live/wp.example.net/privkey.pem
|
|
|
|
RewriteEngine On
|
|
# ModSecurityのルールチェックができるようLoginを/直下に書き直す
|
|
RewriteRule ^/([_0-9a-zA-Z-]+/)?(wp-login\.php)$ /wp-login.php [PT,L]
|
|
|
|
<Directory /var/www/html>
|
|
Require all granted
|
|
DirectoryIndex index.php
|
|
AllowOverride FileInfo AuthConfig
|
|
FallbackResource /index.php
|
|
<FilesMatch \.php$>
|
|
SetHandler proxy:fcgi://127.0.0.1:9000
|
|
</FilesMatch>
|
|
</Directory>
|
|
|
|
# ModSecurity
|
|
SecWebAppId "wordpress"
|
|
</VirtualHost>
|