CentOS7自生成證書配置SSL WEB詳解

# 安裝Apache [root@server0 ~]# yum -y install httpd mod_ssl # 添加防火墻規(guī)則 [root@server0 ~]# firewall-cmd --permanent --add-server=80/tcp [root@server0 ~]# firewall-cmd --permanent --add-server=443/tcp [root@server0 ~]# firewall-cmd --permanent --add-server=8080/tcp;firewall-cmd --reload [root@server0 ~]# systemctl restart httpd;systemctl enable httpd
# 配置selinux安全上下文 [root@server0 ~]# semanaga port -a -t http_port_t {80,443,8080} [root@server0 ssl]# mkdir /etc/httpd/ssl;cd /etc/httpd/ssl
# 生成KEY
[root@server0 ssl]# openssl genrsa -des3 -out vqiu.cn.key 2048
# 去密碼
[root@server0 ssl]# openssl rsa -in vqiu.cn.key -out vqiu.cn.key# 生成證書簽發(fā)請求和證書密鑰
[root@server0 ssl]# openssl req -new -nodes -key vqiu.cn.key -out vqiu.cn.csr
# 通過csr生成一個證書,以 vqiu.cn 為例
[root@server0 ssl]# openssl x509 -req -days 3650 -in vqiu.cn.csr -signkey vqiu.cn.key -out vqiu.cn.crt
#生成 crt 之后,csr 可以進行刪除[可略過]
[root@server0 ssl]# rm vqiu.cn.csr -f
[root@server0 ssl]# cat /etc/httpd/conf.d/vqiu.cn.conf
<IfModule mod_ssl.c>
Listen 443 https
</IfModule>
<VirtualHost _default_:443>
ServerName server0.vqiu.cn
DocumentRoot /var/www/html
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
SSLCertificateFile /etc/httpd/ssl/vqiu.cn.crt
SSLCertificateKeyFile /etc/httpd/ssl/vqiu.cn.key
</VirtualHost>
# 生成一個測試頁面
[root@server0 ssl]# echo "test">/var/www/html/index.html
# 重啟httpd服務
[root@server0 ssl]# systemctl restart httpd
相關(guān)文章
Linux CentOS系統(tǒng)下tomcat配置ssl教程
這篇文章主要介紹了Linux CentOS系統(tǒng)下tomcat配置ssl教程,本文分為5個步驟詳細講解了配置過程,需要的朋友可以參考下2014-12-27- 這篇文章主要介紹了在CentOS系統(tǒng)中安裝Websvn的教程,當然示例也同樣適用于RedHat系的其他Linux系統(tǒng),需要的朋友可以參考下2015-06-05
- 今天小編為大家?guī)淼氖荂entOS下生成自簽名的證書的方法詳解;希望對大家會有幫助;有需要的朋友一起去看看吧2016-12-16
通過SSH證書實現(xiàn)Putty免密碼登錄CentOS的方法
之前介紹過如何使用Putty管理VPS,但Putty沒有保存密碼的功能,不過它可以通過SSH證書實現(xiàn)免密碼登錄2013-06-07Centos6.3下Apache配置基于加密的認證https加密證書訪問
Centos6.3下Apache配置https證書訪問 這里簡單演示一下Apache下基于加密的認證訪問—-https加密方式訪問,希望對朋友們有幫助。2013-05-07- 今天小編為大家?guī)淼氖荂entOS開機自動運行自己的腳本詳解。希望可以幫助到大家,有需要的朋友一起去看看吧2016-12-26
CentOS設(shè)置開機啟動服務及自動聯(lián)網(wǎng)的方法
一些朋友反饋說不知道CentOS如何設(shè)置開機啟動服務及自動聯(lián)網(wǎng)?下面小編就為大家分享一下CentOS設(shè)置開機啟動服務及自動聯(lián)網(wǎng)的方法;有需要的朋友可以過來看看2016-12-06- 安裝完成Centos7之后,配置了IP地址,如果重啟電腦,發(fā)現(xiàn)網(wǎng)絡服務并沒有啟動起來,那么,如何讓Centos7網(wǎng)絡自動啟動呢?下面小編就為大家?guī)鞢entOS7設(shè)置網(wǎng)絡自動啟動的方2016-12-01
- 這篇文章主要介紹了在Windows上制作CentOS自動安裝的光盤的教程,使安裝時各選項自動化執(zhí)行,做到"無人值守安裝",需要的朋友可以參考下2015-06-30
CentOS 6.4使用腳本自動關(guān)閉觸控板的方法
在CentOS 6.4中,使用腳本能夠自動關(guān)閉觸控板,下面小編就給大家介紹下CentOS6.4如何使用腳本停用觸控板,感興趣的朋友不要錯過2015-03-23