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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bluedogsd
    New Member
    • Jun 2007
    • 2

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

    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.
    Code:
    .. if($_REQUEST['submit']){
    	$handle = fopen($_SERVER['DOCUMENT_ROOT']."/testfile.txt","w+");
    	fputs($handle,"test this out");
    	fclose($handle);
    }
    ..
    http://2point0media.co m/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
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    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.

    Comment

    • bluedogsd
      New Member
      • Jun 2007
      • 2

      #3
      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!!!!!!

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        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.

        Comment

        Working...