僕の備忘録(PC、UN*X、ネットワーク関連が中心)なんです。
自分の書いたところは適当(な時とか)に書き換えますので御了承を。
letsencryptを試す。
今度はスムースに行かず、
urn:acme:error:connection なエラーが何度も出た。
ネームサーバには登録したはずなのだけど、
一度IPアドレスを変えていたためか、
更新が少し遅れていたようだ。
権威DNSサーバはもちろん、8.8.8.8もとっくに
追従したはずなのだけど。
letsencrypt-auto --apache -d $DOMAINはこないだにおなじ。
デフォルトのapcache2 で、今度は、"Easy"でなく
"Secure"を選択してみた。
するとこうなった。
/etc/apache2/sites-available$ grep -v \
"^[[:space:]]*#\|^$" 000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [L,QSA,R=permanent]
</VirtualHost>
Wiresharkで、
フィルタをかけて w3m -dump $SERVERしてみた。
tsharkにかけて、どうにかこんなの。
Hypertext Transfer Protocol HTTP/1.1 301 Moved Permanently\r\n [Expert Info (Chat/Sequence): HTTP/1.1 301 Moved Permanently\r\n] [Message: HTTP/1.1 301 Moved Permanently\r\n] [Severity level: Chat] [Group: Sequence] Request Version: HTTP/1.1 Status Code: 301 Response Phrase: Moved Permanently Date: Sun, 27 Dec 2015 02:02:20 GMT\r\n Server: Apache/2.4.10 (Debian)\r\n Location: https://$SERVER/\r\n Content-Length: 315\r\n [Content length: 315] Connection: close\r\n Content-Type: text/html; charset=iso-8859-1\r\n \r\n [HTTP response 1/1] [Time since request: 0.158072000 seconds] [Request in frame: 282] Line-based text data: text/html
以下、tshark -T pdml -O http -Y '(ip.addr == $SERVER)&&(tcp.port==80||tcp.port==443)' -r $CAPFILE の一部(改行文字削除)。
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https://$SERVER/">here</a>.</p> <hr> <address>Apache/2.4.10 (Debian) Server at $SERVER Port 80</address> </body></html>
そしてtcpのackやfinが続いた後、80から443に変った。
リンクはご自由にどうぞ。でもURLや内容が変った場合はあしからず。