LoginSignup
3
2

More than 5 years have passed since last update.

ApacheのSSL設定をする

Posted at

ローカル向けに自己証明書で設定する。
たまにやる時に忘れてるのでメモ

SSLモジュールのインストール

sudo yum install mod_ssl

2.4系で上記で入らない場合は下記

sudo yum install mod24_ssl

自己証明書の作成と配置

$ openssl genrsa > server.key
$ openssl req -new -key server.key > server.csr
$ openssl x509 -req -signkey server.key < server.csr > server.crt
$ mkdir /etc/httpd/conf/ssl.key
$ mkdir /etc/httpd/conf/ssl.crt
$ mv server.key /etc/httpd/conf/ssl.key/
$ mv server.crt /etc/httpd/conf/ssl.crt/

SSL設定の変更

vi /etc/httpd/conf.d/ssl.conf

SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key

Apache再起動

$ service httpd restart
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