1 基礎(chǔ) (可選)
- 編輯APACHE_HOME/conf/httpd.conf中的以下directives和tags,
ServerRoot, ServerAdmin, ServerName, DocumentRoot,
<Directory %DocumentRoot%>, DirectoryIndex, ScriptAlias /cgi-bin/,
<Directory %cgi-bin%>
- 去掉以下語句的注釋,
Include conf/extra/httpd-manual.conf
2 生成RSA密鑰 (private key)
下面兩個命令都可以生成密鑰,
openssl genrsa -des3 -out server.key
openssl genrsa -out server.key
-des3選項可以加密生成的密鑰, 但是Win32平臺不支持加密密鑰,啟動Apache時會產(chǎn)生以下錯誤信息, "SSLPassPhraseDialog builtin is not supported on Win32"
3 生成自簽署證書 (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
去掉以下語句的注釋,
Include conf/extra/httpd-ssl.conf
5 編輯 conf/extra/httpd-ssl.conf
- 把SSLMutex標(biāo)簽的值改為default
- 編輯以下directives(可選),
DocumentRoot, ServerName, ServerAdmin, ErrorLog, TransferLog,
SSLCertificateFile, SSLCertificateKeyFile