virtualhost:做 http 和 https 错误的浏览器渲染
Posted
技术标签:
【中文标题】virtualhost:做 http 和 https 错误的浏览器渲染【英文标题】:virtualhost: doing http and https bad browser rendering 【发布时间】:2014-01-18 10:16:48 【问题描述】:我的http virtualhost配置文件完全相同,浏览器的渲染是好的。我已将(debian)新的 https 虚拟主机添加到 /etc/apache/site-available 但浏览器的呈现不正确。
您可以显示两个网站的运行情况:
http://www.mokaccino.it/index.php (works)
https://www.mokaccino.it/index.php (bad)
<VirtualHost *:443>
ServerSignature Off
ServerAdmin info@example.com
ServerName example.com
ServerAlias www.example.com
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
DirectoryIndex index.html index.php
DocumentRoot /home/example.com/
suPHP_Engine on
AddHandler x-httpd-php .php .php3 .php4 .php5
suPHP_AddHandler x-httpd-php
suPHP_ConfigPath /home/example.com/
<Directory /home/example.com/>
Options -Includes -Indexes -FollowSymLinks -ExecCGI +MultiViews
AllowOverride none
Order allow,deny
Allow from all
</Directory>
ErrorLog /home/example.com/logs/error.log
CustomLog /home/example.com/logs/access.log combined
</VirtualHost>
【问题讨论】:
【参考方案1】:http 和 https 都可以正常工作。唯一的问题是您有一个自签名的 https 证书,因此浏览器会向您发出警告。你可以用 curl 试试:
curl -v -k https://www.mokaccino.it/index.php
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
* subject: C=IT; ST=Milano; L=Legnano; O=pineappleweb.it; OU=pineappleweb.it; CN=pineappleweb.it; emailAddress=info@pineappleweb.it
* start date: 2013-07-04 12:47:19 GMT
* expire date: 2033-06-29 12:47:19 GMT
* issuer: C=IT; ST=Milano; L=Legnano; O=pineappleweb.it; OU=pineappleweb.it; CN=pineappleweb.it; emailAddress=info@pineappleweb.it
* SSL certificate verify result: self signed certificate (18), continuing anyway.
【讨论】:
以上是关于virtualhost:做 http 和 https 错误的浏览器渲染的主要内容,如果未能解决你的问题,请参考以下文章
ini 配置Apache虚拟主机和PHP使用; http://stackoverflow.com/questions/9110179/adding-virtualhost-fails-access-f
如何使用 VirtualHost 将 http://example.com 重定向到 apache2.conf 中的 https://example.com