You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2013/08/09 07:37:51 UTC

[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@httpd.apache.org
          Reporter: wjaspers4@gmail.com

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@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55392] mod_access appears to inteferes with vhosts

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55392

will jaspers <wj...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from will jaspers <wj...@gmail.com> ---
Likely invalid per my bad configuration.
See: https://issues.apache.org/bugzilla/show_bug.cgi?id=55408

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org