CentOS7如何自生成证书配置SSL WEB
系統運維
這篇文章將為大家詳細講解有關CentOS7如何自生成證書配置SSL WEB,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
#安裝Apache[root@server0~]#yum-yinstallhttpdmod_ssl#添加防火墻規則[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~]#systemctlrestarthttpd;systemctlenablehttpd#配置selinux安全上下文[root@server0~]#semanagaport-a-thttp_port_t{80,443,8080}[root@server0ssl]#mkdir/etc/httpd/ssl;cd/etc/httpd/ssl#生成KEY[root@server0ssl]#opensslgenrsa-des3-outvqiu.cn.key2048#去密碼[root@server0ssl]#opensslrsa-invqiu.cn.key-outvqiu.cn.key#生成證書簽發請求和證書密鑰[root@server0ssl]#opensslreq-new-nodes-keyvqiu.cn.key-outvqiu.cn.csr#通過csr生成一個證書,以vqiu.cn為例[root@server0ssl]#opensslx509-req-days3650-invqiu.cn.csr-signkeyvqiu.cn.key-outvqiu.cn.crt#生成crt之后,csr可以進行刪除[可略過][root@server0ssl]#rmvqiu.cn.csr-f[root@server0ssl]#cat/etc/httpd/conf.d/vqiu.cn.conf<IfModulemod_ssl.c>Listen443https</IfModule><VirtualHost_default_:443>ServerNameserver0.vqiu.cnDocumentRoot/var/www/htmlSSLEngineonSSLProtocolall-SSLv2SSLCipherSuiteHIGH:MEDIUM:!aNULL:!MD5SSLCertificateFile/etc/httpd/ssl/vqiu.cn.crtSSLCertificateKeyFile/etc/httpd/ssl/vqiu.cn.key</VirtualHost>#生成一個測試頁面[root@server0ssl]#echo"test">/var/www/html/index.html#重啟httpd服務[root@server0ssl]#systemctlrestarthttpd
關于“CentOS7如何自生成證書配置SSL WEB”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。
總結
以上是生活随笔為你收集整理的CentOS7如何自生成证书配置SSL WEB的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 防火玻璃设置(防火玻璃设计规范)
- 下一篇: 什么手机耗电慢而且还不卡?