3 虚拟主机在浏览特定域名时提供相同的页面

3 虚拟主机在浏览特定域名时提供相同的页面

我在 Debian 上安装了 Webmin。我想将 3 个域名添加到虚拟主机,但由于某种原因,浏览域名时所有 3 个域名都提供相同的页面。所有 3 个网站上显示的页面都是index.php我放在 上的测试文件itnerd.nl。如何解决这个问题?

这是我使用时得到的apachectl -S

    VirtualHost configuration:
[2001:41d0:8:e2a1::1]:80 is a NameVirtualHost
     default server itnerd.nl (/etc/apache2/sites-enabled/itnerd.nl.conf:1)
     port 80 namevhost itnerd.nl (/etc/apache2/sites-enabled/itnerd.nl.conf:1)
178.32.223.161:80      is a NameVirtualHost
     default server itnerd.nl (/etc/apache2/sites-enabled/itnerd.nl.conf:1)
     port 80 namevhost itnerd.nl (/etc/apache2/sites-enabled/itnerd.nl.conf:1)
wildcard NameVirtualHosts and _default_ servers:
*:80              www.thememonster.nl (/etc/apache2/sites-enabled/www.thememonster.nl.conf:1)
Syntax OK

答案1

以下是两个配置文件:

<VirtualHost 178.32.223.161:80 [2001:41d0:8:e2a1::1]:80>

SuexecUserGroup "#1003" "#1002" ServerName itnerd.nl ServerAlias www.itnerd.nl ServerAlias webmail.itnerd.nl ServerAlias admin.itnerd.nl DocumentRoot /home/itnerd/public_html ErrorLog /var/log/virtualmin/itnerd.nl_error_log CustomLog /var/log/virtualmin/itnerd.nl_access_log combined ScriptAlias /cgi-bin/ /home/itnerd/cgi-bin/ ScriptAlias /awstats/ /home/itnerd/cgi-bin/ DirectoryIndex index.html index.htm index.php index.php4 index.php5 选项 -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI 允许所有 AllowOverride 所有Options=ExecCGI、Includes、IncludesNOEXEC、Indexes、MultiViews、SymLinksIfOwnerMatch AddType application/x-httpd-php .php AddHandler fcgid-script .php AddHandler fcgid-script .php5 FCGIWrapper /home/itnerd/fcgi-bin/php5.fcgi .php FCGIWrapper /home/itnerd/fcgi-bin/php5.fcgi .php5 允许所有 AllowOverride 所有 Options=ExecCGI、Includes、IncludesNOEXEC、Indexes、MultiViews、SymLinksIfOwnerMatch RewriteEngine on RewriteCond %{HTTP_HOST} =webmail.itnerd.nl RewriteRule ^(.https://itnerd.nl:20000/[R] RewriteCond %{HTTP_HOST} =admin.itnerd.nl RewriteRule ^(.https://itnerd.nl:10000/[R] RemoveHandler .php RemoveHandler .php5 php_admin_value engine Off FcgidMaxRequestLen 1073741824 AuthName "itnerd.nl statistics" AuthType Basic AuthUserFile /home/itnerd/.awstats-htpasswd require valid-user Alias /dav /home/itnerd/public_html DAV on AuthType Basic AuthName "itnerd.nl" AuthUserFile /home/itnerd/etc/dav.digest.passwd Require valid-user ForceType text/plain Satisfy All RemoveHandler .php RemoveHandler .php5 RewriteEngine off

另一个:

<VirtualHost *:80>

DocumentRoot“/home/thememonster.nl/public_html”ServerName www.thememonster.nl 允许所有选项无

我之前也有一个 itmonsters.tk 的虚拟主机,但我删除了它。当我访问 itmonsters.tk 和 thememonster.nl 时,我得到的只是 itnerd.nl 需要显示的索引页。有没有什么解决办法?

相关内容