On Sat, 29 Aug 1998, Kjell Midtseter wrote:

> Date: Sat, 29 Aug 1998 07:44:43 +0000
> From: Kjell Midtseter <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Apache abd CGI
> 
> I can not run perl CGI scripts under my Apache server.
> 
> I have the following script called hello.cgi in my CGI-BIN directory:
> #!/usr/bin/perl
> print "hello\n"

It should be :

print "Hello\n";

Do not forget the ;  This is most likely the error. Did you trying running
the script from the shell with `perl -w hello.cgi` ?

> When I run my browser as
> lynx http://localhost/cgi-bin/hello.cgi
> I receive an error message
> 500 Internal server error. The server encountered an internal error or 
>misconfiguration
> and was unable to complete your request.
> 
> I am using RedHat 5.1 and the Apache that came with the distribution (latest 
>version?)
> I have been trying to change the applicable things in the srm.conf file, but
> nothing seems to help.

First of all: Configure Apache to allow cgi scripts to be run and give
your perl scripts the .cgi extension. (like test.cgi).

If you want to see what kind of error the 500 is, do a `tail -f
<directory-to-apache>/logs/error_log` when executing the script. Also make
sure that the file itself is chmod 755.

Karel


   Karel Bemelmans, Narfum Inc.

  [-- Contact --] -->  [EMAIL PROTECTED]
  [-- Website --] -->  http://www.narfum.org

Reply via email to