WordPress SSL化

Let’s Encrypt で取得した証明書をインストールする。

SSLCertificateFile /etc/letsencrypt/live/upper-ricefield.net/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/upper-ricefield.net/privkey.pem

DB更新とパッケージ更新

sudo yum install --enablerepo=remi-php74 php php-xmlrpc php-gd php-pdo php-mysqlnd php-pecl-mysql php-pecl-zip php-pecl-apc php-imagick

Webサーバで必要な設定

sudo nano /etc/httpd/conf/httpd.conf

Options All -Indexes +SymLinksIfOwnerMatch -FollowSymLinks

AllowOverride AuthConfig FileInfo Indexes Limit Options=MultiViews,Ind
sudo nano /etc/httpd/conf.d/virtual.conf
<VirtualHost *:80>
ServerName *****.upper-ricefield.net
DocumentRoot /var/www/wp_kldjlkdjslkdsja

Redirect permanent / https://ssl.web.somewhere/
ErrorLog logs/*****-error_log
CustomLog logs/*****-access_log combined env=!no_log
AllowEncodedSlashes On
</VirtualHost>
sudo nano /etc/httpd/conf.d/virtual-ssl.conf
<VirtualHost *:443>
DocumentRoot /var/www/klfjsalj
ServerName ssl.web.somewhere:443
ErrorLog logs/web-somewhere_ssl_error_log
TransferLog logs/web-somewhere_ssl_access_log
LogLevel warn
<Directory "/var/www/wp_cxo3zn9tlm">
        Options All -Indexes +SymLinksIfOwnerMatch -FollowSymLinks
        AllowOverride AuthConfig FileInfo Indexes Limit Options=MultiViews,Ind
</Directory>
<Directory /var/www/wp_aslseihldkd/wp-admin/>
        Order         deny,allow
        Deny from all
        Allow from ***.***.***.***/**
</Directory>
<Files wp-login.php>
        Order deny,allow
        Deny from all
        allow from ***.***.***.***
</Files>
<files xmlrpc.php>
         Order allow,deny
         Deny from all
</files>
<Files "/var/www/wp_seoiujo9hj/wp-admin/site-health.php">
        Order deny,allow
        Deny From All
        Allow From All
</Files>

コメントを残す

メールアドレスが公開されることはありません。