conohaでSSL化(続いたよ)
昨日の記事を書いて、喜んでいたんですが…最後の確認までしないとですね。
apacheが起動しなくなりました。
原因は調査中ではありますが、現在は
/etc/httpd/conf.d/ssl.conf
の中身の一部を SSLEngine off
とすることで起動まではできました。
ちゃんとhttpsで閲覧できるまで見守ります。
続報
動きました。
リセットする気持ちで、鍵を再発行したら行けました。案外こんなところに落とし穴、ですね。 SSLEngineもofにして、Laravelも表示順調。
Let’s Encrypt を使った SSL/TLS サーバ証明書発行と自動更新の構築 | レンタルサーバー・自宅サーバー設定・構築のヒント
https://www.tetsis.com/blog/?p=375
あとは、定期的に開発環境の証明書をrenewする必要があるだけですね。
conohaでSSL化(続くよ)
やること
1.http通信とhttps通信をF/W許可 2.必要なアプリケーションのインストール
1.http通信とhttps通信をF/W許可
sudo firewall-cmd --list-all
を実行します。
結果、
public (active) target: default icmp-block-inversion: no interfaces: eth0 eth1 sources: services: ssh dhcpv6-client ports: protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules:
となる。
services: ssh dhcpv6-client
が許可されてるプロトコルなので、httpとhttpsがほしいんですね。 ※私の場合既にhttpはありました。 そこで、次のコマンド。
firewall-cmd --permanent --add-service=http --zone=public firewall-cmd --permanent --add-service=https --zone=public firewall-cmd --reload
1行目でhttpの許可、2行目でhttpsの許可。 最後にリロードしましょってだけです。
このコマンド、"success"って一言しか言ってくれないのはシンプルで良き。 再度確認しましょ↓
sudo firewall-cmd --list-all
を実行します。
結果、
public (active) target: default icmp-block-inversion: no interfaces: eth0 eth1 sources: services: ssh dhcpv6-client http https ports: protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules:
OKOK。
2.必要なアプリケーションの実行
流すだけっすね。
yum install epel-release yum install certbot python-certbot-apache
そしたら
certbot certonly --webroot -w /var/www/html -d www.example.com
で発行してあげましょう。(ドメインは自分で変えてね。)
メールアドレスを聞かれるから、入力して、あとは AgreeとYesを入力すればよき。
メールは一応届きますぞ。
Apacheに証明書を設定
最後、発行された証明書を設定しましょうかね。
vim /etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/letsencrypt/live/www.example.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/www.example.com/privkey.pem
systemctl restart httpd
はえー、こんなもんか。ホクホク。
conoha再来
今日の勉強。
clodu9だと埒が明かない部分が出てくるので、久々にconohaちゃんの出番です。
1からやるのは久々。。なのでいろいろ調べながら。
あとこれ便利!PHPStorm購入までお世話になります
あとは自分用のメモ
/etc/httpd/conf/httpd.conf
Railsでチャットだぞ?!
Laravelより簡単にできた…しゅごい…