LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-11-2007, 05:54 PM   #1
Amuro-Ray2020
Member
 
Registered: Aug 2004
Location: Arizona
Distribution: Linux Mint
Posts: 81

Rep: Reputation: 15
httpd 403 forbidden index.html question


I'm probably going to feel stupid after I hear the answer to this, but here goes. I'm trying to get httpd to host a website. I have my index.html in the /var/www/html directory, and httpd starts up fine. However, when I put "localhost" into a browser, it gives me the Apache sample website. So, I type in localhost/index.html, and I get 403 forbidden. Upon viewing the error_log for httpd, I see that index.html does not have the appropriate permissions on it.

Code:
[Mon Jul 09 19:44:52 2007] [error] [client 172.31.1.6] (13)Permission denied: access to /index.html denied
Code:
[root@localhost html]# ll
total 32
lrwxrwxrwx 1 apache users   10 2007-07-09 19:06 CCNA1 -> CCNA1v4.0/
drwxrwxrwx 8 apache users 4096 2007-07-09 19:06 CCNA1v4.0
lrwxrwxrwx 1 apache users   10 2007-07-09 19:08 CCNA2 -> CCNA2v4.0/
drwxrwxrwx 8 apache users 4096 2007-07-09 19:11 CCNA2v4.0
-rwxrwxrwx 1 apache users  191 2007-07-09 19:18 index.html
I have changed nothing in the httpd.conf. The index.html file points to other index.html files in the CCNA1v4.0 and CCNA2v4.0 directories. Don't know if that matters.
 
Old 07-11-2007, 07:00 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Do you have SELinux enabled? If so, you need to set the security context if you move a file (as opposed to copying it):

Code:
chcon system_u:object_r:httpd_sys_content_t /var/www/html/index.html
Alternatively you can restore the proper context to any files that need it with:

Code:
restorecon -v -r /var/www/html/
 
  


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 on /~user/ index.php wisdom Linux - Software 10 11-17-2006 06:38 PM
403 You don't have permission to access /index.html on this server. xpucto Linux - Networking 6 06-06-2006 09:19 AM
Vqadmin.cgi, 403 Forbidden Erros, and httpd.conf woe opioid Linux - Software 3 05-11-2004 08:08 AM
403 forbidden access on httpd service roguecoolman Linux - Newbie 1 09-23-2003 05:08 PM

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

All times are GMT -5. The time now is 06:16 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