Solved

Apache and 403 forbidden error

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

912 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now