Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 8th February 2011, 06:38 PM
sepoto Offline
Registered User
 
Join Date: Dec 2010
Posts: 174
linuxfirefox
Exclamation Problem with Apache permissions acting up.

I have a file called askthedatesaver.png. When I open my browser to http://localhost/askthedatesaver.png I get a permission denied. Here are the permissions of all the files. I see no reason for this permission denied error.

Code:
[root@localhost conf]# cd /var/www/html
[root@localhost html]# ls -la
total 628
drwxr-xr-x. 2 root     root   4096 Oct 27 03:04 .
drwxr-xr-x. 6 root     root   4096 Feb  8 10:33 ..
-rwxrwxrwx. 1 joecamel root   1308 Feb  8 10:14 about.jpg
-rwxrwxrwx. 1 joecamel root   1234 Feb  8 10:05 archives.jpg
-rwxrwxrwx. 1 joecamel root   9064 Feb  8 10:20 askthedatesaver.png
-rwxrwxrwx. 1 joecamel root 234858 Feb  7 22:32 background.png
-rwxrwxrwx. 1 joecamel root   3005 Feb  7 22:15 clickme.png
-rwxrwxrwx. 1 joecamel root   1426 Feb  8 10:10 community.jpg
-rwxrwxrwx. 1 joecamel root   1093 Feb  8 10:13 contents.jpg
-rwxrwxrwx. 1 joecamel root  31123 Feb  7 19:17 cupidiscrazy.png
-rwxrwxrwx. 1 joecamel root   3184 Feb  7 22:34 filletrec.png
-rwxrwxrwx. 1 joecamel root   1942 Feb  8 10:18 index.html
-rwxrwxrwx. 1 joecamel root 276517 Feb  7 22:21 manandwoman.png
-rwxrwxrwx. 1 joecamel root   5134 Feb  7 19:22 manshead.gif
-rwxrwxrwx. 1 joecamel root   1210 Feb  8 10:02 news.jpg
-rwxrwxrwx. 1 joecamel root   1204 Feb  8 10:12 search.jpg
-rwxrwxrwx. 1 joecamel root  23877 Feb  8 09:55 toc.png
-rwxrwxrwx. 1 joecamel root   1772 Feb  8 10:09 viewervids.jpg
[root@localhost html]#
Thank you.
Reply With Quote
  #2  
Old 8th February 2011, 06:44 PM
pete_1967 Offline
Clueless in a Cuckooland
 
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 3,929
linuxfedorafirefox
Re: Problem with Apache permissions acting up.

Do 'ls -lZ' to same directory. If you have SELinux enabled, you need to label the files to correct context. To avoid relabelling them. copy the files instead of moving them into the server dirs.

In addition,. the root:root permissions are set by default for a very good reason: security, and another thing, never chmod anything to 777 unless absolutely necessary, things like images should be 644 at most.
__________________
A Drink is Not Just For Christmas - SaskyCom :thumb:


“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime” so now go and...
RTFM FIRST: http://docs.fedoraproject.org/ & http://rute.2038bug.com/index.html.gz
Reply With Quote
  #3  
Old 8th February 2011, 06:47 PM
sepoto Offline
Registered User
 
Join Date: Dec 2010
Posts: 174
linuxfedorafirefox
Re: Problem with Apache permissions acting up.

This is what I see the problem is is that I'm not sure how to repair it.

Code:
[root@localhost html]# ls -lZ
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 about.jpg
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 archives.jpg
-rwxrwxrwx. joecamel root unconfined_u:object_r:user_home_t:s0 askthedatesaver.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 background.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 clickme.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 community.jpg
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 contents.jpg
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 cupidiscrazy.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 filletrec.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 index.html
-rwxrwxrwx. joecamel root unconfined_u:object_r:user_home_t:s0 manandwoman.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:user_home_t:s0 manshead.gif
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 news.jpg
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 search.jpg
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 toc.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 viewervids.jpg
[root@localhost html]#
Reply With Quote
  #4  
Old 8th February 2011, 10:16 PM
pete_1967 Offline
Clueless in a Cuckooland
 
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 3,929
linuxfedorafirefox
Re: Problem with Apache permissions acting up.

Quote:
Originally Posted by sepoto View Post
This is what I see the problem is is that I'm not sure how to repair it.

Code:
[root@localhost html]# ls -lZ
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 about.jpg
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 archives.jpg
-rwxrwxrwx. joecamel root unconfined_u:object_r:user_home_t:s0 askthedatesaver.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 background.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 clickme.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 community.jpg
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 contents.jpg
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 cupidiscrazy.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 filletrec.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 index.html
-rwxrwxrwx. joecamel root unconfined_u:object_r:user_home_t:s0 manandwoman.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:user_home_t:s0 manshead.gif
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 news.jpg
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 search.jpg
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 toc.png
-rwxrwxrwx. joecamel root unconfined_u:object_r:httpd_sys_content_t:s0 viewervids.jpg
[root@localhost html]#
And there is your problem, files with "unconfined_u:object_r:user_home_t:s0" are wrongly labelled. How to fix it: install SELinux Troubleshooter and read the error messages it gives you, then start reading Fedora manuals on the project site.
__________________
A Drink is Not Just For Christmas - SaskyCom :thumb:


“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime” so now go and...
RTFM FIRST: http://docs.fedoraproject.org/ & http://rute.2038bug.com/index.html.gz
Reply With Quote
  #5  
Old 8th February 2011, 10:43 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,110
linuxfedorafirefox
Re: Problem with Apache permissions acting up.

If the files are intended to be read only, they can be set using

chcon -R -t httpd_sys_content_t <files/directories>

Making thing world writable is just asking to be hacked.
Reply With Quote
Reply

Tags
acting, apache, permissions, problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FC10 apache server is acting strange after update madapaka Servers & Networking 2 23rd August 2009 07:43 PM
Apache acting weird? exutable Servers & Networking 1 29th October 2007 04:26 AM
apache fc3 questions: starting apache & file permissions mexicoshanty Servers & Networking 2 16th June 2005 07:56 AM


Current GMT-time: 08:47 (Sunday, 26-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat