httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen Boyle <>
Subject Re: Enabling CGI on Apache 1.3.23
Date Fri, 03 May 2002 08:45:26 GMT
Eric Estes -=RCN Mail=- wrote:
> This is what I put in my httpd.conf file and then restarted httpd:
> *********************************************************************
> ScriptAlias /cgi-bin/ /var/www/cgi-bin/
> <Directory "/var/www/cgi-bin/">
> AllowOverride None
> Options Includes ExecCGI MultiViews FollowSymLinks
> Order allow,deny
> Allow from all
> </Directory>

This looks OK...  

> This is what shows up in my error log:
> ***************************************
> [Fri May  3 03:30:09 2002] [error] (2)No such file or directory: exec of
> /var/www/cgi-bin/ failed

This is a system-level error but the message can be confusing - at first
glance it looks like /var/www/cgi-bin/ cannot be found - but I
bet you're certain it does exist. What the message is really saying is
that /usr/bin/perl cannot be found. That is, it loads the program then
tries to load the interpreter defined by the shebang line - but can't
find it. Read on...

> [Fri May  3 03:30:09 2002] [error] [client] Premature end of
> script headers: /var/www/cgi-bin/

This is the usual consequent error whenever anything goes wrong in CGI.

> This is a copy of the file I'm trying to run:
> **********************************************************
> #!/usr/bin/perl
> # -- my first perl script!
> print "Content-type: text/html\n\n";
> print <<"EOF";
> <HTML>
> <HEAD>
> <TITLE>Hello, world!</TITLE>
> </HEAD>
> <BODY>
> <H1>Hello, world!</H1>
> </BODY>
> </HTML>

Looks OK... Is perl really in /usr/bin/perl? Do "/usr/bin/perl -v" to

> The script works fine when run from shell 

Whoa! This is the acid-test. If it runs from the shell, then the shell
must be able to locate /usr/bin/perl. How come that the apache process
which loads it cannot? Are you really sure you are running
/var/www/cgi-bin/ in your login shell and not a copy?

Try this even simpler script (don't forget to make it executable and
test it from the command line):

	echo "Content-type: text/html\n\n"
	echo "Hello world"

If apache can't find /bin/sh then your in real trouble. If this works,
double-double check the location of perl. There is something funny about
your perl installation.


Owen Boyle.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message