Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I get Access Forbidden (Error 403) when setting up new alias

Tags:

xampp

I'm running windows 7 and recently installed XAMPP to build a dev environment. I'm not great with the server side of things so I'm having some problems setting up an alias for a project.

So far XAMPP is running and if I go to localhost I get the XAMPP welcome page. I created an "alias" folder in my "conf" folder of my apache install. In there I added dev.conf with the following content:

<Directory "C:\Users\my_user\My%20Documents\Aptana%20Studio%203%20Workspace\project">     Options Indexes FollowSymLinks Includes ExecCGI     AllowOverride All     Order allow,deny     Allow from 127.0.0.1 </Directory>  Alias /dev "C:\Users\my_user\My%20Documents\Aptana%20Studio%203%20Workspace\project" 

But then when I go to "localhost/dev" I get:

Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.

Error 403

I tried googling and I found other similar questions on SO but I can't seem to figure it out. Some say that you have to tell it to have permissions but in my conf file I specified to allow it from 127.0.0.1. Maybe this is because my path has spaces in it (though some googling told me %20 work). I had managed to create one to a different folder and copy pasted the working one and changed the alias and path and it broke so it this tells me it probably has something to do with either.

I looked in my log folder and found the following line:

[Tue Dec 13 14:59:20 2011] [error] [client ::1] client denied by server configuration: C:/Users/my_user/My%20Documents

I'm not sure if it cuts because error messages can only be of a certain length but that's definitely not the path I added in the dev.conf file, I'm hoping this can make this a bit clearer for some because I am getting pretty frustrated and I'm not sure what to try anymore.

like image 445
Gazillion Avatar asked Dec 13 '11 20:12

Gazillion


People also ask

How do I fix 403 authorization error?

You can try to fix error 403 in Google Chrome by refreshing the page, double-checking the address, clearing the cache and cookies from your browser, confirming that you have authorization to view the page, contacting the web site directly, or returning to the page later.

Why does it keep saying 403 forbidden?

The 403 Forbidden Error happens when the web page (or another resource) that you're trying to open in your web browser is a resource that you're not allowed to access. It's called a 403 error because that's the HTTP status code that the webserver uses to describe that kind of error.


1 Answers

I just found the same issue with Aliases on a Windows install of Xampp.

To solve the 403 error:

<Directory "C:/Your/Directory/With/No/Trailing/Slash">    Require all granted </Directory>  Alias /dev "C:/Your/Directory/With/No/Trailing/Slash" 

The default Xampp set up should be fine with just this. Some people have experienced issues with a deny placed on the root directory so flipping out the directory tag to:

<Directory "C:/Your/Directory/With/No/Trailing/Slash">    Allow from all    Require all granted </Directory> 

Would help with this but the current version of Xampp (v1.8.1 at the time of writing) doesn't require it.

As for op's issue with port 80 Xampp includes a handy Netstat button to discover what's using your ports. Fire that off and fix the conflict, I imagine it could have been IIS but can't be sure.

like image 195
GuyC Avatar answered Sep 25 '22 23:09

GuyC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!