Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 8 of 8

This is a discussion on Perl scripts in main directory? in the Shared & Semi-Dedicated forum
Is there any way to run perl scripts from within my public_html directory? or do they _have_ to be stored in my /cgi-bin directory? Any ...

  1. #1
    JPC Senior Member
    Join Date
    Nov 2003
    Posts
    73

    Perl scripts in main directory?

    Is there any way to run perl scripts from within my public_html directory? or do they _have_ to be stored in my /cgi-bin directory?

    Any work around would be greatly apprciated.

    Thanks
    J. Slime

  2. #2
    Jag Veteran
    Join Date
    Sep 2002
    Posts
    650
    You should be able to run perl scripts from any directory under public_html. Just make sure the script has .pl extension and +x attribute.
    If it doesn't work, please post here the error message and we will take care of you

  3. #3
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    .pl and .cgi extensions should work outside of cgi-bin, actually. But like Gerilya said, if you have trouble we regualrs will be here to help you out.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  4. #4
    JPC Senior Member
    Join Date
    Nov 2003
    Posts
    73
    Originally posted by gerilya
    You should be able to run perl scripts from any directory under public_html. Just make sure the script has .pl extension and +x attribute.
    If it doesn't work, please post here the error message and we will take care of you
    Here's the error message l get:

    The exact script works perfectly find from within my cgi-bin.

    And l've tried naming it both .pl, and .cgi...

    No go with either, l get the same error.
    However l'm unfamiliar with the +X attribute... Is that my problem here?



    Code:
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, webmaster@tdtcoalition.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    
    More information about this error may be available in the server error log.
    
    
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. 
    
    
    --------------------------------------------------------------------------------
    
    Apache/1.3.29 Server at www.tdtcoalition.net Port 80
    Thanks for the help...

    ~JSlime

  5. #5
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    +x means giving the file execute permission. You may know it as chmod 755. Its the same thing you need to do to get the file to execute in the cgi-bin directory. The actual upload/setup process for the cgi-bin and any other directory are identical, so any script you've gotten working in the cgi-bin should work just as well from anywhere else inside public_html, the only exception being that scripts in cgi-bin don't need to end in .pl or .cgi, whereas in any other directory they must.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  6. #6
    Jag Veteran
    Join Date
    Sep 2002
    Posts
    650
    Internal Server Error means that your script was, in fact, executed and generated an error.
    If it works fine when called from cgi-bin directory then the only reason I can think of not to work from any other location is absolute URLs and/or file locations hardcoded inside that script.
    How big is that script anyway? May be it makes sense to post it here, otherwise, I am afraid you are on your own.

  7. #7
    JPC Senior Member
    Join Date
    Nov 2003
    Posts
    73
    Ahhh +X ok l got ya, yeah l've always heard it referred to as "chmoding" the file.. heh sorry, just confused me a bit.

    But anyway, here's a text file of one of the scripts l'm attempting to create in my main directory:

    http://www.tdtcoalition.net/shell.txt

    Roughly that's the script that l'd like to use, however this isn't the only script that l'm having this problem with....

    There's been other's that..work fine in my /cgi-bin however when l try the same script(S) in my /public_html directory l get the same error message.

    Thanks for the help folks,

    ~J. Slime

  8. #8
    Jag Veteran
    Join Date
    Sep 2002
    Posts
    650
    Let me guess... you upload that script to public_html via FTP, right?
    Then try something else:
    1. Get your SSH enabled
    2. Log into your SSH account
    3. copy the file from cgi-bin directory to public_html directory:
    cp cgi-bin/script.pl public_html/
    Let us know how it is going.

    EDITED:
    do not forget to chmod the script after copying:
    chmod 755 public_html/script.pl
    Last edited by gerilya; 11-28-2003 at 10:09 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •