トップ «前の日記(2017-03-26) 最新 次の日記(2017-03-28)» 編集

ヨタの日々

2001|08|09|10|11|12|
2002|01|02|03|04|05|06|07|08|09|10|11|12|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|12|
2024|01|02|03|04|

2017-03-27 :-(

_ やったこと

0530 起床

0830 労働

1700 退勤

1900 筋トレ

2100 飯

_ [https][SSL]サイトを https 化しました(現在進行系)

eplus のログイン画面が http なのでちゃんとマサカリを投げる権利を得るために自分のサイトを https 化しようと。

SSL 証明書はおカネ出して買ったりするのが正攻法らしいですが最近は無償のものもあるそうで、使いました。Let's Encrypt - Free SSL/TLS Certificates

certbot

Let's encrypt を楽ちんできるクライアントが提供されています Certbot NetBSD 用のものはないのですが pkgsrc にあるのでインストールします。ありがとう

% cd /usr/pkgsrc/security/py-certbot
% make install clean clean-depends

ウェッブサーバーを走らせたまま使うのでこのような使い方をします。make install すると MESSAGE で表示されるます。

certbot --webroot -d <domain_name> -w <web_root> certonly

うちに当てはめるとこう

certbot --webroot -d www.area51.gr.jp -w /usr/pkg/share/httpd/htdocs certonly

実行します。メールアドレス間違えた....

% certbot --webroot -d www.area51.gr.jp -w /usr/pkg/share/httpd/htdocs certonly

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at
   /usr/pkg/etc/letsencrypt/live/www.area51.gr.jp/fullchain.pem. Your
   cert will expire on 2017-06-25. 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"
 - If you lose your account credentials, you can recover through
   e-mails sent to miwarin@gmail.co.
 - Your account credentials have been saved in your Certbot
   configuration directory at /usr/pkg/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

apache の設定

うちは apache なので httpd-ssl.conf を編集します。pkgsrc でインストールすると /usr/pkg/etc/httpd/httpd-ssl.conf にあります。変更したのはここ

ServerName www.area51.gr.jp:443
ServerAdmin miwarin@gmail.com
SSLCertificateFile "/usr/pkg/etc/letsencrypt/live/www.area51.gr.jp/cert.pem"
SSLCertificateKeyFile "/usr/pkg/etc/letsencrypt/live/www.area51.gr.jp/privkey.pem"
SSLCertificateChainFile "/usr/pkg/etc/letsencrypt/live/www.area51.gr.jp/chain.pem"

httpd.conf も ssl を使うように変更します。以下 2 行はコメントアウトされてるのでコメントを外すだけ。mod_socache_shmcb もコメントアウトされてたらコメント外す。

LoadModule ssl_module lib/httpd/mod_ssl.so
Include etc/httpd/httpd-ssl.conf

うちでは pf を使ってるので pf.conf でポート開けておきます。https を追加。

tcp_services = "{ ssh, http, https, smtp, domain }"

再起動します。reload でもいいけど

% /etc/rc.d/pf restart
% /etc/r.d/apache restart

サイト全体を http 化しないとダメ

一部でも http が残ってるとダメです。がんばって地道に https にしましょう。