1.ApacheインストールとSSLの設定
# yum -y install mod_ssl
# cd /etc/pki/tls/certs/
# sed -i ‘s/365/3650/g’ Makefile
# make server.crt
umask 77 ; \
/usr/bin/openssl genrsa -aes128 2048 > server.key
Generating RSA private key, 2048 bit long modulus
……………………………………………..+++
………………………………………………+++
e is 65537 (0x10001)
Enter pass phrase:★★★
Verifying – Enter pass phrase:★★★
umask 77 ; \
/usr/bin/openssl req -new -key server.key -x509 -days 3650 -out server.crt -set_serial 0
Enter pass phrase for server.key:★★★
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [XX]:JP
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) []:★★★
Email Address []:★★★
# openssl rsa -in server.key -out server.key
Enter pass phrase for server.key:★★★
writing RSA key
# vi /etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/pki/tls/certs/server.crt
SSLCertificateKeyFile /etc/pki/tls/certs/server.key
DocumentRoot "/var/www/html"
# service https start
Starting httpd: [ OK ][/shell]
2.ドキュメントルート(DocumentRoot)の変更
# vi /etc/httpd/conf.d/ssl.conf[/shell]
3.セキュリティ関連の設定
ServerTokens ProductOnly
ServerSignature Off[/shell]
Syntax OK
# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ][/shell]