本文基于windows平台。
个人感觉使用apache配置起来比较繁琐,而使用upupw或者xmpp等集成开发工具更方便。
LoadModule ssl_module modules/mod_ssl.so
。另外,千万不要注释掉下面的一行:Include conf/extra/httpd-ssl.conf
。具体原因不明。Listen 443
ServerName aa
ServerAlias aa
SSLEngine on
SSLProxyEngine on
SSLCertificateFile "D:/UPUPW/Apache2/conf/server.crt"
SSLCertificateKeyFile "D:/UPUPW/Apache2/conf/server.key"
"D:/UPUPW/htdocs"
DirectoryIndex index.html index.htm index.php default.php app.php u.php
"D:/UPUPW/htdocs">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
注意:上述DocumentRoot字段是说的html和php等服务程序的目录。Directory字段的值要填写正确。https证书和私钥放在conf目录下,文件名也要填写正确。生成https数字证书的步骤如下文:【openssl生成自签名证书 - CSDN App】http://t.csdnimg.cn/D19gR
httpd -k restart
重启apache即可。