2013-08-21 57 views
0

我的所有虛擬主機正在陷入第一個可用的webroot,而不是他們指定的webroot,除了我的第二個,它只是瘋了。apache2 vhost去錯誤的webroot

,如果我嘗試訪問ipv6mailer.com我看擊活去 - >

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

真,該文件是「不」存在。它應該在/家/ 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 

這將 '新' 的默認,而不是服務器名

# 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 
+0

權限已被雙重檢查。稍微不同的錯誤,但仍然混合匹配。去ipv6mailer.com/login-form.php現在產生[2013年8月21日15:16:13] [暴擊] [客戶端24.184.110.39](13)權限被拒絕:/home/wemail1/www/.htaccess pcfg_openfile:無法檢查htaccess文件,確保它是可讀的。仍然錯誤的目錄/ – brad

回答

0

如果該目錄的有效值爲AllowOverride!= none(IOW,),則用戶apache正在以/ www和您正在服務的文件之間的每個路徑需要搜索權限(www的數據?如果Apache被配置爲在那裏尋找htaccess)。