使用命令行安装 Apache mod_ssl 模块:
# yum install mod_ssl
Apache mod_ssl 模块配置:
编辑配置文件:/etc/httpd/conf.d/ssl.conf
给虚拟主机添加 :443 端口
NameVirtualHost *:443
也可以直接给已用的虚拟主机添加 :443 端口,配置如下:
<VirtualHost ip:443>
DocumentRoot /var/www/html
ServerName 域名:443
<Directory /var/www/html>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4"
SSLCertificateFile /etc/httpd/ssl/server.crt
SSLCertificateKeyFile /etc/httpd/ssl/server.key
SSLCACertificateFile /etc/httpd/ssl/ca-bundle.crt
</VirtualHost>
最后重启 Apache :
# service httpd restart