LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 01-17-2011, 04:42 PM   #1
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Rep: Reputation: 53
403 Forbidden Error (permissions)


Hi. I'm running Apache on CentOS 5.5 as a newbie. When I point my browser to "http://localhost/index.html," which exists in /var/www/html/ and has permission set at 755 I get the error, "Forbidden You don't have permission to access /index.html on this server." I've tried this logged in as a normal user and as root.

When I try to access this page from another PC using the number following "inet addr:" as returned by the command, "ifconfig eth0," as the IP, I get the same error message, except that it lists the IP Address, not "localhost."

The error log includes errors for a client with the IP Address that I used except the last part of the address is different. Not sure how to procede from here. Any help will be appreciated.

Last edited by bluegospel; 01-17-2011 at 04:46 PM. Reason: detail
 
Old 01-17-2011, 05:15 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

The DocumentRoot directory should have 755 permissions. For the files 644 is enough. So try
Code:
chmod 755 /var/www/html
and see if it works.
 
Old 01-17-2011, 06:52 PM   #3
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Original Poster
Rep: Reputation: 53
Thanks, I tried that, but it still fails.
 
Old 01-18-2011, 12:29 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi

As you're running Centos, it's most probably SELinux that prevents apache to serve the page. The installation of apache should have taken care of the correct permissions on /var/www/html, but you can run:
Code:
restorecon -Rv /var/www/html
If that doesn't work, post the output of:
Code:
ls -ldZ /var/www/html
ls -lZ /var/www/html
and more details on how you've installed apache

Regards
 
1 members found this post helpful.
Old 01-18-2011, 08:18 AM   #5
geovg
Member
 
Registered: Mar 2010
Posts: 40

Rep: Reputation: 1
have you checked the error logs for any error messages?
 
Old 01-18-2011, 11:14 AM   #6
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Original Poster
Rep: Reputation: 53
Thanks bathory. That did it. Thanks for your effort geovg.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
403 forbidden error in Centos5 Ericxx Linux - Server 4 09-01-2010 09:21 AM
403 forbidden error with apache2 shifter Linux - Networking 1 01-20-2010 02:56 PM
403 Forbidden error was encountered pilot11 Linux - Newbie 7 10-18-2006 11:28 AM
HTTP 403 (Forbidden) error lothario Fedora 6 02-08-2005 04:43 AM
apache 403 error forbidden? bulliver Linux - General 4 01-31-2003 07:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:07 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration