1.向證書機(jī)構(gòu)申請(qǐng)https證書括眠,會(huì)得到證書和私鑰
2.安裝apache的mod_ssl.so模塊
yum -y install mod_ssl
3.若啟用了防火墻需要添加https服務(wù)(service iptables status或者在使用firewall的情況下用?systemctl status firewalld)
用iptables的情況
iptables?-A?FORWARD?-p?tcp?--dport?443?-j?ACCEPT ?(用于放行客戶端請(qǐng)求https服務(wù)的報(bào)文)
iptables?-A?FORWARD?-p?tcp?--sport?443?-j?ACCEPT(用于放行https服務(wù)器發(fā)送給客戶端的報(bào)文)
用firewall的情況
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
4.修改 ssl.conf
vim /etc/httpd/conf.d/ssl.conf
DocumentRoot "/var/www/html/test"
ServerName wxapp.peopleyuqing.com:443
SSLCertificateFile /etc/pki/tls/certs/test.crt
SSLCertificateKeyFile /etc/pki/tls/private/test.key
5.測(cè)試配置文件并重啟apache
sudo httpd -t (或者sudo service httpd configtest)
sudo service httpd restart
原文:https://www.cnblogs.com/ryanlamp/p/6377637.html