View previous topic :: View next topic |
Author |
Message |
dougbrowne n00b
Joined: 05 Mar 2007 Posts: 5
|
Posted: Fri Feb 08, 2008 11:15 pm Post subject: Permission Denied Problem with Apache2 |
|
|
Well I was on IRC trying to get an answer to this problem but haven't found one so I thought I would try my luck here.
when i go to my website in my browser it works fine but if i try to go into any subdirectory (ex. domain.com/subdir ) it says permission denied error like if it was chmoded 000 or whatever but i tried chmoding everything to 777 nothing happened... , i tried a reboot but still permission errors. But I think I may know why this is happening, it's doing this probably because the other day i accidently emerged apache1 and now both apache1 and 2 are on my server and maybe apache1 is trying to take the permissions?? I'm not exactly sure... (Don't ask how I emerged apache1 when it's not in the portage tree... I Don't Know! ) |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23086
|
Posted: Sat Feb 09, 2008 12:28 am Post subject: |
|
|
Remove all that directory structure and restore it from a backup with sane permissions. If you left it set to mode 777, there is no way to guarantee that another user has not modified it in the interim. Never use mode 777.
After that, reproduce the error and post the messages that Apache prints to its error log. The exact location of the error log is configurable, but /var/log/apache2/error_log is a common location. |
|
Back to top |
|
|
dougbrowne n00b
Joined: 05 Mar 2007 Posts: 5
|
Posted: Sat Feb 09, 2008 12:46 am Post subject: |
|
|
[Fri Feb 08 19:43:16 2008] [error] [client <CENSORED>] Directory index forbidden by rule: /var/www/localhost/htdocs/blog/, referer: <CENSORED>
theres an example error for you. Also I just figured out i can go to ex. domain.com/blog/index.php and it won't say permission denied instead it will just show the raw php code I haven't touched the server in days and everything was working fine yesterday.. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23086
|
Posted: Sat Feb 09, 2008 3:49 pm Post subject: |
|
|
Perhaps it was configured incorrectly a long time ago, but only recently loaded the bad configuration. Since you mention index.php, I assume you want requests to /blog/ to be treated the same as requests for /blog/index.php. Use the DirectoryIndex option to mark that index.php should be served for that purpose. Also, you need to ensure that the server knows to run PHP instead of just returning it. Both of these problems should be solved if you change your Apache configuration to include -D PHP5 in your APACHE2_OPTS in /etc/conf.d/net. |
|
Back to top |
|
|
|