Help with a 403 forbiden error

  • Francisck
  • Newbie
  • Newbie
  • User avatar
  • Posts: 9

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

It was only php files?
  • Francisck
  • Newbie
  • Newbie
  • User avatar
  • Posts: 9

Post 3+ Months Ago

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
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

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"
  • Francisck
  • Newbie
  • Newbie
  • User avatar
  • Posts: 9

Post 3+ Months Ago

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
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

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

chown is the command. Am I missing your question?
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

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 32 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
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.