apache开启https"/>
apache开启https
本文基于windows平台。
个人感觉使用apache配置起来比较繁琐,而使用upupw或者xmpp等集成开发工具更方便。
- 在httpd.conf中,将下一行的注释去掉:
LoadModule ssl_module modules/mod_ssl.so
。另外,千万不要注释掉下面的一行:Include conf/extra/httpd-ssl.conf
。具体原因不明。 - 在httpd-vhosts.conf中添加如下代码:
Listen 443
<VirtualHost _default_:443>ServerName aaServerAlias aaSSLEngine onSSLProxyEngine onSSLCertificateFile "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 FollowSymLinksAllowOverride AllRequire all granted</Directory>
</VirtualHost>
注意:上述DocumentRoot和Directory字段的值要填写正确,https证书和私钥放在conf目录下,文件名也要填写正确。
- apache执行
httpd -k restart
重启apache即可。
更多推荐
apache开启https
发布评论