Help with a 403 forbiden error

  • Francisck
  • Newbie
  • Newbie
  • User avatar
  • Joined: Mar 22, 2008
  • Posts: 9
  • Status: Offline

Post January 31st, 2010, 7:06 pm

Hi!

I just recently installed centOS and went ahead with the following commands:

Code: [ Select ]
Yum install httpd

yum install php

yum install mysql

yum install mysql-server
  1. Yum install httpd
  2. yum install php
  3. yum install mysql
  4. yum install mysql-server


I also went ahead and installed webmin and later found out that any folders or .php files that i placed in /var/www/html would not work and I would get a 403 error

I tried messing with chmod and chmoded the /html folder to 777, didn't work so I chmod'ed the whole /var/www/html folder and still no luck

what do you guys suggest? could it be something with the php.ini?

Hope someone can help thanks!
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post January 31st, 2010, 7:06 pm

  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Joined: May 22, 2004
  • Posts: 3415
  • Loc: Richland, WA
  • Status: Offline

Post January 31st, 2010, 7:26 pm

It was only php files?
#define NULL (::rand() % 2)
  • Francisck
  • Newbie
  • Newbie
  • User avatar
  • Joined: Mar 22, 2008
  • Posts: 9
  • Status: Offline

Post January 31st, 2010, 7:33 pm

It seems so to me, I went ahead and created index.html with VI and it worked fine, any ideas as to what it could be?
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2675
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post February 3rd, 2010, 12:44 pm

Typically you want the served content to be the instance owner; like the instance is run as say 'webserver' then each file needs to be owned by that user. Also when you chmod a dir you have to inherit the mod with a -R flag.

The command "man chmod" is your friend. Also, NEVER make your content 777. ;)
Moderator Remark: Clarified "man chmod"
"It's always a long day, 86,400 won't fit into a short."
  • Francisck
  • Newbie
  • Newbie
  • User avatar
  • Joined: Mar 22, 2008
  • Posts: 9
  • Status: Offline

Post February 3rd, 2010, 11:20 pm

how could I make it so each file is owned by the person running as lets say "server". I know how to use chmod and I already messed with the file permissions, what would you like me to chmod the folders to? I currently have them to 755, should I change that?

P.S: This is not on a live webserver, so any suggestions would be appreciated.

Best Regards,
Francisco
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2675
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post February 4th, 2010, 2:18 pm

What do you run httpd as? webinst? Then change ownership of files to webinst.

chown is the command. Am I missing your question?
"It's always a long day, 86,400 won't fit into a short."
  • this213
  • Guru
  • Guru
  • User avatar
  • Joined: Mar 01, 2004
  • Posts: 1242
  • Loc: ./
  • Status: Offline

Post April 17th, 2010, 10:59 am

If the webserver user owns the files, then the webserver user has the rights given to the owner of the file. It's far better to have these owned by a different user and just set permissions so the web server can access them with group or public permissions.

did you install php-common?

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 111 guests
  • 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 post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.