apache开启https

本文基于windows平台。

个人感觉使用apache配置起来比较繁琐,而使用upupw或者xmpp等集成开发工具更方便。

  1. 在httpd.conf中,将下一行的注释去掉:LoadModule ssl_module modules/mod_ssl.so。另外,千万不要注释掉下面的一行:Include conf/extra/httpd-ssl.conf。具体原因不明。
  2. 在httpd-vhosts.conf中添加如下代码:
powershell 复制代码
Listen 443
<VirtualHost _default_:443>
	ServerName aa
	ServerAlias aa
	
    SSLEngine on
    SSLProxyEngine on
	
    SSLCertificateFile "D:/UPUPW/Apache2/conf/server.crt"
    SSLCertificateKeyFile "D:/UPUPW/Apache2/conf/server.key"
	
	DocumentRoot "D:/UPUPW/htdocs"
	DirectoryIndex index.html index.htm index.php default.php app.php u.php
	
	<Directory "D:/UPUPW/htdocs">

    Options FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory>
</VirtualHost>

注意:上述DocumentRoot和Directory字段的值要填写正确,https证书和私钥放在conf目录下,文件名也要填写正确。

  1. apache执行httpd -k restart重启apache即可。
相关推荐
pengyi87101521 小时前
HTTP代理连接异常排查,快速解决卡顿、断连问题
网络·网络协议·http
涛声依旧3931621 小时前
运维项目实战:Nginx+Docker 部署HTTPS站点+身份认证
运维·nginx·docker·云原生·容器·https
傻啦嘿哟1 天前
验证代理是否生效:OpenClaw中查看当前出口IP的3种方法
网络·网络协议·tcp/ip
墨香幽梦客1 天前
全站HTTPS化实战:SSL证书管理、自动续期与TLS 1.3性能优化详解
性能优化·https·ssl
Tronyel1 天前
阿里云上面Nginx反向代理GeoServer(HTTPS)
nginx·https·geoserver
IpdataCloud1 天前
游戏工作室多开怎么快速识别?用IP查询定位服务三步锁定异常账号
网络协议·tcp/ip·游戏
赤月奇1 天前
UDP 广播包-SocketTool发送UDP广播包
网络·网络协议·udp
发光小北1 天前
EtherNet/IP 转 Modbus 网关如何应用?
网络协议·tcp/ip
我叫黑大帅1 天前
为什么TCP是三次握手?
后端·网络协议·面试
SilentSamsara1 天前
TCP 三次握手:连接建立失败的那些坑
运维·服务器·网络·网络协议·tcp/ip