PHP高级工程师|全栈工程师|WX: Aben_Ring

搭建单向HTTPS

//参考网址:https://blog.csdn.net/haolipengzhanshen/article/details/51278262


//打开CMD窗口 cd C:\wamp\bin\apache\Apache2.4.9\bin //设置环境变量 set OPENSSL_CONF=..\conf\openssl.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—OA1078285863@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:\wamp\bin\apache\Apache2.4.9\conf\httpd.conf,取消注释: Include conf/extra/httpd-ssl.conf LoadModule ssl_module modules/mod_ssl.so //配置:C:\wamp\bin\apache\Apache2.4.9\conf\extra\httpd-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:\wamp\www\www.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完事
posted @ 2018-04-19 09:04  懒牛拉车  阅读(208)  评论(0编辑  收藏  举报