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即可。
相关推荐
韭菜钟8 小时前
WIndows下一键切换网卡IP脚本
windows·网络协议·tcp/ip
上海云盾-小余12 小时前
DDoS 攻击全解析:常见类型识别与分层防御思路
网络协议·tcp/ip·安全·ddos
不做菜鸟的网工12 小时前
H3C 本地 Portal + AAA 认证 模拟配置实验
网络协议
W.W.H.13 小时前
嵌入式常见的面试题1
linux·网络·经验分享·网络协议·tcp/ip
zmj32032413 小时前
CAN + 以太网 + Wi-Fi + BLE + TCP/IP + MQTT +HTTP协议层级
网络·网络协议·tcp/ip
发光小北14 小时前
IEC103 转 ModbusTCP 网关应用在什么场景?
网络·网络协议
BullSmall15 小时前
Prometheus 如何配置监控 SSL 证书即将过期
网络协议·ssl·prometheus
一只小鱼儿吖15 小时前
长效代理IP:构建稳定高效的网络数据通
网络·网络协议·tcp/ip
Vis-Lin17 小时前
BLE 协议栈:L2CAP 信道详解
网络·物联网·网络协议·蓝牙·iot·ble
北京耐用通信18 小时前
CC-Link IE转Modbus TCP集成实战:耐达讯自动化网关在五星级酒店节能改造中的应用
人工智能·物联网·网络协议·自动化·信息与通信