Solved

Apache and 403 forbidden error

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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

747 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

12 Experts available now in Live!

Get 1:1 Help Now