Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Bugs

[Bug 55392] New: mod_access appears to inteferes with vhosts

 

 

Apache bugs RSS feed   Index | Next | Previous | View Threaded


bugzilla at apache

Aug 8, 2013, 10:37 PM

Post #1 of 1 (8 views)
Permalink
[Bug 55392] New: mod_access appears to inteferes with vhosts

https://issues.apache.org/bugzilla/show_bug.cgi?id=55392

Bug ID: 55392
Summary: mod_access appears to inteferes with vhosts
Product: Apache httpd-2
Version: 2.4-HEAD
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: mod_vhost_alias
Assignee: bugs [at] httpd
Reporter: wjaspers4 [at] gmail

Prequisites:
mod_vhost_alias is enabled
mod_access is enabled

I have 1 virtualhost config in my sites-enabled:
sites-enabled/[000-site.conf -> ../sites-available/000-site.conf]

My apache.conf is configured as such:
#
#
#
<Directory />
# default config
Options none
AllowOverride none
Require all denied
</Directory>

#
# Commented out.
# I've normally disabled the default document root
# in Apache 2.2 and below so vhosts can't see each other.
#
#<Directory /var/www>
# Options all
# AllowOverride all
# Require all granted
#</Directory>



My 1 virtualhost container (000-site.conf) is configured as such:
<VirtualHost *:80>
UseCanonicalName Off
ServerName server.com
ServerAlias *.server.com
VirtualDocumentRoot /var/www/%0/public

<Directory /var/www/%0/public>
Require all granted
</Directory>
</VirtualHost>


The default directory configuration denies requests to the virtual host.
Even <Directory /var/www/%0>Require all granted</Directory> fails.

To test this, configure as described. My test below assumes a subfolder exists
in the following layout:
/var/www/something.server.com/public


From your cli:
curl something.server.com

Result:
HTTP/1.1 403 FORBIDDEN

Expected:
HTTP/1.1 200 OK

Take a peek at error.log:
[Thu Aug 08 03:49:22.018179 2013] [access_compat:error] [pid 13791] [client
127.0.0.1:57471] AH01797: client denied by server configuration:
/var/www/something.server.com/public/


Adding the default directory back into apache.conf and changing the access
requirement fixes the problem.
apache.conf
+ <Directory /var/www>
+ Require all granted
+ </Directory>

sudo service apache2 restart


From your cli:
curl something.server.com

Result:
HTTP/1.1 200 OK



In apache 2.2, the <Directory> for the default DocumentRoot did NOT need to be
defined for vhosts to work.
In apache 2.4, my virtual hosts ONLY work if this is specified.

Do <Directory> directives take precedence and cascade over vhost <Directory>
directives??
Do <Directory> directives for parent folders cascade over children?



Related issues:
- https://issues.apache.org/bugzilla/show_bug.cgi?id=36588
- https://issues.apache.org/bugzilla/show_bug.cgi?id=47696

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe [at] httpd
For additional commands, e-mail: bugs-help [at] httpd

Apache bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.