技術ブログ
Let's Encryptを利用してbaserCMSをSSLに対応する|幡司

1, Let's Encryptをインストールする
サーバーはCentOS 6.7だったので
https://letsencrypt.jp/usage/install-certbot.html#CentOS6
を参考に ./certbot-auto を入れました。
2, 証明書を発行する
ちょっとキモがあります。
./certbot-auto certonly --webroot -w /var/www/vhosts/www.flagsystem.co.jp/html -d www.flagsystem.co.jp
と、ドキュメントルートをそのまま指定すると以下のようなエラーが出ました
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: www.flagsystem.co.jp
Type: unauthorized
Detail: Invalid response from
http://www.flagsystem.co.jp/.well-known/acme-challenge/HtbAHbzpkYI81ikd0RXPkMyF-VoOiconL1GYduw-HBg:
"<!DOCTYPE HTML>
<html lang="ja-JP">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>福"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.調べてみると .well-known というファイルを設置してドメインの所有の有無を確認してるらしいのですが、うまくドキュメントルートが引けない様子。
baserCMS(でスマートURLを使ってる)の場合以下のようになりました
./certbot-auto certonly --webroot -w /var/www/vhosts/www.flagsystem.co.jp/html/app/webroot -d www.flagsystem.co.jp
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
略無事インストール完了!あとはssl.conf作って設定するだけでした。
NEWS一覧へ
