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即可。
相关推荐
汤愈韬5 小时前
IPSec工作原理——TK
网络·网络协议·网络安全·security
treesforest6 小时前
机房IP是什么?有什么危害?如何识别?
网络·数据库·python·网络协议·tcp/ip·网络安全
方芯半导体7 小时前
ST系列MCU EtherCAT协议栈框架结构详解
服务器·网络·数据库·网络协议·机器人·自动化·工业以太网
x***r15111 小时前
linux安装 apache-tomcat-7.0.42.tar.gz 详细步骤(解压、配置、启动)
linux·tomcat·apache
pengyi87101513 小时前
代理 IP 隐私保护核心原理:从 IP 隐藏到身份匿名的完整链路
网络·网络协议·tcp/ip
磊 子13 小时前
TCP/IP ⽹络模型有哪⼏层?
网络·网络协议·tcp/ip
2501_9151063213 小时前
深入解析HTTPS抓包原理、中间人攻击及反抓包技术攻防
数据库·网络协议·ios·小程序·https·uni-app·iphone
sinat_2554878113 小时前
HTTP、端口、请求、响应、REST
java·网络·网络协议·http·tomcat·intellij-idea
Arden Zhao14 小时前
Gihtub HTTP添加为HTTPS证书
https·github
游戏开发爱好者814 小时前
React Grab工具详解:AI助力Vue3、Svelte和Solid前端元素调试
android·ios·小程序·https·uni-app·iphone·webview