LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 11-19-2009, 04:14 PM   #1
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,421

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Apache - can't fix 403 error


Error:
Code:
Forbidden
 
You don't have permission to access /~support/index.html on this server.
 
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.0.46 (Red Hat) Server at server.example.com Port 80
URL I am trying to hit: http://server.example.com/~support/index.html

This server is behind a restrictive firewall, so even if I gave you the real URL, you couldn't hit it .

Server:
Code:
# cat /etc/*release
Red Hat Enterprise Linux AS release 3 (Taroon Update 9)
# uname -a
Linux server.example.com 2.4.21-32.0.1.EL #1 Tue May 17 18:01:37 EDT 2005 i686 i686 i386 GNU/Linux
# rpm -qa | grep httpd-2
httpd-2.0.46-77.ent
Permissions are fine:
Code:
# ls -ld / /home /home/support /home/support/public_html /home/support/public_html/index.html
drwxr-xr-x   31 root     root         4096 Nov  1 12:11 /
drwxrwxrwx   88 root     root        12288 Oct 29 18:10 /home
drwxrwxr-x   45 support  ip     20480 Nov 19 10:17 /home/support
drwxrwxr-x   35 support  ip     16384 Nov 19 11:32 /home/support/public_html
-rw-rw-r--    1 support  ip     32166 Jun 21  2005 /home/support/public_html/index.html
httpd is running under user apache. If I "su - apache", I am able to read index.html.

I reinstalled apache after moving /etc/httpd out of the way, and the only change I made to the default httpd.conf was to comment out "UserDir disable" and uncomment "UserDir public_html".

DocumentRoot is /var/www/html.

There are no files named .htaccess anywhere in /var/www/html or /home/support.

Adding apache to the ip group (or support to the apache group) changed nothing.

(Temporarily) chmoding 777 / /home /home/support /home/support/public_html and /home/support/public_html/index.html changed nothing.

http://server.example.com/~alucard/ works fine.

The error logs says:
Code:
[Thu Nov 19 16:09:00 2009] [error] [client 1.1.1.1] (13)Permission denied: access to /~support/index.html denied
[Thu Nov 19 16:09:00 2009] [error] [client 1.1.1.1] File does not exist: /var/www/html/favicon.ico, referer: http://inside-wcds.swg.usma.ibm.com/~support/index.html

I'm at a loss as to why I am still getting Forbidden - any more ideas?

Last edited by AlucardZero; 11-19-2009 at 04:18 PM.
 
Old 11-19-2009, 05:18 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 9,207

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
Hi,

Since it's a RHEL server could be a SELinux permissions problem.
 
Old 11-19-2009, 06:09 PM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,421

Original Poster
Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
I don't think RHEL3 comes with SELinux.
 
Old 11-19-2009, 06:16 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Debian, FreeBSD
Posts: 3,559
Blog Entries: 3

Rep: Reputation: Disabled
Anything useful in Apache's error log? (If not, try cranking up to LogLevel debug and try the request again to capture more info.)
 
Old 11-19-2009, 06:18 PM   #5
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,421

Original Poster
Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
When I turn LogLevel to debug, I get the same error in error_log as above.
 
Old 11-19-2009, 06:22 PM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Debian, FreeBSD
Posts: 3,559
Blog Entries: 3

Rep: Reputation: Disabled
Oops. I thought I read it carefully, and I still missed that.

Do you have any <Location> directives in place where you're denying access?

Failing that, I think I'd create a new user account and see if his home directory is accessible. If so, perhaps blow away "support" and recreate from scratch. (May not help, but also should not hurt.)
 
Old 11-20-2009, 10:07 AM   #7
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,421

Original Poster
Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
No uncommented Location directives. Some Directory directives, but they're the default:

Code:
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>


<Directory "/var/www/html">
    Options Indexes FollowSymLinks

    AllowOverride None


    Order allow,deny
    Allow from all
</Directory>

<Directory /home/*/public_html>
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>
Edit: I didn't see this before:
Code:
# mount | grep home
netapp:/vol/vol0/home on /home type nfs (rw,rsize=8192,wsize=8192,intr,nfsvers=3,bg,addr=1.2.2.2)
Does that matter?

Last edited by AlucardZero; 11-20-2009 at 10:11 AM.
 
Old 11-20-2009, 02:27 PM   #8
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,421

Original Poster
Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
The reason was that support's homedir was set to /net/netapp/vol/vol0/home/support, which apache did *not* have access to all the way down the path. I changed the user's homedir to /home/support since it was mounted anyway, and I can hit index.html.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Error 403 - CentOS 5.2 with Apache 2.2.3 gordymann Linux - Newbie 2 04-08-2009 09:57 AM
403 error in Apache watcher69b Linux - Server 3 05-27-2008 09:13 AM
Apache 403 error with Mandrake 10.1 MooCows Linux - Networking 15 03-19-2005 05:50 PM
Apache 403 Error?? jlsain Linux - Software 4 05-08-2004 04:45 PM
apache 403 error fix cortj Linux - Software 0 02-25-2003 04:27 PM


All times are GMT -5. The time now is 10:58 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration