403 client denied by server configuration error

Problems with the Windows version of XAMPP, questions, comments, and anything related.

403 client denied by server configuration error

Postby jdorner » 14. October 2012 23:13

Hey there :)
I just upgraded to XAMPP version 1.8.1 on Windows 7

Everything worked fine before upgrading XAMPP.
Now, when I go to a virtual host, I get 403 Access forbidden.
For example, when I go to: http://nacaa.local the error generated is:
Code: Select all
[Sun Oct 14 17:51:46.147763 2012] [authz_core:error] [pid 4120:tid 1708] [client 127.0.0.1:50143] AH01630: client denied by server configuration: C:/xampp/htdocs-nacaa/


I've tried to open .txt files that are in the folder and get the same results.
There is no .htaccess file in that folder.

http://localhost redirects to: http://localhost/xampp/
Everything seems to be working fine there.

My xampp\apache\conf\extra\httpd-vhost.conf file contains:
Code: Select all
 <VirtualHost *:80>
    DocumentRoot "C:\xampp\htdocs-nacaa"
    ServerName nacaa.local
    ErrorLog "logs/nacaa.localhost-error.log"
     <Directory "C:\xampp\htdocs-nacaa">
      Options Indexes FollowSymLinks Includes ExecCGI
       Allow from all
       Order allow,deny
     </Directory>
  </VirtualHost>


Like I said, before I upgraded, everything was working.
I get no errors when I start XAMPP or Apache.
I get the same errors for all the virtual hosts.

Any help would be greatly appreciated.
TIA,
John
jdorner
 
Posts: 4
Joined: 14. October 2012 22:58
Operating System: Windows 7

Re: 403 client denied by server configuration error

Postby jdorner » 15. October 2012 00:34

After reading http://httpd.apache.org/docs/2.4/upgrading.html#access I replaced the
Code: Select all
Order allow, deny
Allow from all

with:

Code: Select all
  <VirtualHost *:80>
    DocumentRoot "C:\xampp\htdocs-nacaa"
    ServerName nacaa.local
    ErrorLog "logs/nacaa.localhost-error.log"
     <Directory "C:\xampp\htdocs-nacaa">
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Require all granted
     </Directory>
  </VirtualHost>


Restarted Apache and still no luck.
jdorner
 
Posts: 4
Joined: 14. October 2012 22:58
Operating System: Windows 7

Re: 403 client denied by server configuration error

Postby jdorner » 15. October 2012 00:49

Problem solved.

In c:\xampp\apache\conf\httpd.conf
change:
Code: Select all
<Directory />
    AllowOverride none
    Require all denied
</Directory>


to:

Code: Select all
<Directory />
    AllowOverride none
    Require all granted
</Directory>


Simple if you know what to do.
Hope this saves someone the hours I've spent today trying to solve this problem.
jdorner
 
Posts: 4
Joined: 14. October 2012 22:58
Operating System: Windows 7

Re: 403 client denied by server configuration error

Postby JJ_Tagy » 15. October 2012 00:53

Not sure it matters, but out of curiosity, did you try changing the direction of your slashes?

C:/xampp/htdocs-nacaa
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: 403 client denied by server configuration error

Postby Altrea » 15. October 2012 04:33

Hi jdorner,

jdorner wrote:In c:\xampp\apache\conf\httpd.conf
change:
Code: Select all
<Directory />
    AllowOverride none
    Require all denied
</Directory>


to:

Code: Select all
<Directory />
    AllowOverride none
    Require all granted
</Directory>


Don't do that!
and especially don't recommend others to do the same!
It is highly not recommend and a big security hole!


That is the general default setting for permissions which are not setted.
Means, every ressource you haven't configured properly would know be accessible, independend if you want to or not.

jdorner wrote:Simple if you know what to do.

Sorry, but you don't know what to do.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: 403 client denied by server configuration error

Postby jdorner » 15. October 2012 13:37

Altrea,

Thank you for your comment - but... if I don't change the "Require all" from "denied" to "granted", could you advise me what to do to make it work properly?

I agree - I do not know what to do.

Thanks,
John
jdorner
 
Posts: 4
Joined: 14. October 2012 22:58
Operating System: Windows 7

Re: 403 client denied by server configuration error

Postby Altrea » 15. October 2012 15:47

jdorner wrote:could you advise me what to do to make it work properly?

First you should change back the default grant level to the secure value Require all denied.
Then you should start with JJ_Tagys hint to replace your backslashes (\) with slashes (/).
After that restart your Apache and check again.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: 403 client denied by server configuration error

Postby rcapispisan » 31. October 2012 00:38

changing the slash may not help if it worked before on the same operating system

have you tried going to the apache config file, /apache/conf/httpd.conf
and find the DocumentRoot value, it should tell you the location of the allowed sites

if you need to change that though, you also have to change the value set in <Directory "**"> - its just a few lines below the DocumentRoot
rcapispisan
 
Posts: 1
Joined: 31. October 2012 00:21
Operating System: windows 7

Re: 403 client denied by server configuration error

Postby costeaalex » 17. December 2012 16:05

Hi,
please consider doing this:

Code: Select all
<VirtualHost *:80>
    DocumentRoot "D:\sites\site1"
    ServerName bjm.loc
    <Directory "D:\sites\site1">
   Options Indexes FollowSymLinks Includes ExecCGI
   AllowOverride All
   Order allow,deny
   Allow from all
   
   #insert this line
   Require all granted
   #end insertion

    </Directory>
</VirtualHost>


This will grant privs for that dir only and keep you safe. That inserted line worked fine for me.

Hope it helps,
Alex.
costeaalex
 
Posts: 1
Joined: 17. December 2012 15:54
Operating System: Windows 7

Re: 403 client denied by server configuration error

Postby Altrea » 17. December 2012 17:04

Hi Alex,

costeaalex wrote:This will grant privs for that dir only and keep you safe. That inserted line worked fine for me.

Yes, thats a much better approach.

Three little enhancements:
  • If you are using vhosts, you should define a default host too (e.g. for localhost) that points to the XAMPP Administration Page so that you can still use it.
  • I would use forward slashes instead of backslashes in your paths. It is not absolutely neccessary, but Apache comes from the *nix world and it might be a little bit more bullet proof
  • If you use the new syntax Require all granted you can get rid of Order allow,deny and Allow from all to clean your code a little bit up.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 86 guests