serambin has asked for the wisdom of the Perl Monks concerning the following question:

Pax vobiscum:

I'm on a new Apache server and having trouble getting any CGI / Perl scripts to run. I've tried diagnostics, but do not get any return. When I try to run a simple script, I get this return:

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@ladatahost.com 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.26 Server at www.ladatahost.com Port 80

Permissions for directories and files are set to 755.

Has anyone run into this?

Stan
http://ladatahost.com

Replies are listed 'Best First'.
Re: Internal server error
by zigdon (Deacon) on Sep 03, 2002 at 19:26 UTC
    Did you look in the apache error log and see what information was there? Often a 500 error will be caused by a compile-time error, or a failure to print HTTP headers as the first output of the script.

    I'm sorry, but I'm not sure anyone can help more without some more info (like the relevant parts of the error log)

    -- Dan

      Here are the results of two attempts.

      [Tue Sep 3 15:16:24 2002] [error] [client 66.19.141.133] File does no +t exist: /home/lhost/public_html/500.shtml [Tue Sep 3 15:16:24 2002] [error] [client 66.19.141.133] Premature en +d of script headers: /home/lhost/public_html/scgi-bin/pdesk.cgi [Tue Sep 3 15:08:48 2002] [error] [client 66.19.141.133] File does no +t exist: /home/lhost/public_html/500.shtml [Tue Sep 3 15:08:48 2002] [error] [client 66.19.141.133] Premature en +d of script headers: /home/lhost/public_html/scgi-bin/pdesk.cgi

      Perhaps this will help. In any case, thanks in advance.

      Stan

      http://ladatahost.com

      Edit Petruchio Wed Sep 4 04:10:58 UTC 2002 - Added markup

        'Premature end of script headers' usually means you didn't send the correct headers to display the output in your web browser. Make sure before you print anything out that you have a line that looks like this:

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

        Alternatively if you are using the CGI module you can use it to print your header:

        print $cgi->header(); # defaults to text/html

        Hope that helps
        Chris

        Lobster Aliens Are attacking the world!
Re: Internal server error
by Snuggle (Friar) on Sep 03, 2002 at 19:41 UTC
    if even siple things do not run I would definately check the httpd.conf file associated with your instance of Apache. I assume that you can see regular HTTP pages so check:
    • Make sure that there is a LoadModule command for cgi if it is a module.
    • make sure you have something like:

      ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

    • or
      #<Directory "/usr/lib/cgi-bin"> # AllowOverride None # Options ExecCGI # Order allow,deny # Allow from all #</Directory>

    Try that to start to be sure that your CGI directory is set right. Otherwise, you're gonna have to do somemore digging.


    Anyway, no drug, not even alcohol, causes the fundamental ills of society. If we're looking for the source of our troubles, we shouldn't test people for drugs, we should test them for stupidity, ignorance, greed and love of power.

    --P. J. O'Rourke
Re: Internal server error
by VSarkiss (Monsignor) on Sep 03, 2002 at 19:42 UTC

    If your server couldn't even find your ErrorDocument, you may have more than one configuration problem.

    Without some additional details, it's impossible to say what's wrong, but I'd suggest searching the monastery for "debug CGI". You'll find very useful information like:

    HTH

Re: Internal server error
by krisahoch (Deacon) on Sep 03, 2002 at 20:54 UTC

    Stan,

    I can help you with Perl Desk, but you need to tell me where it is installed to.

    Kristofer A. Hoch