apache2 vhost出错了webroot

时间:2013-08-21 14:42:49

标签: apache2 vhosts

我的所有虚拟主机都陷入了第一个可用的webroot而不是他们分配的webroot,除了我的第二个只是疯狂。

如果我尝试访问ipv6mailer.com,我会看到热门直播 - >

[error] [client 24.184.110.39] script not found or unable to stat: /home/downlowd/www/login-form.php

是的,该文件“不存在”。它应该在/ home / ipv6mailer / www

中查找

我有3个虚拟主机,两个正在/ home / downlwd / www并完全忽略ServerName。

如果我评论我们的downlowd.com,日志输出尝试访问ipv6mailer.com看起来像 - >

[Wed Aug 21 15:23:12 2013] [crit] [client 24.184.110.39] (13)Permission denied: /home/wemail1/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

它将转到'新'默认值而不是ServerName

# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#<IfDefine DEFAULT_VHOST>
# see bug #178966 why this is in here

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

# Use name-based virtual hosting.
NameVirtualHost *:80

# When virtual hosts are enabled, the main host defined in the default
# httpd.conf configuration will go away. We redefine it here so that it is
# still available.
#
# If you disable this vhost by removing -D DEFAULT_VHOST from
# /etc/conf.d/apache2, the first defined virtual host elsewhere will be
# the default.


# vim: ts=4 filetype=apache

<VirtualHost *:80>
        ServerName www.downlowd.com
        ServerAlias downlowd.com *.downlowd.com
        ServerPath /downlowd.com
        DocumentRoot /home/downlowd/www
        <Directory "/home/downlowd/www">
                Options Indexes FollowSymLinks MultiViews ExecCGI Includes
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

AddHandler cgi-script .php .php4 .php3


<VirtualHost *:80>
        ServerName www.wemail1.com
        ServerAlias wemail1.com *.wemail1.com
        ServerPath /wemail1.com
        DocumentRoot /home/wemail1/www
        <Directory "/home/wemail1/www">
                Options Indexes FollowSymLinks MultiViews ExecCGI Includes
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

<VirtualHost *:80>
        ServerName www.ipv6mailer.com
        ServerAlias ipv6mailer *.ipv6mailer.com
        ServerPath /ipv6mailer
        DocumentRoot /home/ipv6mailer/www
        <Directory "/home/ipv6mailer/www">
                Options Indexes FollowSymLinks MultiViews ExecCGI Includes
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>



dev-box-201 www # /usr/sbin/apache2 -S
apache2: Could not reliably determine the server's fully qualified domain name, using dev-box-201.nyctelecomm.com for ServerName
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server www.downlowd.com (/etc/apache2/vhosts.d/00_default_vhost.conf:42)
         port 80 namevhost www.downlowd.com (/etc/apache2/vhosts.d/00_default_vhost.conf:42)
         port 80 namevhost www.wemail1.com (/etc/apache2/vhosts.d/00_default_vhost.conf:58)
         port 80 namevhost www.ipv6mailer.com (/etc/apache2/vhosts.d/00_default_vhost.conf:71)
Syntax OK

1 个答案:

答案 0 :(得分:0)

如果该目录的有效值为AllowOverride,则用户apache正在运行,因为(www-data?)需要搜索权限(目录上的+ x),用于/和您正在服务的文件之间的每条路径!= none (IOW,如果Apache配置为在那里寻找htaccess)。