CentOS6にcertbotをインストールする

CentOS6は既にサポート期限切れのため、通常の手順でインストールはできません。新しいOSに移行するのが正しいやり方ですが、暫定措置としてCentOS6のまま対応させます。

pipでcertbotをインストール

参考にしたのは下記のページです。

# python3 -m venv /opt/certbot/
# /opt/certbot/bin/pip install --upgrade pip
# /opt/certbot/bin/pip install certbot certbot-apache
# ln -s /opt/certbot/bin/certbot /usr/bin/certbot
# certbot --version

自分の環境の場合、下記のエラーが出ましたが、これはPython3がSSLなしでビルドされていることが原因でした。

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Python3をビルドした後にOpenSSLをyumでインストールしています。そのため、下記のページの通り、再度./configureからmake installまでをやり直しました。OpenSSLが既にインストール済みなので、configure時点でSSLは有効になります。

証明書類は/etc/letsencrypt配下にありますので、ssl.confの設定内容を書き直して、apacheを再起動します。

SLCertificateFile /etc/letsencrypt/live/omoshiro-joho.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/omoshiro-joho.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/omoshiro-joho.com/chain.pem
# apachectl restart

これで解消されました。httpでリンクしている画像ファイル関連でまだ怒られますが、これはコンテンツの中身(URL)の方を変更するしかありません。

履歴


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS