Link to home
Start Free TrialLog in
Avatar of digital_00
digital_00

asked on

Apache and 403 forbidden error

After installing apache with rh6 i can see the default page... however i can not get to a user's directory... i created a public_html directory with the correct permissions... however if i try to get to it <address>/~username/index.html (or whatever) i get 403 forbidden errors...is there something i have to do?
Avatar of jyu_88
jyu_88

webserver defaults to run as user 'nobody' in 'nobody' group (apache/redhat). This special user has to be able to read whatever file you want to show on the web.

The default RedHat permision will not allow it. So, you will need to do the following:
# to allow folks other than yourself and folks in your group to go down your home dir
chmod 701 /home/digital_100
# to allow folks other than yourself and folks in your group to go down your publc_html folder/dir
chmod 701 /home/digital_100/public_html
# to allow folks other than yourself and folks in your group to read index.html
chmod 604 /home/digital_100/public_html/index.html

To apply this kind of permission change for all other stuffs in public_html to rwx-----x for directory and rw----r-- for files:
find ~/public_html -type f -exec chmod 604 {} \;
find ~/public_html -type d -exec chmod 701 {} \;
ASKER CERTIFIED SOLUTION
Avatar of philiph_elvis
philiph_elvis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
After installing Redhat 6.2, I was left with a httpd.conf file containing the following entry:

<Files ~>
AllowOverride AuthConfig FileInfo Indexes Limit Options
Order allow,deny
Deny from all
</Files>

In this case, the forbidden 403 error occurred regardless of file protections. Removing these lines from the httpd.conf solved the problem, of course.

Now, how did these lines get in the conf file to begin with?