The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script Execution Issue

Discussion in 'General Discussion' started by Marty, Jul 26, 2004.

  1. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    I ran into this problem yesterday. First, we do not run suexec on our servers. I know many think this is odd, but it is our preference and we have never had difficulties without it.

    We have two servers that I am going to compare here.

    On server 1, you can run cgi scripts with either the .pl or the .cgi extension in the scgi-bin of any account without problems.

    On server 2, you can run cgi scripts with the .cgi extension, but the .pl extension will create a 500 internal server error every time.

    These are both cpanel servers, server 1 is RH 7.3 and server 2 is RH 9. I have checked permissions and ownership and all is the same.

    Actually, I can put a my.pl on server 2 in the scgi-bin and it will 500 error, but if I simply rename the file my.cgi, it will work perfectly.

    I have tried to search the httpd.conf files on each server for differences related to script aliases, etc, but can find no differences.

    Anybody have any suggestions as to what would cause this difference in behaviour?
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    A couple possibilities I can think of. First, in your httpd.conf files, do they both contain the same following line?

    AddHandler cgi-script .cgi .pl

    Second, any chance the scripts are being uploaded from a different ftp program that may be uploading .pl's to server 2 in binary format?

    Have you tried adding:

    use CGI::Carp qw(fatalsToBrowser);

    to the scripts to see if that tells you anything?
     
  3. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    Yes, that exists on both servers. That was the first thing I checked.

    No, that is not possible. I uploaded it to server two as .pl and it produced a 500 error. I ssh'd in and did a

    mv my.pl my.cgi

    and it worked fine with the cgi extension.

    No, I haven't tried that. I will have to give that a whirl. If you have any other ideas, I will be glad to hear it.
     
  4. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    Tried it and got the same 500 errors as before. Not a thing new.
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    What errors do you get in /etc/httpd/logs/error_log when you browse to it as a .pl script?
     
  6. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    [Tue Jul 27 06:46:28 2004] [error] [client *.*.*.*] Premature end of script headers: /usr/local/cpanel/cgi-sys/scgiwrap
     
Loading...

Share This Page