命令行到apache(含有openssl) 的bin文件夹下,执行下面的命令:
openssl req -config c:/apache/conf/openssl.cnf -new -out ../conf/ssls/xxx/server.csr
openssl rsa -in privkey.pem -out ../conf/ssls/xxx/server.key,
用server.csr去能申请证书的网站使用,获得证书后,在apache中做如下设置:
<VirtualHost 127.0.0.1:443>
JkMount /* xxxx
ServerAdmin webmaster@dummy-host.example.com
ServerName xxxxx
SSLEngine on
SSLCertificateFile conf/ssls/xxxx/server.cer
SSLCertificateKeyFile conf/ssls/xxxx/server.key
SSLVerifyClient none
SSLVerifyDepth 1
DocumentRoot "c:/work/server/xxxx/webapps"
ErrorLog logs/error.log
DirectoryIndex index.html index.jsp index.php
<Directory "c:/work/server/xxxxx/webapps">
Options Includes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>