Solved

Apache and 403 forbidden error

Posted on 2000-03-29
3
434 Views
Last Modified: 2011-09-20
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?
0
Comment
Question by:digital_00
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Expert Comment

by:jyu_88
ID: 2667232
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 {} \;
0
 
LVL 1

Accepted Solution

by:
philiph_elvis earned 75 total points
ID: 2667665
jyu_88's answer is essentially correct, so he should proably receive the points.  However, here's a bit cleaner explanation, in my opinion:

Assuming that the web server user is nobody.

# chmod o+x /home/user
# chmod o+rx /home/user/public_html

Note that any files you create in the directory (such as index.html) must also be readable by other.
0
 

Expert Comment

by:prestonc
ID: 2839650
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?
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question