重新启动 apache2 服务器时收到以下错误消息:
[Wed Oct 31 11:44:33 2012] [warn] VirtualHost 172.30.30.12:443 overlaps with VirtualHost 172.30.30.12:443, the first has precedence, perhaps you need a NameVirtualHost directive ... waiting
[Wed Oct 31 11:44:34 2012] [warn] VirtualHost 172.30.30.12:443 overlaps with VirtualHost 172.30.30.12:443, the first has precedence, perhaps you need a NameVirtualHost directive
我最近更改了我的 VirtualHost 文件,因此它当前的内容如下:
<VirtualHost *:80>
ServerName www.mydomain.com
ServerAlias mydomain.com
ServerAdmin [email protected]
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>
<VirtualHost 172.30.30.12:443>
ServerName www.mydomain.com
ServerAlias mydomain.com
ServerAdmin [email protected]
SSLEngine on
SSLProtocol all
SSLCertificateFile /etc/ssl/certs/certificate.crt
SSLCertificateKeyFile /etc/ssl/private/server_ev.key
SSLCertificateChainFile /etc/ssl/certs/intermediate.crt
DocumentRoot /home/Dropbox/mydomain.com/
<Directory /home/Dropbox/mydomain.com/>
<IfModule mod_rewrite.c>
<IfModule mod_ssl.c>
# <Location /squirrelmail>
RewriteEngine on
RewriteCond %{HTTPS} !^on$ [NC]
RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L]
# </Location>
</IfModule>
</IfModule>
SSLOptions +StrictRequire
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
SSLProtocol -all +TLSv1 +SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM
SSLVerifyClient none
SSLProxyEngine off
</VirtualHost>
我做错了什么吗?这个错误可能是什么原因造成的?谢谢。
答案1
您应该检查安装 Apache 和/或 OpenSSL 时设置的配置文件。在 CentOS 上,会创建文件 /etc/httpd/conf.d/ssl.conf,并且它有自己的默认 VirtualHost。
运行apachectl -S
以查看所有 VirtualHosts 的定义位置,希望您可以找到端口 443 上的其他 VirtualHost 的定义位置,这样您就可以摆脱不需要的 VirtualHost。