centos7的ssl

在虛擬機中驗證可行,分享一下。

yum list installed | grep ssl
mod_ssl.x86_64 解:這個模塊將Apache和mod聯繫在一起,如果沒有需要安裝mod_ssl
openssl.x86_64

cd /etc/httpd/conf
openssl genrsa -out localhost.key 1024建立密鑰
openssl req -new -key localhost.key -out localhost.csr建立公鑰
openssl x509 -req -days 365 -in localhost.csr -signkey localhost.key -out localhost.crt建立服務器證書
vim /etc/httpd/conf.d/ssl.conf修改配置文件
LoadModule ssl_module modules/mod_ssl.so新增
DocumentRoot "/www/gpic/"修改,根據實際情況設定
ServerName www.gpic.com:443修改,根據實際情況設定
SSLCertificateFile /etc/httpd/conf/localhost.crt修改,就是之前步驟生成的文件,
SSLCertificateKeyFile /etc/httpd/conf/localhost.key修改,就是之前步驟生成的文件,


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章