我的配置是:
Listen 443 http
NameVirtualHost *:80
NameVirtualHost *:443
ServerName *:80
<VirtualHost *:80>
[some non-ssl stuff]
ServerName account.example.com
</VirtualHost>
<VirtualHost *:443>
[some non-ssl stuff(directory, docroot)]
ServerName account.example.com
SSLEngine on
SSLCertificateFile /Users/myusername/certs/server.crt
SSLCertificateKeyFile /Users/myusername/certs/server.key
</VirtualHost>
所以我无法访问我网站的 http 版本,但 ssl 版本工作正常。我想同时使用虚拟主机 http(80) 和 https(443) 通过 mod_rewrite 将 http 重写为 https URL。
uname -a
Linux 3.4.62-53.42.amzn1.x86_64 GNU/Linux
httpd -v
Server version: Apache/2.2.25 (Unix)
请帮助理解我做错了什么。