LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-19-2006, 06:06 PM   #1
HelplessNewbie
LQ Newbie
 
Registered: Aug 2004
Distribution: Ubuntu 6.10
Posts: 11

Rep: Reputation: 0
Apache 403 Forbidden


I am an almost complete Linux newbie trying to set up Apache to work. Out of the box, I added an index.html to /var/www/html, and everything worked fine. However, to get vsftpd to work, I've relocated the document root to /home/web-docs and created a new index.html. Now I only get a 403 Forbidden message. However, when I go to my web site root address, I get the Apache server testing page, so I know the server is up and running.

Any suggestions are appreciated.
 
Old 05-19-2006, 06:38 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
Are you running with SELinix in enforcing (getenforce will tell you)? If so, then you need to set the correct attributes on the document root and files:

Code:
chcon -R system_u:object_r:httpd_sys_content_t /home/web-docs
 
Old 05-19-2006, 11:01 PM   #3
HelplessNewbie
LQ Newbie
 
Registered: Aug 2004
Distribution: Ubuntu 6.10
Posts: 11

Original Poster
Rep: Reputation: 0
Hi macemoneta. Thanks for your help. If I create the cgi, etc. folders in /home/web-docs, will I need to run this command again? Thanks in advance.
 
Old 05-20-2006, 12:12 AM   #4
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
The subdirectories and files created in the directory after the chcon will inherit the type attribute. You can see this with the "-Z' option of ls. For example:

ls -dZ /home/web-docs
ls -Z /home/web-docs/somefile

The default locations are set to the correct context when the packages are installed. If you relocate them, you need to note the original context and apply it to the new location. It's pretty much a one-time thing at the time the directory/file is created. This is how SELinux knows what functions are permitted on a file or directory.

There's a good document here.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache: 403 forbidden johnty01 Linux - Networking 5 04-05-2008 03:20 PM
apache 403 forbidden munchkins Linux - Software 1 12-25-2005 08:10 AM
apache 403 forbidden? wezhousheng Linux - Networking 5 05-13-2005 01:15 AM
Apache 403 Forbidden mrmike Linux - Newbie 3 07-10-2004 12:31 PM
Apache 403 Forbidden quozt Linux - Networking 10 02-24-2004 05:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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