編程學(xué)習(xí)網(wǎng) > 服務(wù)器 > CentOS > CentOS 5.0以上不能搭建SSL不能make genkey
2014
11-07

CentOS 5.0以上不能搭建SSL不能make genkey

CentOS?5.0以上版本,SSL certificate相關(guān)的一些東西變換了位置

移至/etc/pki/tls/certs/

故操作變?yōu)槿缦虏僮鳎?/p>

1.

~]# yum -y install mod_ssl

~]# cd /etc/pki/tls/certs/

certs]# make server.key
certs]# openssl rsa -in server.key -out server.key
certs]# make server.csr
certs]# openssl x509 -in server.csr -out server.pem -req -signkey server.key -days 365
certs]# chmod 400 server.*

2.
certs]# vi /etc/httpd/conf.d/ssl.conf

#DocumentRoot "/var/www/html" ?← 找到這一行,將行首的“#”去掉

DocumentRoot "/var/www/html" ?← 變?yōu)榇藸顟B(tài)

3.

conf]#?/etc/rc.d/init.d/httpd restart? ← 重新啟動(dòng)HTTP服務(wù)器
Stopping httpd:               [?OK?]
Starting httpd:              [?OK?]

4.

設(shè)置防火墻允許SSL
[root@sample conf]#?vi /etc/sysconfig/iptables? ?← 編輯防火墻配置文件
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT ?← 找到這一行,接著添加如下行:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT ?← 開放443號(hào)端口,允許SSL

5.
[root@sample conf]#?/etc/rc.d/init.d/iptables restart? ?← 重新啟動(dòng)防火墻,www.linuxidc.com使設(shè)置生效
Flushing firewall rules:            [?OK?]
Setting chains to policy ACCEPT: filter    [?OK?]
Unloading iptables modules:         [?OK?]
Applying iptables firewall rules:       [?OK?]

6.

打開瀏覽器,在地址欄輸入“https://服務(wù)器IP地址”或者“https://你的域名”后,如果出現(xiàn)提示安裝服務(wù)器證明書的窗口,說明服務(wù)器已經(jīng)支持SSL。這時(shí),如果選擇“永遠(yuǎn)接受此證書”,然后點(diǎn)擊確定后,再次通過HTTPS協(xié)議訪問該站點(diǎn),將不會(huì)再?gòu)棾龃舜翱谔崾景惭b服務(wù)器證書。

掃碼二維碼 獲取免費(fèi)視頻學(xué)習(xí)資料

Python編程學(xué)習(xí)

查 看2022高級(jí)編程視頻教程免費(fèi)獲取