Windows 系统Apache 2.4配置SSl访问

1、生成证书
下载工具:http://slproweb.com/download/Win64OpenSSL-1_1_1k.msi
配置环境变量到Path

openssl pkcs12 -in smallbyteSystemGlobalSign.pfx -nodes -out smallbyteSystemGlobalSign.pem
openssl rsa -in smallbyteSystemGlobalSign.pem -out smallbyteSystemGlobalSign.key
openssl x509 -in smallbyteSystemGlobalSign.pem -out smallbyteSystemGlobalSign.crt

2、\conf\httpd.conf
> 取消LoadModule socache_dbm_module modules/mod_socache_dbm.so、LoadModule socache_shmcb_module modules/mod_socache_shmcb.so、LoadModule ssl_module modules/mod_ssl.so前的#
> 取消Include conf/extra/httpd-ssl.conf前的#

3、\conf\extra\httpd-ssl.conf
> 取消SSLSessionCache         "dbm:${SRVROOT}/logs/ssl_scache"前的#
  加上SSLSessionCache        "shmcb:${SRVROOT}/logs/ssl_scache(512000)"前添加#

> 修改<VirtualHost _default_:443>下
DocumentRoot "C:/smallbyte/www202105"
ServerName www.smallbyte.com.cn:443
ServerAdmin zq@smallbyte.com.cn

4、配置证书
搜索SSLCertificateFile "${SRVROOT}/conf/server.crt"
替换为
SSLCertificateFile "E:/smallbyte/https/smallbyteSystemGlobalSign.crt"

搜索SSLCertificateKeyFile "${SRVROOT}/conf/server.key"
替换为
SSLCertificateKeyFile "E:/smallbyte/https/smallbyteSystemGlobalSign.key"

posted @ 2021-06-15 16:39  Smallbyte  阅读(245)  评论(0编辑  收藏  举报