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即可。
相关推荐
Cry丶2 小时前
Apache Superset 集成实战:Embedded SDK + Guest Token + OAuth2/SSO 完整方案
apache·superset·可视化报表
略懂而已20 小时前
安装SSL后网站速度变慢?
网络·网络协议·ssl
CodeYp20191 天前
第13讲:HTTPS 协议原理
linux·https
Thanks_ks1 天前
HTTPS:浏览器地址栏那把锁的工作原理
http·网络安全·https·tls·加密算法·数字证书·中间人攻击
吴建旭 智宅焕1 天前
智能家居全国交付中执行端能力跃迁的架构设计:从标准装调到交付专家的系统化路径
网络·网络协议·智能家居
Dream Cosmos2 天前
传输层协议之UDP
网络·网络协议·udp
梦到啥说啥2 天前
Linux网络编程:UDP网络协议
linux·网络协议·udp
张小姐的猫2 天前
【基于 WebSocket 的多用户网页五子棋】—— 项目结构设计与实用工具类模块
网络·websocket·网络协议
wuyk5552 天前
Spider-第03讲-HTTP速通与读懂响应
网络·爬虫·网络协议·http
梦到啥说啥3 天前
Linux网络编程:TCP网络协议
网络·网络协议·tcp/ip