Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2001
    Location
    Indiana
    Posts
    421

    500 error in CGI-BIN Directory....very strange

    Ok....scenario:

    test.pl script:

    #!/usr/bin/perl

    print "Content-type: text/html\n\n";

    print "Hello";
    I upload that in my public_html folder, change permissions....it works.

    I upload that in my cgi-bin folder, change permissions....it works

    I upload that into my clients public_html folder, change permissions....it works.

    I upload that into my clients cgi-bin folder, change permissions....it DOESN'T work.

    The error log show premature end of script headers. Now, it gets even more strange....all 4 of those scripts work via shell, even client's version of test.pl in the cgi-bin.

    Frontpage extensions are installed on this client's account, but the cgi-bin directory works on another account that has frontpage on it, so I'm not sure what the problem is. I run a CPanel/WHM server, if that makes a difference.

    Oh, and I've also tried the FIX INSECURE PERMISSIONS in WHM, and it still won't work.

    Anyone have ANY ideas?

    All help is appreciated!

    Thanks.
    "Last year, some resourceful software enthusiasts cracked Sony Music's proprietary technology simply by scribbling around the edges of the disc with a Magic Marker pen, thus enabling playback on any device." - news.com

  2. #2
    Join Date
    Jun 2001
    Posts
    596
    hmm try adding the -- after the first line.

    #!/usr/bin/perl --

    sure is strange though.
    But then again, you can always go into your httpd.conf and take a look if the clients folder of that particular site is aliased correctly for executing scripts, or see if it is even there.

  3. #3
    Join Date
    Apr 2002
    Location
    USA
    Posts
    5,779

    Sounds like q

    the httpd:conf is not aliased correctly for that domain or that there is a htaccess file somewhere in the cgi folder keeping it form running scripts.

  4. #4
    Join Date
    Aug 2001
    Location
    Indiana
    Posts
    421
    There was a .htaccess file in there that I put in there to try and get it to work. It had "AddHandler cgi-script .cgi .pl" in it to try and get .cgi to be recognized. I did remove it and it still doesn't work.

    I also checked out the httpd.conf file and it seems to be just like all the others.

    Any other ideas? or anything really specific that I should be looking for? I had something like this before on this same account. No Perl script would work in ANY folder, but I downloaded all the files, deleted the account, and recreated it, and they work in the public_html folder now.....they just don't in the cgi-bin.

    Thanks.
    "Last year, some resourceful software enthusiasts cracked Sony Music's proprietary technology simply by scribbling around the edges of the disc with a Magic Marker pen, thus enabling playback on any device." - news.com

  5. #5
    Join Date
    Aug 2001
    Posts
    615
    Open the file via the command line and save it. Sometimes when transfering the file through FTP it may be sent as binary instead of ASCII. If you still get the errors remove the cgi-bin and see if that works after putting it back. Sometimes Ive seen this problem and removing the folder and then readding it helps.

  6. #6
    Join Date
    Aug 2001
    Location
    Indiana
    Posts
    421
    I uploaded it in ASCII mode, and it didn't work. I editted it via command line and saved it, and it didn't work.

    I just deleted the entire cgi-bin folder and reuploaded everything, and it STILL doesn't work.

    I've been a Perl programmer for about 4 years now, and this is the strangest thing I've ever seen.
    "Last year, some resourceful software enthusiasts cracked Sony Music's proprietary technology simply by scribbling around the edges of the disc with a Magic Marker pen, thus enabling playback on any device." - news.com

  7. #7
    Join Date
    Aug 2001
    Posts
    615
    Troy,
    I think this happens sometimes with CPANEL. I would suggest if you are the admin to remove the account and then readd it. It should work then. Let us know.

  8. #8
    Join Date
    Dec 2001
    Location
    Ponchatoula, LA
    Posts
    497
    Are you running SuExec? Do the user and group of the script match the user and group of the client?

    Richard
    Enigma Hosting
    "I wasn't speeding, I was qualifying!"

  9. #9
    Join Date
    Nov 2001
    Location
    London
    Posts
    4,856
    Check that group settings are consistent with those of your client.

    Also check the perms of the CGI-BIN in question, it's possible they could have got messed up, which would produce those errors if you're using suexec.

    Do other scripts run in the CGI-BIN?
    Matthew Russell | Namecheap
    Twitter: @mattdrussell

    www.namecheap.com - hosting from a registrar DONE RIGHT!

  10. #10
    Join Date
    Apr 2001
    Location
    Depok, Indonesia
    Posts
    988
    That's probably caused by suexec, if you are using it. Check the suexec log file for more information. Or, if your suexec doesn't log anything, recompile one from Apache source to use a log file. It is a lot easier for debugging if you have your suexec logs somewhere.

Posting Permissions

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