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 天前
开源情报收集工具GhostTrack深度测评:IP、手机号、用户名的合规信息查询方案
网络·网络协议·tcp/ip
想成为优秀工程师的爸爸1 天前
第三十篇技术笔记:郭大侠学UDS - 人有生老三千疾,望闻问切良方医
网络·笔记·网络协议·tcp/ip·信息与通信
KnowSafe1 天前
CaaS vs 传统管理:证书即服务的颠覆性优势
https·ssl
灰子学技术1 天前
Envoy HTTP Connection Manager (HCM) 技术文档
网络·网络协议·http
KnowSafe1 天前
证书自动化解决方案哪家更可靠?
运维·服务器·安全·https·自动化·ssl
日取其半万世不竭1 天前
WordPress建站 + 免费SSL证书配置完整教程
网络·网络协议·ssl
七七powerful2 天前
AI+运维提效--HTTPS 证书有效期监控方案
网络协议·http·https
计算机安禾2 天前
【Linux从入门到精通】第44篇:Linux网络协议栈与TCP参数调优
linux·网络协议·tcp/ip
KnowSafe2 天前
证书自动化革命:CaaS如何重塑企业数字信任体系
https·ssl·itrustssl·trustasia