Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Permission Denied Problem with Apache2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dougbrowne
n00b
n00b


Joined: 05 Mar 2007
Posts: 5

PostPosted: Fri Feb 08, 2008 11:15 pm    Post subject: Permission Denied Problem with Apache2 Reply with quote

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! 8O )
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23086

PostPosted: Sat Feb 09, 2008 12:28 am    Post subject: Reply with quote

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
View user's profile Send private message
dougbrowne
n00b
n00b


Joined: 05 Mar 2007
Posts: 5

PostPosted: Sat Feb 09, 2008 12:46 am    Post subject: Reply with quote

[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 8O 8O 8O I haven't touched the server in days and everything was working fine yesterday..
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23086

PostPosted: Sat Feb 09, 2008 3:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum