Apache Virtualhost 403 Forbidden

Apache VirtualHost 403 Forbidden

Apache 2.4.3 (or maybe slightly earlier) added a new security feature that often results in this error. You would also see a log message of the form "client denied by server configuration". The feature is requiring a user identity to access a directory. It is turned on by DEFAULT in the httpd.conf that ships with Apache. You can see the enabling of the feature with the directive

Require all denied

This basically says to deny access to all users. To fix this problem, either remove the denied directive (or much better) add the following directive to the directories you want to grant access to:

Require all granted

as in

<Directory "your directory here">
Order allow,deny
Allow from all
# New directive needed in Apache 2.4.3:
Require all granted
</Directory>

Adding VirtualHost fails: Access Forbidden Error 403 (XAMPP) (Windows 7)

Okay: This is what I did now and it's solved:

My httpd-vhosts.conf looks like this now:

<VirtualHost dropbox.local:80>
DocumentRoot "E:/Documenten/Dropbox/Dropbox/dummy-htdocs"
ServerName dropbox.local
ErrorLog "logs/dropbox.local-error.log"
CustomLog "logs/dropbox.local-access.log" combined
<Directory "E:/Documenten/Dropbox/Dropbox/dummy-htdocs">
# AllowOverride All # Deprecated
# Order Allow,Deny # Deprecated
# Allow from all # Deprecated

# --New way of doing it
Require all granted
</Directory>
</VirtualHost>

First, I saw that it's necessary to have set the <Directory xx:xx> options. So I put the <Directory > [..] </Directory>-part INSIDE the <VirtualHost > [..] </VirtualHost>.
After that, I added AllowOverride AuthConfig Indexes to the <Directory> options.

Now http://localhost also points to the dropbox-virtualhost. So I added dropbox.local to <VirtualHost *:80> which makes it as <VirtualHost dropbox.local:80>

FINALLY it works :D!

I'm a happy man! :) :)

I hope someone else can use this information.

403 Forbidden - Permission - VHOSTS

(Posted on behalf of the OP).

After upgrading my mac, my php switcher wasn't working cause by the php7_module which wasn't called in the httpd.conf.

Apache 403 forbidden on allow from all Directory - virtualhosts

Apache VirtualHost 403 Forbidden

Is what fixed it. Quote from answer:

Apache 2.4.3 (or maybe slightly earlier) added a new security feature
that often results in this error. You would also see a log message of
the form "client denied by server configuration". The feature is
requiring a user identity to access a directory. It is turned on by
DEFAULT in the httpd.conf that ships with Apache. You can see the
enabling of the feature with the directive

I needed to add Require all granted in <Directory></Directory>



Related Topics



Leave a reply



Submit