LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-07-2006, 03:55 PM   #1
Madone_SL_5.5
Member
 
Registered: Oct 2006
Location: Ogden, Utah
Distribution: Fedora 10
Posts: 66

Rep: Reputation: 15
Forbidden access to some of my website files.


I've seen this thread posted in here before, but I seem not to be able to find a solution in previous threads.

I have loaded some website files onto my Fedora 6 server via a floppy disk from my windows machine. The files are loaded into /var/www/html/ and into some sub directories from there. When trying to access certain files I receive a 403 Forbidden message telling me that I do not have permission to access this file on this server.

I have set -rwxr-xr-x permissions to all files in that directory and all sub directories therein. I have .swf, .php, .html, and .pdf files in there. Other files of the same format in the same directories load correctly, but a few have forbidden access. The same files are always the culprits. There are several of them giving me this problem, both in the base level directory and the sub directories.

I am running Apache. I have all sorts of index file possibilities configured in httpd.conf.

Any ideas? Thanks.
 
Old 11-08-2006, 05:43 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
Strange thing to me is that you files reside in a subdirectory of /var - aren't they supposed to be in a apache2/htdocs directory?

I suppose the global permissions you have on /var/www/html is world readable?

I've got Apache running here but I compiled and installed it myself, and it resides in

/usr/local/apache

and its .html files are in /htdocs in the above directory. I have a plain vanilla config file for it, and it works just fine.

Any idea why your files reside in /var/www/html and not /htdocs?? I don't if this might be a factor in the problems you are having...
 
Old 11-08-2006, 02:22 PM   #3
Madone_SL_5.5
Member
 
Registered: Oct 2006
Location: Ogden, Utah
Distribution: Fedora 10
Posts: 66

Original Poster
Rep: Reputation: 15
From everything I have seen, /var/www/html/ is the default directory in which website files should reside.

Every web tutorial I have gone over, as well as my Red Hat Linux Bible (which is rather comprehensive) tells me that this is the default directory. I don't even have a directory called "apache2" or "htdocs". Thus, I doubt that this could be a problem.

This is a stock installation.

Am I wrong? Any further ideas?
 
Old 11-08-2006, 04:40 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Do you have SELinux running? This sounds like a similar problem to the one here at http://www.linuxquestions.org/questi...hlight=selinux.
 
Old 11-08-2006, 05:16 PM   #5
Madone_SL_5.5
Member
 
Registered: Oct 2006
Location: Ogden, Utah
Distribution: Fedora 10
Posts: 66

Original Poster
Rep: Reputation: 15
That was my exact problem. Thank you very much for your help.

For anyone else who may have the problem, here was the deal:

Under some SELinux policy, any files moved from one directory to another maintain the properties of that directory from which they were moved, while those copied to a new directory inherit the properties of the new directory to which they are copied. So the thing to do is copy, not move.

In my case, moving the files made my files inaccessible to the web user. Upon copying them freshly to my directory, they were accessible.

Thanks again!
 
  


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
Gambas - Forbidden Access indienick Programming 0 06-26-2006 09:51 PM
Access forbidden to directory mirat46 Linux - Newbie 1 02-07-2006 01:09 PM
Forbidden Access Problems. ivanagrozny SUSE / openSUSE 3 02-06-2006 05:55 PM
forbidden access on files hosted by my mandrake 10.1 linux SeekAndDestroy Linux - Wireless Networking 2 11-09-2005 08:32 PM
Forbidden access to apache server wisdom Linux - Software 2 12-25-2004 09:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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