0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Apache 2.4 の SSL設定手順 忘備録

Posted at

背景

  • 業務で十数年前のシステムを移行した
  • 今度同様の作業がある
  • 作業記録を Qiita 向けに作成

/etc/httpd/conf.d/ssl.conf の編集

bash
vim /etc/httpd/conf.d/ssl.conf
ssl.conf
DocumentRoot "/vol/www/html/"


ServerName aedmap.city.kyoto.lg.jp

 ErrorLog "|/usr/sbin/rotatelogs /var/log/httpd/error_log.%Y%m%d 86400 540"
 CustomLog "|/usr/sbin/rotatelogs /var/log/httpd/access_log.%Y%m%d 86400 540" combinedi

Alias /aedmap "/vol/www/html/aedmap/
<Directory "/vol/www/html/aedmap/publ
    Options ExecCGI Indexes FollowSym
    AllowOverride AuthConfig All
    Require all granted
    # AddHandler cgi-script .cgi
</Directory>
AddType application/x-httpd-php .php

# DL したサーバー証明書
SSLCertificateFile /etc/ssl/certs/server.crt
# 生成した秘密鍵
SSLCertificateKeyFile /etc/ssl/private/foobar.key
# DL した中間証明書
SSLCertificateChainFile /etc/pki/tls/certs/jprs_ca.crt
bash
systemctl restart httpd

http へのアクセスを https に流す

# vi /etc/httpd/conf.d/your-domain.conf
<VirtualHost *:80>
    ServerName your-domain.com
    Redirect permanent https://your-domain.com/
</VirtualHost>
bash
systemctl restart httpd

参考資料

学び

  • .crt と .csr は違う
  • crt は certificate = 証明書
  • csr はSSLサーバー証明書を発行するための証明書署名要求 Certificate Signing Request
  • File 生成した秘密鍵
  • KeyFile 中間証明書
  • ChainFile CA証明書
  • httpdが起動しなくなったら、ログを追跡する
  • 生成した秘密鍵とCSRで発行したサーバー証明書のペアを確認する
  • 設定するパスが入れ違いになってないか確認する
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?