Question

I read the docs and installed lithium exactly like they have explained but I keep on getting a 403 forbidden error. I am new to apache and php and I have been spending two full days trying to make lithium work. I am running apache 2.0 on osx lion and here is what I did:

1- I created a new directory called my_app in localhost/~marwan/

2- I extracted the sample lithium app in to that directory.

3- I downloaded the lithium framework and extracted it into /libraries/lithium/

When I access http://localhost/~marwan/my_app/ I get the following 403 error:

You don't have permission to access /~marwan/mj/ on this server.

I have researched and added Options +FollowSymLinks to the .htaccess file and the error changed to:

You don't have permission to access /Users/marwan/Sites/my_app/app/webroot/webroot/ on this server.

I have tried to add Options +FollowSymLinks to every .htaccess file but nothing changed.

I dont know if this is relevant: websites on localhost/~marwan/ work but localhost also shows a 403 error. I tried to fiddle with different permissions posted in previous answers but with no luck.

Thank you for your help.

httpd.conf file is here http://pastebin.com/jLwHPbuq

Edit: httpd-userdir.conf is here http://pastebin.com/ZXi51pn7 httpd-vhosts.conf is here http://pastebin.com/3xqRmrzL

Update

The lithium project works when I remove the .htaccess from the main folder but it doesnt work properly because rewriting doesnt work. Here is the .htacces in the project root http://pastebin.com/vt0fVyyL

Was it helpful?

Solution 2

I looked at the error log after restarting apache and found DocumentRoot [/usr/docs/dummy-host.example.com] does not exist so I fixed it by using this answer stackoverflow.com/questions/6671042/… and now it works.

OTHER TIPS

The path you provide in the error message /~marwan/mj/ and the path you provide that you are trying to reach http://localhost/~marwan/my_app/ do not match. According to the error the web server says you are trying to access a directory called mj while your url does not include mj so unless you are doing some URL rewriting this looks like an issue.

Also, just to be clear, when you say you installed the library in /libraries/litium you mean relative to the web root path, correct?


OK, looking at your conf files you can serve files out of /Library/WebServer/Documents or out of ~/Sites (that tilde represents your user directory so it is the same path as /Users/marwan/Sites)

Do this...

  1. In /Library/WebServer/Documents place a file called index.html and have it output some text.
  2. Make sure there are no .htaccess files in /Library/WebServer/Documents.
  3. Make sure you have not modified your httpd.conf file in any way from its default settings.
  4. Do you see the correct behavior for your index.html (you should)? If not, what happens?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top