このセクションでは、暗号化を安全に設定するためのベストプラクティスについて説明します。
RHELベースのシステムでは、mod_ssl
パッケージをインストールします :
SSL鍵用のディレクトリを作成します :
SSL証明書を作成します :
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/httpd/ssl/private/apache-selfsigned.key -out /etc/httpd/ssl/apache-selfsigned.crt
プロンプトに適切に入力します。 最も重要な行は、Common Name
を指定する行です。 サーバーに関連付けるドメイン名を入力する必要があります。 ドメイン名がない場合は、代わりにパブリックIPアドレスを入力することができます。
Country Name (2 letter code) [XX]:
State or Province Name (full name) []:
Locality Name (eg, city) [Default City]:
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:example.com
Email Address []:
Apache SSL設定ファイル (/etc/httpd/conf.d/ssl.conf
) を編集します :
DocumentRoot "/usr/share/zabbix"
ServerName example.com:443
SSLCertificateFile /etc/httpd/ssl/apache-selfsigned.crt
SSLCertificateKeyFile /etc/httpd/ssl/private/apache-selfsigned.key
変更を反映させるためApacheのサービスを再起動します :