1、首先要確認安裝了 mod_ssl模組
我的機器是centos是系統,執行下面命令
yum install -y mod_ssl
2、用openssl工具產生密鑰,認證請求檔案,認證
在/usr/local/httpd目下,執行以下命令。
2.1產生密鑰
openssl genrsa 1024 > server.key
說明:這是用128位rsa演算法產生密鑰,得到server.key檔案
2.2產生認證請求檔案
openssl req -new -out server.csr
說明:這是用步驟1的密鑰產生認證請求檔案server.csr, 這一步提很多問題,一一輸入
2.3產生認證
命令:openssl req -x509 -days 365 -key server.key -in server.csr > server.crt
說明:這是用步驟1,2的的密鑰和認證請求產生認證server.crt,-days參數指明認證有效期間,單位為天
3、 配置apache
修改httpd.conf
LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so
Listen 443
NameVirtualHost *:443
# General setup for the virtual host
DocumentRoot "/usr/local/httpd/htdocs/ssl"
ServerName ssl.baishiz.com:443
ServerAdmin you@example.com
ErrorLog "/usr/local/httpd/logs/error_log"
TransferLog "/usr/local/httpd/logs/access_log"
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
SSLCertificateFile "/usr/local/httpd/server.crt"
SSLCertificateKeyFile "/usr/local/httpd/server.key"
SSLOptions +StdEnvVars
SSLOptions +StdEnvVars
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog "/usr/local/httpd/logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
http://www.bkjia.com/PHPjc/738543.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/738543.htmlTechArticle1、首先要確認安裝了 mod_ssl模組 我的機器是centos是系統,執行下面命令 yum install -y mod_ssl 2、用openssl工具產生密鑰,認證請求檔案,認證...