プロジェクト

全般

プロフィール

Lets' encryptを使ってSSL証明書を発行 » 履歴 » バージョン 1

蒲池 晃, 2021/07/03 14:46

1 1 蒲池 晃
h1. Lets' encryptを使ってSSL証明書を発行
2 1 蒲池 晃
3 1 蒲池 晃
* インストール
4 1 蒲池 晃
<pre>apt-get install certbot</pre>または
5 1 蒲池 晃
<pre>yum -y install certbot</pre>
6 1 蒲池 晃
7 1 蒲池 晃
* 起動
8 1 蒲池 晃
<pre>systemctl start certbot</pre>
9 1 蒲池 晃
10 1 蒲池 晃
* 証明書の初回発行
11 1 蒲池 晃
<pre>
12 1 蒲池 晃
certbot certonly --agree-tos --non-interactive -d <ドメイン名> --webroot -w <ドキュメントルート> --email <メールアドレス>
13 1 蒲池 晃
</pre>例)
14 1 蒲池 晃
ドメイン名 redmine.aitp.jp 
15 1 蒲池 晃
ドキュメントルート /opt/bitnami/apps/redmine/htdocs/public
16 1 蒲池 晃
メールアドレス akamachi@ait-partner.co.jp
17 1 蒲池 晃
18 1 蒲池 晃
* 下記のようなエラーが出ることがある
19 1 蒲池 晃
<pre>
20 1 蒲池 晃
Problem binding to port 80: Could not bind to IPv4 or IPv6.
21 1 蒲池 晃
</pre>
22 1 蒲池 晃
この場合は、apatchを停止しておくと動く
23 1 蒲池 晃
また、port:80が解放されていない場合も同様にエラーになる
24 1 蒲池 晃
25 1 蒲池 晃
* bitnami.conf の修正
26 1 蒲池 晃
<pre>
27 1 蒲池 晃
<VirtualHost *:443>
28 1 蒲池 晃
    :
29 1 蒲池 晃
  SSLCertificateKeyFile /etc/letsencrypt/live/<ドメイン名>/privkey.pem
30 1 蒲池 晃
  SSLCertificateFile /etc/letsencrypt/live/<ドメイン名>/cert.pem
31 1 蒲池 晃
  SSLCertificateChainFile /etc/letsencrypt/live/<ドメイン名>/chain.pem
32 1 蒲池 晃
    :
33 1 蒲池 晃
</VirtualHost>
34 1 蒲池 晃
</pre>