//参考网址:https://blog.csdn.net/haolipengzhanshen/article/details/51278262
//打开CMD窗口
cd C:wampinapacheApache2.4.9in
//设置环境变量
set OPENSSL_CONF=..confopenssl.cnf
//生成server.key
openssl genrsa 1024>server.key
//生成server.csr
openssl req -new -key server.key > server.csr
//需要用户输入国家代码之类的信息:
//注意:其中的Common Name只能输入域名(www.oa.com)或IP:192.168.1.103
CN—ZJ—HZ—Relay2—OA—1078285863@qq.com
//生成server.crt
openssl req -x509 -days 365 -key server.key -in server.csr > server.crt
//在bin 目录下,找到 server.crt server.csr server.key 复制到Apache的conf目录下
//配置:C:wampinapacheApache2.4.9confhttpd.conf,取消注释:
Include conf/extra/httpd-ssl.conf
LoadModule ssl_module modules/mod_ssl.so
//配置:C:wampinapacheApache2.4.9confextrahttpd-ssl.conf
SSLCertificateKeyFile “C:/wamp/bin/apache/apache2.4.9/conf/server.key”
SSLSessionCache “shmcb:c:/wamp/bin/apache/apache2.4.9/logs/ssl_scache(512000)”
//配置vhost文件
<VirtualHost *:443>
DocumentRoot "D:wampwwwwww.newdefend.com"
ServerName https://newdefend.dv
SSLEngine on
SSLCertificateFile "D:/wamp/bin/apache/apache2.4.9/conf/server.crt"
SSLCertificateKeyFile "D:/wamp/bin/apache/apache2.4.9/conf/server.key"
</VirtualHost>
//重启wamp完事