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
Solved

Apache and 403 forbidden error

Posted on 2000-03-29
3
433 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

840 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