「Linux/LetsEncrypt導入」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→nginx設定に追加) |
|||
| 行41: | 行41: | ||
==参考== | ==参考== | ||
*http://sankame.github.io/ssl-tls/letsencrypt_setup/ | *http://sankame.github.io/ssl-tls/letsencrypt_setup/ | ||
| + | *http://qiita.com/sak_2/items/ff835b669c0a7e110b09 | ||
| + | *https://letsencrypt.jp/usage/centos6-error.html#Solution-1 | ||
| + | *https://blog.apar.jp/linux/3619/ | ||
| + | *https://osdn.jp/magazine/16/06/28/090000/2 | ||
2016年7月2日 (土) 09:32時点における版
certbot-autoのインストール
$ git clone https://github.com/certbot/certbot $ cd certbot $ ./certbot-auto
証明書取得
./certbot-auto certonly --webroot \ -w /var/www/example/public -d example.com \ -m sample@example.com \ --agree-tos
以下エラーが発生する場合はPython 2.7を入れる必要がある
./certbot-auto: line 558: virtualenv
Python 2.7のインストール
$ sudo yum install centos-release-scl $ sudo yum install python27 python27-python-tools $ python -V Python 2.6.6 # デフォだと2.6なので以下コマンドで一時的に2.7へ $ sudo scl enable python27 bash $ python -V Python 2.7.8
証明書取得が出来たら以下ファイルが出来てることを確認
# ls /etc/letsencrypt/live/[ドメイン]/ cert.pem chain.pem fullchain.pem privkey.pem
nginx設定に追加
server {
listen 80;
server_name example.net;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 ssl;
server_name example.net;
ssl_certificate /etc/letsencrypt/live/example.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.net/privkey.pem;
