LoginSignup
3
2

More than 5 years have passed since last update.

Apache2.2でLet's Encrypt する時にドキュメントルートでドメインチェックされたくない

Last updated at Posted at 2016-04-21

ドキュメントルートに知らない隠しディレクトリ勝手に作られるの嫌だとか、cronで回すのに、sudo付けて外部と連携してドキュメントルートにファイル作るほど信用していいのとか、3ヶ月に一回謎のファイル改ざんアラートが飛んできて夜寝るのが怖いとか色々な理由でLet's Encrypt出来ない時のためのメモ

httpd.conf
<VirtualHost 10.1.2.3>
  ServerAdmin webmaster@host.foo.com
  DocumentRoot /www/docs/host.foo.com
  ServerName host.foo.com

  Alias /.well-known /tmp/hoge/.well-known
  <Directory /tmp/hoge>
    Order Allow,Deny
    Allow from All
  </Directory>
</VirtualHost>
./letsencrypt-auto certonly --webroot -w /tmp/hoge -d host.foo.com

webrootプラグインで指定したとこに「.well-known/acme-challenge/hogefuga」ってドメインチェック用ディレクトリとファイル作るんで、上のようにAliasとかみんな大好きmod_rewriteとかでうまくゴニョって「.well-known/acme-challenge/hogefuga」にアクセスさせてやれば良い

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2