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即可。
相关推荐
IpdataCloud2 小时前
IPv6商用数据的IP离线库能解决哪些业务问题?适用场景与接入指南
网络·网络协议·tcp/ip
思麟呀8 小时前
Select多路转接
linux·网络·c++·网络协议·http
wl85119 小时前
SAP CPI 教程003 如何抓取Http适配器异常信息
网络·网络协议·http
lularible10 小时前
PTP协议精讲(3.7):传输层实现——PTP报文的“高速公路“
网络·网络协议·开源·嵌入式·ptp
S1998_1997111609•X10 小时前
RSS/RSA\-SSh,G\-bps^&&·iOS\Cd/,~…:cade?_code in/@$&¥_buy=ID card|want_M_GEN.M*L
网络协议·百度·ssh·gpu算力·oneapi
郝学胜-神的一滴10 小时前
深入epoll反应堆模型:从libevent源码看高性能IO设计精髓
linux·服务器·开发语言·c++·网络协议·unix·信息与通信
汤愈韬13 小时前
防火墙双机热备之VRRP
网络·网络协议·security
S1998_1997111609•X14 小时前
company:/erp:-9/po-api=-TCP—iOSUCdc.=no?=-ERP•£
网络协议·百度·ssh
Hello_Embed14 小时前
嵌入式上位机开发入门(二十九):JsonRPC TCP Server
网络·单片机·网络协议·tcp/ip·json·嵌入式
S1998_1997111609•X14 小时前
IP:/-cn,?$&-192=80~3306/- SQL if(REC)
网络协议