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即可。
相关推荐
iナナ5 小时前
传输层协议——UDP和TCP
网络·网络协议·tcp/ip·udp
舒一笑6 小时前
Mac 上安装并使用 frpc(FRP 内网穿透客户端)指南
后端·网络协议·程序员
唐叔在学习6 小时前
万字长文深度解析HTTPS协议
后端·https
Mr_Xuhhh10 小时前
NAT、代理服务、内网穿透
网络·网络协议·http·https·udp·智能路由器
用户849137175471612 小时前
为什么大模型都离不开SSE?带你搞懂第1章〈SSE技术基础与原理〉
前端·网络协议·llm
一个天蝎座 白勺 程序猿13 小时前
Apache IoTDB(4):深度解析时序数据库 IoTDB 在Kubernetes 集群中的部署与实践指南
数据库·深度学习·kubernetes·apache·时序数据库·iotdb
喂完待续1 天前
【Tech Arch】Spark为何成为大数据引擎之王
大数据·hadoop·python·数据分析·spark·apache·mapreduce
2501_915918411 天前
iOS 应用上架全流程实践,从开发内测到正式发布的多工具组合方案
android·ios·小程序·https·uni-app·iphone·webview
weisian1511 天前
HTTP协议-3-HTTP/2是如何维持长连接的?
网络·网络协议·http
tan77º1 天前
【项目】分布式Json-RPC框架 - 项目介绍与前置知识准备
linux·网络·分布式·网络协议·tcp/ip·rpc·json