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即可。
相关推荐
王二端茶倒水1 天前
一套可落地的无线运营方案,不能只管 AP,还要管用户、计费和运维
网络协议
162723816081 天前
EtherCAT 分布式时钟(DC)原理与配置实战:把多轴真正"对齐到同一时刻"
网络协议
王二端茶倒水2 天前
宽带无线项目,怎么从一次性交付变成长期运营收入?
网络协议
Avan_菜菜3 天前
FRP 内网穿透完整实战:从 HTTP 映射到 HTTPS 自签代理
运维·nginx·https
用户2530171996273 天前
第6篇:从技术到产品 — Ghost Proxifier 的设计哲学
网络协议
用户2530171996273 天前
第3篇:注入的艺术 — Ghost Proxifier 核心架构拆解
网络协议
王二端茶倒水4 天前
商业 WiFi 不是免费上网,而是门店数字化的入口
网络协议
程序员mine9 天前
HTTPS-TLS加密与证书完全指南(中)
网络协议·https·ssl
之歆9 天前
现代 HTTP 客户端深度解析:Fetch 与 Axios
chrome·网络协议·http