win2022服务器apache配置https(ssl)真实环境实验(避坑之作)不依赖宝塔小皮等集成环境
创始人
2025-01-20 06:03:59
0

本次实验背景:
完全参考官方 https://cloud.tencent.com/document/product/400/4143 文档流程,没有搞定,于是写下避坑之作。

服务器:腾讯云轻量应用服务器
操作系统: Windows Server 2022 DataCenter 64bit CN
apache版本:Apache 2.4.59

证书下载及存放

  1. 下载证书
    这里完全按照官方的来
    在这里插入图片描述
  2. 证书存放
    如下图所示,为方便管理和引用,我在服务器的conf下新建了目录ssl,把需要用到的三个证书(除CSR外)放到这里
    在这里插入图片描述

一、开启ssl配置文件

  1. 使用文本编辑器,打开 Apache 服务器 conf 目录下 httpd.conf 文件,并删除以下字段前 # 注释符。
#LoadModule ssl_module modules/mod_ssl.so #Include conf/extra/httpd-ssl.conf 

在这里插入图片描述
在这里插入图片描述
2. 将httpd-ssl.conf中虚拟机部分代码注释
在这里插入图片描述
在这里插入图片描述

二、配置虚拟机

打开Apache24\conf\extra\目录,将httpd-vhosts.conf复制一份备份,清空httpd-vhosts.conf内容加入下面内容,*****包含作者真实域名信息,打了马赛克。

     DocumentRoot "C:\WF\www\html\****"             RewriteEngine on         RewriteCond %{SERVER_PORT} !^443$         RewriteRule ^(.*)?$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]             DocumentRoot "C:\WF\www\html\****"     ServerName ****.com     ServerAlias www.****.com     #ssl     SSLEngine on          SSLOptions +StdEnvVars               SSLOptions +StdEnvVars          #ssl-key     SSLCertificateFile "${SRVROOT}/conf/ssl/****.com.crt"     SSLCertificateKeyFile "${SRVROOT}/conf/ssl/****.com.key"     SSLCertificateChainFile "${SRVROOT}/conf/ssl/root_bundle.crt"     #ssl-key-END     BrowserMatch "MSIE [2-5]" \          nokeepalive ssl-unclean-shutdown \          downgrade-1.0 force-response-1.0      #   Per-Server Logging:     #   The home of a custom SSL log file. Use this when you want a     #   compact non-error SSL logfile on a virtual host basis.     CustomLog "${SRVROOT}/logs/ssl_request.log" \           "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"  

在这里插入图片描述

三、测试配置文件+重启apache服务

net stop apache httpd -t net start apache 

相关内容

热门资讯

WPK透视辅助!德州局脚本,w... WPK透视辅助!德州局脚本,wpk德州局透视(切实是有挂)1、超多福利:超高返利,海量正版游戏,wp...
微扑克透视辅助!pokemmo... 微扑克透视辅助!pokemmo辅助器手机版下载,hhpoker开挂教程(一贯是真的有挂)1、微扑克透...
WPK透视辅助!扑克之星辅助,... WPK透视辅助!扑克之星辅助,wepoker辅助是真的假的(真是真的有挂)wepoker辅助是真的假...
wpk透视辅助!hhpoker... wpk透视辅助!hhpoker是内部控制吗,wepoker破解工具(好像真的有挂)1、hhpoker...
微扑克透视辅助!hhpoker... 微扑克透视辅助!hhpoker德州透视,xpoker透视辅助(好像真的是有挂)1)hhpoker德州...
微扑克透视辅助!黑侠破解wep... 微扑克透视辅助!黑侠破解wepoker,wepoker辅助分析器(切实是有挂)1、首先打开wepok...
wpk透视辅助!aapoker... wpk透视辅助!aapoker怎么设置抽水,大菠萝手游辅助(总是真的有挂)运aapoker怎么设置抽...
wpk透视辅助!wepoker... wpk透视辅助!wepoker软件辅助程序,wepoker辅助器安装包定制(其实是有挂)小薇(辅助器...
微扑克透视辅助!aapoker... 微扑克透视辅助!aapoker怎么提高中牌率,hhpoker软件安装包(确实真的有挂)1、进入游戏-...
WPK透视辅助!wepoker... 您好,wepoker透视器免费这款游戏可以开挂的,确实是有挂的,需要了解加去威信【485275054...