我已在我的apache Web服务器上应用ssl证书以支持https。 为此,我创建了两个虚拟主机:
# www virtual host
<VirtualHost *:80>
ServerAdmin webmaster@example.it
ServerName dev.example.it
ServerAlias dev.example.it
DocumentRoot /home/my/dev
Redirect permanent / https://dev.example.it/
...
</VirtualHost>
#ssl virtual host
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile "/ssl/www_example_it.crt"
SSLCertificateKeyFile "/ssl/www_example_it.key"
SSLCACertificateFile "/ssl/www_example_it.ca-bundle"
ServerAdmin info@example.it
DocumentRoot /home/my/dev
ServerName dev.example.it
ServerAlias dev.example.it
ErrorLog logs/ssl.dev.example.it-error_log
CustomLog logs/ssl.dev.example.it-access_log common
...
</VirtualHost>
我对我网站的根目录上的.htaccess也有一些重写规则;类似的事情:
# user profile
RewriteCond %{REQUEST_URI} ^/user\-[a-zì_]+/[a-z0-9ü\-]+$
RewriteRule ^user-(.*)/(.*)$ https://%{HTTP_HOST}/profile/$2/$1/user [P]
我不明白为什么我在浏览器上收到内部服务器错误,如果我指向url https://www.example.it/user-par1/par2并且apache错误日志显示:
[Wed Oct 05 08:42:07.163798 2016] [ssl:error] [pid 23567] [remote x.x.x.x:443] AH01961: SSL Proxy requested for dev.example.it:443 but not enabled [Hint: SSLProxyEngine]
[Wed Oct 05 08:42:07.163834 2016] [proxy:error] [pid 23567] AH00961: HTTPS: failed to enable ssl support for x.x.x.x:443 (dev.example.it)
有人可以帮我解决这个问题吗?