Error 403 when using local hosts

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

Error 403 when using local hosts

Postby Gee Bee » 23. April 2006 17:00

Hi everyone,

Im trying to setup a virtual host on my local machine to use in a development enviroment but its not working.

Can anyone tell me what im doing wrong as im very confused! Im using apache 2.2 with windows xp pro. My vhosts file has the following in it


NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot "C:/Websites/mySite.dev/publish/"
ServerName mySite.dev:80
</VirtualHost>

It keeps showing error 403 access forbidden for both mySite.dev and localhost. The error log shows the following;

[Sun Apr 23 16:59:13 2006] [error] [client 127.0.0.1] (20023)The given path was above the root path: Cannot map GET /xampp/ HTTP/1.1 to file

Any help would be greatly appreciated.
Gee Bee
 
Posts: 1
Joined: 23. April 2006 16:44

Postby capitalfellow » 09. May 2006 16:09

The more fine grained apache directives over ride the settings of those that are higher up. If you were to look in C:\your_path\xampp\apache\conf\httpd.conf

you'd see that the DocumentRoot is set to

C:/xampp/xampp/htdocs

So any file or folder below that already had has permission to be served out such as

C:/xampp/xampp/htdocs/foo

you would be able to access with http://localhost/foo

But your virtual host DocumentRoot is outside of that higher up DocumentRoot. So you need to explicity give the webserver permission to serve out content from that directory:

<VirtualHost *:80>
ServerName mySite.dev:80
DocumentRoot "C:/Websites/mySite.dev/publish/"
<Directory "C:/Websites/mySite.dev/publish/">
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
User avatar
capitalfellow
 
Posts: 60
Joined: 19. July 2005 01:10
Location: Charlotte, NC USA
Operating System: OS X


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 133 guests