【WordPress】 テーマ Twenty Seventeen で横幅を1500pxにし、Blogを1カラムにする

WordPressはyumで入れた(yum install wordpress)ので、 /usr/share/wordpress/wp-content/themes/twentyseventeen/style.css をごりごり書き換えた。

$ diff style.css /usr/share/wordpress/wp-content/themes/twentyseventeen/style.css -u
--- style.css   2018-04-28 13:05:27.000000000 +0900
+++ /usr/share/wordpress/wp-content/themes/twentyseventeen/style.css    2018-04-28 13:55:24.000000000 +0900
@@ -1319,7 +1319,7 @@
 }

 .navigation-top .wrap {
-       max-width: 1000px;
+       max-width: 1500px;
        padding: 0;
 }

@@ -2084,7 +2084,7 @@
 .archive.page-one-column:not(.has-sidebar) #primary {
        margin-left: auto;
        margin-right: auto;
-       max-width: 740px;
+       max-width: 1240px;
 }

 .single-featured-image-header {
@@ -3273,7 +3273,7 @@
        }

        .page-one-column .panel-content .wrap {
-               max-width: 740px;
+               max-width: 1240px;
        }

        .panel-content .entry-header {
@@ -3349,7 +3349,7 @@
        /* Layout */

        .wrap {
-               max-width: 1000px;
+               max-width: 1500px;
                padding-left: 3em;
                padding-right: 3em;
        }
@@ -3458,7 +3458,7 @@
        }

        .navigation-top .wrap {
-               max-width: 1000px;
+               max-width: 1500px;
                /* The font size is 14px here and we need 50px padding in ems */
                padding: 0.75em 3.4166666666667em;
        }
@@ -3822,8 +3822,8 @@
        body.has-sidebar.error404 #primary .page-header,
        body.page-two-column:not(.archive) #primary .entry-header,
        body.page-two-column.archive:not(.has-sidebar) #primary .page-header {
-               float: left;
-               width: 36%;
+               float: none;
+               width: 94%;
        }

        .blog:not(.has-sidebar) #primary article,
@@ -3833,8 +3833,8 @@
        .error404.has-sidebar #primary .page-content,
        body.page-two-column:not(.archive) #primary .entry-content,
        body.page-two-column #comments {
-               float: right;
-               width: 58%;
+               float: none;
+               width: 94%;
        }

        .blog .site-main > article,

【CentOS7】 acme-tinyをyumでインストールし、let’s encryptでSSL証明書を取得する

acme-tinyはapacheの再起動とか余計なことをしないので、certbotより使いやすいと思います。
詳しくは https://github.com/diafygi/acme-tiny をご参照ください。

認証したいドメイン名が 171220.0x0c.info で、httpサーバに apache 2.4.8以降を用いる場合で説明します。


Step 1

このへんは環境に合わせてください↓

yum install httpd mod_ssl
yum install epel-release 
yum install acme-tiny

Step 2

acme-tinyをインストールすると /etc/httpd/conf.d/acme.conf/var/www/challenges/ ができるので、apacheをリロードするなりここから起動するなりします。

service httpd start

Step 3

アカウントキー作成

openssl genrsa 4096 > /var/lib/acme/private/account.key

Step 4

ドメイン用の秘密キー作成

openssl genrsa 4096 > /var/lib/acme/private/171220.0x0c.info.key

Step 5

リクエスト作成

openssl req -new -sha256 -key /var/lib/acme/private/171220.0x0c.info.key -subj "/CN=171220.0x0c.info" > /var/lib/acme/csr/171220.0x0c.info.csr

Step 6

let’s encryptにリクエストする

/usr/sbin/acme_tiny --chain --account-key /var/lib/acme/private/account.key --csr /var/lib/acme/csr/171220.0x0c.info.csr --acme-dir /var/www/challenges/ > /var/lib/acme/certs/171220.0x0c.info.crt

Step 7

できあがった証明書と秘密鍵をコピーしてapacheをリロード。
このあたりも環境に合わせてください。

cp /var/lib/acme/private/171220.0x0c.info.key /etc/pki/tls/private/localhost.key
cp /var/lib/acme/certs/171220.0x0c.info.crt /etc/pki/tls/certs/localhost.crt
service httpd reload

Step 8

以下のようなスクリプトを作り、一ヶ月に一回cronで回す。

#!/bin/sh
/usr/sbin/acme_tiny --chain --account-key /var/lib/acme/private/account.key --csr /var/lib/acme/csr/171220.0x0c.info.csr --acme-dir /var/www/challenges/ > /var/lib/acme/certs/171220.0x0c.info.crt || exit
cp /var/lib/acme/certs/171220.0x0c.info.crt /etc/pki/tls/certs/localhost.crt
/usr/sbin/service httpd reload

おまけ:nginxの場合

上記Step 5とStep 6の間に、以下のようにnginxを設定し、リロードしておきます。

server {
        listen 80 default_server;

の下に以下のように設定します。

        #for acme-tiny
        location /.well-known/acme-challenge/ {
            alias /var/www/challenges/;
            try_files $uri =404;
        }