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即可。
相关推荐
十碗饭吃不饱3 小时前
WebClient工具调用HTTP接口报错远程主机断开连接
网络·网络协议·http
liu****3 小时前
基于websocket的多用户网页五子棋(九)
服务器·网络·数据库·c++·websocket·网络协议·个人开发
心态特好3 小时前
详解WebSocket及其妙用
java·python·websocket·网络协议
Yefimov13 小时前
DPDK:从网络协议栈的角度来观察微内核
后端·网络协议
IT_Octopus14 小时前
https私人证书 PKIX path building failed 报错解决
java·spring boot·网络协议·https
艾菜籽14 小时前
网络原理-HTTPS
网络·网络协议·https
摇滚侠14 小时前
什么是 mesh 组网
网络协议
Arva .15 小时前
HTTP Client
网络协议·http·lua
2301_772093561 天前
tuchuang_后端_前端_注册登录
数据库·后端·网络协议·mysql·wireshark
程序员三明治1 天前
HTTPS 真的牢不可破吗?—— 中间人攻击与安全机制解析
网络协议·安全·https