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 小时前
通过 Wireshark 抓取串口命令
网络协议·测试工具·wireshark
KnowSafe3 小时前
2026年SSL证书市场便宜且安全的SSL证书调研
网络协议·安全·ssl
dangdanding7 小时前
防火墙 IP 分片测试套件-fragroute
linux·网络·网络协议·tcp/ip
TechWayfarer7 小时前
AI大模型时代:IP数据云如何适配智能体场景需求
开发语言·人工智能·python·网络协议·tcp/ip·langchain
冰冰的米咖8 小时前
交换与路由技术整理与总结(持续更新版)
网络·网络协议·智能路由器
Ether IC Verifier9 小时前
TCP/IP协议握手原理详解——结合以太网连接过程
服务器·网络·数据库·网络协议·tcp/ip
zhojiew9 小时前
基于Pyspark对Apache Iceberg核心功能的使用实践
apache
山栀shanzhi9 小时前
TCP 和 UDP 区别
网络协议·tcp/ip·udp
HMS工业网络10 小时前
使用电脑快速测试PROFIBUS 设备通讯
网络·网络协议·profibus·主站·设备通讯
handler0111 小时前
【Linux 网络】一文读懂 HTTP 协议
linux·c语言·网络·c++·笔记·网络协议·http