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即可。
相关推荐
ALLSectorSorft4 小时前
上门服务小程序会员系统框架设计
小程序·apache
廖致君4 小时前
C/Python/Go示例 | Socket Programing与RPC
网络协议
杨过姑父5 小时前
部署开源版禅道,修改apache端口无效解决
bug·apache·软件工程·issue
栗子叶6 小时前
两种Https正向代理的实现原理
网络协议·http·https·正向代理
酷爱码6 小时前
Spring Boot 整合 Apache Flink 的详细过程
spring boot·flink·apache
jingyucsdn6 小时前
网页端 VUE+C#/FastAPI获取客户端IP和hostname
网络协议·tcp/ip·fastapi
SZ1701102319 小时前
IP协议 标识字段 同一个源IP、目的IP和协议号内唯一
网络·网络协议·tcp/ip
狐5710 小时前
2025-06-02-IP 地址规划及案例分析
网络·网络协议·tcp/ip
利刃大大20 小时前
【在线五子棋对战】二、websocket && 服务器搭建
服务器·c++·websocket·网络协议·项目