Connecting Tech Pros Worldwide Help | Site Map

Baffling apache fopen/fputs permissions issue (not the typical question)

Newbie
 
Join Date: Jun 2007
Posts: 2
#1: Jun 13 '07
I have a new server RHE4 and I am having an issue I have never had before and it's kind of urgent.

Running Apache 2.0 I need the web server to have writable access and getting denied - I'm pretty sure my users/groups/permissions/etc are all good.

Apache is running as user apache group ftpusers.
server root for default server is at the top /export/home
chowned to apache and grped to ftpusers recursively.
Even so with permissions -777 on the whole tree I get permission denied. This simple script shows the error - this is a vhost under root in apache but again - the entire tree is currently set to 777 (obviously this will change when I figure out WTF)

This is a very basic script - lives at /export/home/sites/2point0/TPO-IP/html/simpletest.html chmod 777 owner apache group ftpusers.
Expand|Select|Wrap|Line Numbers
  1. .. if($_REQUEST['submit']){
  2.     $handle = fopen($_SERVER['DOCUMENT_ROOT']."/testfile.txt","w+");
  3.     fputs($handle,"test this out");
  4.     fclose($handle);
  5. }
  6. ..
http://2point0media.com/simpletest.html

Warning: fopen(/export/home/sites/2point0/TPO-IP/html/testfile.txt): failed to open stream: Permission denied in /export/home/sites/2point0/TPO-IP/html/simpletest.html on line 2


Thanks to any and all - I searched for a while for a similar situation - mainly the posts are people having users and groups mismatched - helP!
Motoma's Avatar
Moderator
 
Join Date: Jan 2007
Location: Maine, USA
Posts: 2,904
#2: Jun 13 '07

re: Baffling apache fopen/fputs permissions issue (not the typical question)


Do you have SELinux enabled? I am not a big fan of it, it tends to alter the traditional way that Linux deals with security by adding another layer.

Get back and let us know.
Newbie
 
Join Date: Jun 2007
Posts: 2
#3: Jun 13 '07

re: Baffling apache fopen/fputs permissions issue (not the typical question)


Sure enough - it's enabled - I was unfamiliar with that. Turned it of and I am good to go.

I can't thank you enough - seriously - you are my hero right now and I appreciate it beyond explanation! I knew I was about as knowledgable at least as the tier 2 people at my hosting place and they were spinning me in circles.

Thanks for the simple tip that saved my day!!!!!!
Motoma's Avatar
Moderator
 
Join Date: Jan 2007
Location: Maine, USA
Posts: 2,904
#4: Jun 13 '07

re: Baffling apache fopen/fputs permissions issue (not the typical question)


Quote:

Originally Posted by bluedogsd

Sure enough - it's enabled - I was unfamiliar with that. Turned it of and I am good to go.

I can't thank you enough - seriously - you are my hero right now and I appreciate it beyond explanation! I knew I was about as knowledgable at least as the tier 2 people at my hosting place and they were spinning me in circles.

Thanks for the simple tip that saved my day!!!!!!

Hey! Your post made my day! I'm glad you got everything working out. Come back any time you have a problem.
Reply


Similar Apache Web Server bytes