Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: permissions...

by seattlejohn (Deacon)
on Dec 21, 2002 at 07:45 UTC ( [id://221600]=note: print w/replies, xml ) Need Help??


in reply to permissions...

Since you can run the script in the main /cgi-bin directory, I assume you haven't made mistakes like uploading as binary instead of ASCII, ignoring case-sensitivite filenames, or anything like that.

Do you have access to your server error logs? That might be the easiest way to get an idea what's going wrong.

If not, I would start by trying to figure out whether the problem is indeed in your server config/permissions or somewhere in your script. (Seems unlikely that the script would fail simply because you changed directories, but without code I can't be sure what assumptions your program might make.) Anyway, you could write an extremely trivial cgi script -- like "hello, world" -- and see if you can get that to run within a directory under cgi-bin. If so, you could put use CGI::Carp qw(fatalsToBrowser) near the beginning of your script and probably get a better idea where the failure is occurring.

I suppose it's possible that Apache is configured to execute scripts only within cgi-bin, though if that's the case I'm surprised that you would've been able to use this technique in the past.

        $perlmonks{seattlejohn} = 'John Clyman';

Replies are listed 'Best First'.
Re: Re: permissions...
by tachyon (Chancellor) on Dec 21, 2002 at 12:13 UTC

    I suppose it's possible that Apache is configured to execute scripts only within cgi-bin,

    More than just possible - This is the default and is set via the ScriptAlias directive (see below)

    though if that's the case I'm surprised that you would've been able to use this technique in the past.

    Lazy administrators can use AddHandler to make any .cgi .pl .foo .bar .baz file executable regardless of where it is in the dir structure but as you can imagine this is not regarded as a *good* ie secure way of doing business

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: Re: permissions...
by Anonymous Monk on Dec 21, 2002 at 08:02 UTC
    Thanks for the quick reply John! I tried running a different script (a basic date and time script). Worked fine in root dir of cgi-bin.

    Then tried running with SSI. Worked fine. Put it into a directory in the bin called "sdf" and tried to access with SSI. Got this error:
    Sat Dec 21 01:56:37 2002 error client 24.226.53.114 unable to include "/cgi-bin/sdf/datetime.pl" in parsed file /home/httpd/vhosts/robj.ca/httpdocs/test/index.shtml

    and this error when I tried to browse to datetime.pl in the sdf directory:
    Sat Dec 21 01:56:53 2002 error client 24.226.53.114 Premature end of script headers: /home/httpd/vhosts/robj.ca/cgi-bin/sdf/datetime.pl

    I think it is probably that scripts can only be run in the root dir of the bin?...

    script works fine: http://www.robj.ca/cgi-bin/datetime.pl
      Can Apache even be configured to do this? If so, why would it be an option to do so? I would hate to have 500+ files in one directory!!

      By the way, here is my dog: http://www.robj.ca/brae/
        Just stupid question.
        Do you have correct access mode for the folder? Can Apache access the files in the folder?

        -- Yuriy Syrota

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-28 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found