配置 Apache 2.2.x + SSL
1 基礎(chǔ) (可選)
- 編輯APACHE_HOME/conf/httpd.conf中的以下directives和tags,
ServerRoot, ServerAdmin, ServerName, DocumentRoot,
<Directory %DocumentRoot%>, DirectoryIndex, ScriptAlias /cgi-bin/,
<Directory %cgi-bin%> - 去掉以下語(yǔ)句的注釋,
Include conf/extra/httpd-manual.conf
2 生成RSA密鑰 (private key)
下面兩個(gè)命令都可以生成密鑰,
openssl genrsa -des3 -out server.key
openssl genrsa -out server.key
-des3選項(xiàng)可以加密生成的密鑰, 但是Win32平臺(tái)不支持加密密鑰,啟動(dòng)Apache時(shí)會(huì)產(chǎn)生以下錯(cuò)誤信息, "SSLPassPhraseDialog builtin is not supported on Win32"
3 生成自簽署證書(shū) (self-signed certificate)
在OpenSSL源碼的"openssl\apps"目錄可以找到openssl.cnf (OpenSSL配置文件).
openssl req -config openssl.cnf -new -x509 -key server.key -out
server.crt -days 365
4 編輯APACHE_HOME/conf/httpd.conf
去掉以下語(yǔ)句的注釋,
Include conf/extra/httpd-ssl.conf
5 編輯 conf/extra/httpd-ssl.conf
- 把SSLMutex標(biāo)簽的值改為default
- 編輯以下directives(可選),
DocumentRoot, ServerName, ServerAdmin, ErrorLog, TransferLog,
SSLCertificateFile, SSLCertificateKeyFile
posted on 2006-05-06 19:05 Vincent.Chen 閱讀(3303) 評(píng)論(0) 編輯 收藏 所屬分類(lèi): 雜文