# apt-get install certbot |
# systemctl
restart h2o |
#
certbot certonly --webroot -w /home/karappi/public_html/
-d karappi.mydns.jp --agree-tos Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator webroot, Installer None Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): hogehoge@abcdefgx.edu.jp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you be willing to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot? We'd like to send you email about our work encrypting the web, EFF news, campaigns, and ways to support digital freedom. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: Y Obtaining a new certificate Performing the following challenges: http-01 challenge for karappi.mydns.jp Using the webroot path /home/karappi/public_html for all unmatched domains. Waiting for verification... Cleaning up challenges IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/karappi.mydns.jp/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/karappi.mydns.jp/privkey.pem Your cert will expire on 2020-09-24. To obtain a new or tweaked version of this certificate in the future, simply run certbot again. To non-interactively renew *all* of your certificates, run "certbot renew" - Your account credentials have been saved in your Certbot configuration directory at /etc/letsencrypt. You should make a secure backup of this folder now. This configuration directory will also contain certificates and private keys obtained by Certbot so making regular backups of this folder is ideal. - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le |
# certbot delete
--cert-name karappi.mydns.jp |
server-name: "h2o (Debian)" user: www-data access-log: "|rotatelogs -l -f -L /var/log/h2o/access.log -p /usr/share/h2o/compress_logs /var/log/h2o/access.log.%Y-%m-%d 86400" error-log: "|rotatelogs -l -f -L /var/log/h2o/error.log -p /usr/share/h2o/compress_logs /var/log/h2o/error.log.%Y-%m-%d 86400" pid-file: /run/h2o.pid file.index: ['index.html'] listen: 80 listen: port: 443 ssl: certificate-file: /etc/letsencrypt/live/karappi.mydns.jp/fullchain.pem key-file: /etc/letsencrypt/live/karappi.mydns.jp/privkey.pem hosts: # httpでアクセスがあったらhttpsにリダイレクト "karappi.mydns.jp:80": paths: "/": redirect: url: https://karappi.mydns.jp/ status: 301 "karappi.mydns.jp:443": paths: "/": file.dir: /home/karappi/public_html file.custom-handler: extension: .cgi fastcgi.spawn: command: "exec /usr/sbin/fcgiwrap" "/kisho": mruby.handler: | require "htpasswd.rb" acl { use Htpasswd.new("/home/karappi/.htpasswd_3", "realm-name") } file.dir: /home/karappi/public_html/kisho file.custom-handler: extension: .cgi fastcgi.spawn: command: "exec /usr/sbin/fcgiwrap" /server-status: status: ON |
# h2o -c h2o.conf -t |
#systemctl restart h2o |
# /usr/bin/certbot renew
&& /bin/systemctl restart h2o |
#毎月3日の2時1分に証明書を更新する 01 02 03 * * /usr/bin/certbot renew && /bin/systemctl restart h2o |
server-name: "h2o (Debian)" user: www-data access-log: "|rotatelogs -l -f -L /var/log/h2o/access.log -p /usr/share/h2o/compress_logs /var/log/h2o/access.log.%Y-%m-%d 86400" error-log: "|rotatelogs -l -f -L /var/log/h2o/error.log -p /usr/share/h2o/compress_logs /var/log/h2o/error.log.%Y-%m-%d 86400" pid-file: /run/h2o.pid hosts: "karappi.mydns.jp:80": listen: port: 80 paths: /: file.dir: /home/hogehoge/public_html redirect: url: /index.html/ internal: YES status: 307 /server-status: status: ON |
root@kogera:/etc/letsencrypt/live/karappi.mydns.jp#
certbot certonly Saving debug log to /var/log/letsencrypt/letsencrypt.log How would you like to authenticate with the ACME CA? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: Spin up a temporary webserver (standalone) 2: Place files in webroot directory (webroot) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1 Please enter the domain name(s) you would like on your certificate (comma and/or space separated) (Enter 'c' to cancel): karappi.mydns.jp Renewing an existing certificate for karappi.mydns.jp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Could not bind TCP port 80 because it is already in use by another process on this system (such as a web server). Please stop the program in question and then try again. (ここで別のターミナルから # systemctl stop h2o でh2oを停止する) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (R)etry/(C)ancel: R Successfully received certificate. Certificate is saved at: /etc/letsencrypt/live/karappi.mydns.jp/fullchain.pem Key is saved at: /etc/letsencrypt/live/karappi.mydns.jp/privkey.pem This certificate expires on 2024-08-07. These files will be updated when the certificate renews. Certbot has set up a scheduled task to automatically renew this certificate in the background. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - If you like Certbot, please consider supporting our work by: * Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate * Donating to EFF: https://eff.org/donate-le - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |