Access Forbidden Error 403

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

Access Forbidden Error 403

Postby rvibes » 16. January 2017 23:00

I installed Xampp and configured the httpd.conf file as instructed. Stopped and started the Apache service after creating the code directory but I get the above error in the browser when I attempt to contact the local host http://localhost/code..
rvibes
 
Posts: 2
Joined: 16. January 2017 22:53
XAMPP version: 5.6
Operating System: windows10

Re: Access Forbidden Error 403

Postby Altrea » 17. January 2017 08:51

rvibes wrote:and configured the httpd.conf file as instructed.

Who instructed you what to do?

rvibes wrote:Stopped and started the Apache service after creating the code directory but I get the above error in the browser when I attempt to contact the local host http://localhost/code..

Without any helpful information noone will be able to help you.
Which changes do you do in your configuration files exactly?
Are there any files in your code directory?
What is the contents on your Apache error.log and access.log?
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: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Access Forbidden Error 403

Postby rvibes » 17. January 2017 18:38

I was instructed to add the following code to the httpd.conf file by the jQuery / Javascript book called Sams Teach Yourself

<Directory "C:/xampp/htdocs/code">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
Allow from All

#
# Controls who can get stuff from this server.
#

</Directory>


I don't get any error in the xampp apache log

XAMPP Installation Directory: "c:\xampp\"
17:36:22 [main] Checking for prerequisites
17:36:32 [main] All prerequisites found
17:36:32 [main] Initializing Modules
17:36:32 [main] Starting Check-Timer
17:36:32 [main] Control Panel Ready
17:38:02 [Apache] Attempting to start Apache app...
17:38:02 [Apache] Status change detected: running

I just get the error when I try to access the localhost through the browser
rvibes
 
Posts: 2
Joined: 16. January 2017 22:53
XAMPP version: 5.6
Operating System: windows10

Re: Access Forbidden Error 403

Postby Nobbie » 17. January 2017 19:12

rvibes wrote:I was instructed to add the following code to the httpd.conf file by the jQuery / Javascript book called Sams Teach Yourself


And why?? (You might be happy, think about if Sams teaches you to "jump into the hudson river in winter", would you do this also without thinking?).

Anyway, "Allow From" is deprecated and does not work with Apache 2.4. Instead you should use "Require" (see Apache Documentation) but i still dont understand, why you added these lines - its useless. Last not least, which files did you apply in c:/xampp/htdocs/code? You did not tell us anything about that.
Nobbie
 
Posts: 13179
Joined: 09. March 2008 13:04

Re: Access Forbidden Error 403

Postby Altrea » 17. January 2017 19:36

rvibes wrote:<Directory "C:/xampp/htdocs/code">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
Allow from All

#
# Controls who can get stuff from this server.
#

</Directory>

These lines are obsolet because there are already defined default Directory rules for the parent directory C:\xampp\htdocs\ which gets inherited on the subdirectories if no other rules are defined for these subdirectories overriding them.
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: 11935
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 246 guests