Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Problem with directory path checking

by mahira (Acolyte)
on Jan 11, 2012 at 18:05 UTC ( [id://947398]=note: print w/replies, xml ) Need Help??


in reply to Re: Problem with directory path checking
in thread Problem with directory path checking

Yes "apache" (the user of the web server) is a member of the directories owner group.

Replies are listed 'Best First'.
Re^3: Problem with directory path checking
by MidLifeXis (Monsignor) on Jan 11, 2012 at 18:21 UTC

    How about /home/bla/public_html/blabla and /home/bla/public_html? Also, group membership does not mean that the user will have proper permissions. See also if there are ACL entries and what the group permissions are on each of the directories.

    Are CGI scripts running with suEXEC permissions to a different user?

    It might help to diagnose this if you were to show us what the process entry looks like for the script that is misbehaving, what the directory entries between /home/blah and /home/blah/public_html/blabla look like, and anything else that may be pertinent. With what you have provided, the best we can do is like throwing darts at a target while being blindfolded.

    --MidLifeXis

      Thanks for pointing me to suexec. I am not very sure if I did the right thing but disabling suexec (renaming it and restart the server) seems to solve the problem :))
Re^3: Problem with directory path checking ($!)
by tye (Sage) on Jan 12, 2012 at 05:35 UTC

    Note that permissions on all of the ancestor directories also matter.

    To aid in diagnosing the problem, you might want to do something like the following:

    my $dir = '/home/bla­/public_ht­ml/blabla'­; my $isDir = -d $dir; if( $isDir ) { print "Found directory: $dir\n"; } elsif( defined $isDir ) { print "Found non-directory: $dir\n"; } else { print "Can't stat($dir): $!\n"; }

    That way you can distinguish between "permission denied" vs "no such file/dir" vs something more exotic. The next step narrows down the source of the problem:

    use File::Basename 'dirname'; my $dir = '/home/bla­/public_ht­ml/blabla'­; my $isDir; while( ! defined $isDir ) { my $isDir = -d $dir; if( $isDir ) { print "Found directory: $dir\n"; } elsif( defined $isDir ) { print "Found non-directory: $dir\n"; } else { print "Can't stat($dir): $!\n"; } last if '/' eq $dir; $dir = dirname( $dir ); }

    - tye        

      I have a question, is 0xAD part of your $dir?

      I see

      00000030: 62 6C 61 AD 2F 70 75 62 - 6C 69 63 5F 68 74 AD 6D |bla /publ +ic_ht m|

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://947398]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-03-19 03:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found