![为什么此配置会将 www.sec.com 重定向至 www.domain1.com?](https://linux22.com/image/545888/%E4%B8%BA%E4%BB%80%E4%B9%88%E6%AD%A4%E9%85%8D%E7%BD%AE%E4%BC%9A%E5%B0%86%20www.sec.com%20%E9%87%8D%E5%AE%9A%E5%90%91%E8%87%B3%20www.domain1.com%EF%BC%9F.png)
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.domain1.com
DocumentRoot "/var/www/html/home/"
ScriptAlias /cgi-bin/awstats /var/www/cgi-bin/awstats
Alias /awstats /var/www/html/awstats
Alias /myadmin /var/www/html/myadmin
ScriptAlias /mailman/ /var/www/cgi-bin/mailman/
Alias /pipermail/ /var/mailman/archives/public/
Alias /horde /var/www/html/horde
SuexecUserGroup webadmin webadmin
ServerAdmin "[email protected]"
ScriptAlias "/cgi-bin/" "/home/webadmin/domain1.com/cgi-bin/"
CustomLog "/home/webadmin/domain1.com/access_log" "combined"
ErrorLog "/home/webadmin/domain1.com/error_log"
<Directory /home/webadmin/domain1.com/html>
Options Includes FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.sec.com
DocumentRoot "/var/www/html/home/sec"
</VirtualHost>
<VirtualHost *:443>
ScriptAlias /cgi-bin/awstats /var/www/cgi-bin/awstats
Alias /awstats /var/www/html/awstats
Alias /myadmin /var/www/html/myadmin
ScriptAlias /mailman/ /var/www/cgi-bin/mailman/
Alias /pipermail/ /var/mailman/archives/public/
Alias /horde /var/www/html/horde
ServerName www.domain1.com
DocumentRoot /var/www/html/home/
SuexecUserGroup webadmin webadmin
ServerAdmin "[email protected]"
ScriptAlias "/cgi-bin/" "/home/webadmin/domain1.com/cgi-bin/"
CustomLog "/home/webadmin/domain1.com/access_log" "combined"
ErrorLog "/home/webadmin/domain1.com/error_log"
SSLCertificateFile /etc/httpd/conf/ssl.crt/domain1.com.hspc.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/domain1.com.hspc.key
SSLEngine on
<Directory /home/webadmin/domain1.com/html>
Options Includes FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
答案1
没有重定向到 www.domain1.com 您需要在请求中发送正确的标头,其中 Host: 是 www.sec.com
curl -H 'Host:www.sec.com' http://YOUR_IP
或者将其放入主机文件中。