You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Selmer Ausland <se...@shawcable.com> on 2003/04/11 00:08:56 UTC

[users@httpd] cgi-bin doesn't work in Apache 2.0.45

Hello;
    I need some help getting my Apache 2.0.45 cgi-bin working. I am
running Win NT 4.0 and this is the problem: 

I have a file called first.pl in my Apache 2.0.45 cgi-bin

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World."; 

When I type in the url www.somedomain.com/cgi-bin/first.pl I get an
Internal Server Error. In my error log I get the following:

[Thu Apr 10 16:42:17 2003] [error] [client xx.xx.xxx.xxx] (OS 3)The
system cannot find the path specified.  : couldn't spawn child process:
D:/Apache2/cgi-bin/first.pl

Here is a portion of my httpd.config. It appears to be set up correctly
according to the Apache Tutorial at
http://httpd.apache.org/docs-2.0/howto/cgi.html

#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the
client.
# The same rules about trailing "/" apply to ScriptAlias directives as
to
# Alias.
#
ScriptAlias /cgi-bin/ "D:/Apache2/cgi-bin/"

#
# "D:/Apache2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "D:/Apache2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

This same first.pl script works without problem in an Xitami web server
cgi-bin located on the same NT 4.0 server (using a different port 8080).
So obviously something is screwed up in my Apache config. I have perused
the cgi-bin tutorials on Google etc and I am still unable to figure it
out. I am relatively new to Apache so that doesn't help.

Anyone care to help out with this?

Thanks. Selmer Ausland

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi-bin doesn't work in Apache 2.0.45

Posted by Future Shock Business Solutions <fu...@shaw.ca>.
Well, the obvious here is that you do not have the shebang line pointed to
where the Perl interpreter is. You show a path that is common to *nix
servers. Is /usr/bin/perl the path to your perl interpreter? On WIN systems,
for instance, ActiveState Perl is usually installed in C:/Perl/bin so you
would need to use #!C:?Perl/bin/perl.exe (for a strict path, never mind
about a loose path).

Try that.

--
Eric
Future Shock Business Solutions


----- Original Message -----
From: "Selmer Ausland" <se...@shawcable.com>
To: <us...@httpd.apache.org>
Sent: Thursday, April 10, 2003 5:08 PM
Subject: [users@httpd] cgi-bin doesn't work in Apache 2.0.45


> Hello;
>     I need some help getting my Apache 2.0.45 cgi-bin working. I am
> running Win NT 4.0 and this is the problem:
>
> I have a file called first.pl in my Apache 2.0.45 cgi-bin
>
> #!/usr/bin/perl
> print "Content-type: text/html\n\n";
> print "Hello, World.";
>
> When I type in the url www.somedomain.com/cgi-bin/first.pl I get an
> Internal Server Error. In my error log I get the following:
>
> [Thu Apr 10 16:42:17 2003] [error] [client xx.xx.xxx.xxx] (OS 3)The
> system cannot find the path specified.  : couldn't spawn child process:
> D:/Apache2/cgi-bin/first.pl
>
> Here is a portion of my httpd.config. It appears to be set up correctly
> according to the Apache Tutorial at
> http://httpd.apache.org/docs-2.0/howto/cgi.html
>
> #
> # ScriptAlias: This controls which directories contain server scripts.
> # ScriptAliases are essentially the same as Aliases, except that
> # documents in the realname directory are treated as applications and
> # run by the server when requested rather than as documents sent to the
> client.
> # The same rules about trailing "/" apply to ScriptAlias directives as
> to
> # Alias.
> #
> ScriptAlias /cgi-bin/ "D:/Apache2/cgi-bin/"
>
> #
> # "D:/Apache2/cgi-bin" should be changed to whatever your ScriptAliased
> # CGI directory exists, if you have that configured.
> #
> <Directory "D:/Apache2/cgi-bin">
>     AllowOverride None
>     Options None
>     Order allow,deny
>     Allow from all
> </Directory>
>
> This same first.pl script works without problem in an Xitami web server
> cgi-bin located on the same NT 4.0 server (using a different port 8080).
> So obviously something is screwed up in my Apache config. I have perused
> the cgi-bin tutorials on Google etc and I am still unable to figure it
> out. I am relatively new to Apache so that doesn't help.
>
> Anyone care to help out with this?
>
> Thanks. Selmer Ausland
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---
Outgoing mail is certified Virus Free,
and so I am according to the latest doctor's report!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.470 / Virus Database: 268 - Release Date: 09/04/03


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi-bin doesn't work in Apache 2.0.45

Posted by Selmer Ausland <se...@shawcable.com>.
Future Shock Business Solutions wrote:
> 
> The shebang line is the very first/top line in a perl script.
> It tells in the script where to find the perl interpreter on your system.
> 
> I would try this:
> 
> #!D:/perl/bin/perl.exe
> 
> print "Content-type: text/html\n\n";
> print "Hello, World.";
 
************************************************

Hello Eric;
    cgi-bin now works using the following:

#!D:/perl/bin/perl.exe
print "Content-type: text/html\n\n";
print "Hello, World.";

Thanks very much to you, Joshua and Andre for your help. I should have
picked this up but, blind in one eye, and can't see out of the other I
guess. sheesh. ;- (

Cheers. Selmer

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi-bin doesn't work in Apache 2.0.45

Posted by Future Shock Business Solutions <fu...@shaw.ca>.
The shebang line is the very first/top line in a perl script.
It tells in the script where to find the perl interpreter on your system.

I would try this:

#!D:/perl/bin/perl.exe

print "Content-type: text/html\n\n";
print "Hello, World.";


In going to your web page, I got the Internal Server Error, but in the
server signature I didn't see Perl listed (doesn't necessarily have to be),
which leads me to suspect that you don't have Perl installed but you stated
previously that you do. If the above shebang line does not work, just do a
find file on perl.exe and put that in your shebang line (e.g.,
#!D:/path/to/perl.exe). Also, make sure that that line is at the very top of
the script, with nothing before it.

Keep checking the error logs as you did for the error returned.

Hope that helps.

--
Eric
Future Shock Business Solutions


----- Original Message -----
From: "Selmer Ausland" <se...@shawcable.com>
To: <us...@httpd.apache.org>
Sent: Thursday, April 10, 2003 8:37 PM
Subject: Re: [users@httpd] cgi-bin doesn't work in Apache 2.0.45


>
> Future Shock Business Solutions wrote:
> >
> > Did you check the shebang line as I suggested before?
> >
> > --
> > Eric
> > Future Shock Business Solutions
>
> ---------------------------------------------------------
>
> Hello Erik;
>
> This is the example from the Apache website at
> http://httpd.apache.org/docs-2.0/howto/cgi.html
>
> #!/usr/bin/perl
> print "Content-type: text/html\n\n";
> print "Hello, World.";
>
> As a greenhorn Apache cgi-user, I am not sure what you want me to check.
> #!/usr/bin/perl is the shebang line I presume. This example works fine
> with Xitami cgi-bin and returns Hello, World no joy with Apache
> 2.0.45??? Check it out.
>
> http://www.jkcc.com:8080/cgi-bin/first.pl
> http://www.jkcc.com/cgi-bin/first.pl
>
>
> Can you clarify what you mean please? I am stumped!!
>
> Selmer
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---
Outgoing mail is certified Virus Free,
and so I am according to the latest doctor's report!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.470 / Virus Database: 268 - Release Date: 09/04/03


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi-bin doesn't work in Apache 2.0.45

Posted by Selmer Ausland <se...@shawcable.com>.
Future Shock Business Solutions wrote:
> 
> Did you check the shebang line as I suggested before?
> 
> --
> Eric
> Future Shock Business Solutions

--------------------------------------------------------- 

Hello Erik;

This is the example from the Apache website at
http://httpd.apache.org/docs-2.0/howto/cgi.html

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World.";

As a greenhorn Apache cgi-user, I am not sure what you want me to check.
#!/usr/bin/perl is the shebang line I presume. This example works fine
with Xitami cgi-bin and returns Hello, World no joy with Apache
2.0.45??? Check it out.

http://www.jkcc.com:8080/cgi-bin/first.pl
http://www.jkcc.com/cgi-bin/first.pl


Can you clarify what you mean please? I am stumped!!

Selmer

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi-bin doesn't work in Apache 2.0.45

Posted by Future Shock Business Solutions <fu...@shaw.ca>.
Did you check the shebang line as I suggested before?

--
Eric
Future Shock Business Solutions


----- Original Message -----
From: "Selmer Ausland" <se...@shawcable.com>
To: <us...@httpd.apache.org>
Sent: Thursday, April 10, 2003 7:51 PM
Subject: Re: [users@httpd] cgi-bin doesn't work in Apache 2.0.45


>
>
> Joshua Slive wrote:
> >
> > On Thu, 10 Apr 2003, Selmer Ausland wrote:
> >
> > > Hello;
> > >     I need some help getting my Apache 2.0.45 cgi-bin working. I am
> > > running Win NT 4.0 and this is the problem:
> > >
> > > I have a file called first.pl in my Apache 2.0.45 cgi-bin
> > >
> > > #!/usr/bin/perl
> > > print "Content-type: text/html\n\n";
> > > print "Hello, World.";
> > >
> > > When I type in the url www.somedomain.com/cgi-bin/first.pl I get an
> > > Internal Server Error. In my error log I get the following:
> > >
> > > [Thu Apr 10 16:42:17 2003] [error] [client xx.xx.xxx.xxx] (OS 3)The
> > > system cannot find the path specified.  : couldn't spawn child
process:
> > > D:/Apache2/cgi-bin/first.pl
> >
> > This almost certainly means that apache can't execute perl.  Is perl
> > really located at /usr/bin/perl on the same drive as apache?  Seems
> > unlikely on a unix box.  Try putting in the correct full pathname to
perl.
> >
> > Joshua.
> >
> > ---------------------------------------------------------------------
>
> Hello Joshua;
>    Yes, perl is installed on the same D:/ drive (version 5.8.0.build
> 804). I wonder if I should uninstall it and try a different version???
>
> Can't figure out why it works with Xitami and not Apache 2.0.45???
>
> Selmer
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---
Outgoing mail is certified Virus Free,
and so I am according to the latest doctor's report!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.470 / Virus Database: 268 - Release Date: 09/04/03


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi-bin doesn't work in Apache 2.0.45

Posted by André Malo <nd...@perlig.de>.
* Selmer Ausland wrote:

>    Yes, perl is installed on the same D:/ drive (version 5.8.0.build
> 804). I wonder if I should uninstall it and try a different version???

If you've registered the .pl extension to be executed by perl (which is 
done by default when installing ActivePerl), you may want to use the 
ScriptInterpreterSource directive:
<http://httpd.apache.org/docs-2.0/mod/core.html#scriptinterpretersource>

Alternatively, using

#!perl

as first line should work, too.

> Can't figure out why it works with Xitami and not Apache 2.0.45???

Xitami probably does the same as ScriptInterpreterSource; a registry 
lookup.

HTH, nd
-- 
die (eval q-qq[Just Another Perl Hacker
]
;-)
# André Malo, <http://www.perlig.de/> #

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi-bin doesn't work in Apache 2.0.45

Posted by Selmer Ausland <se...@shawcable.com>.

Joshua Slive wrote:
> 
> On Thu, 10 Apr 2003, Selmer Ausland wrote:
> 
> > Hello;
> >     I need some help getting my Apache 2.0.45 cgi-bin working. I am
> > running Win NT 4.0 and this is the problem:
> >
> > I have a file called first.pl in my Apache 2.0.45 cgi-bin
> >
> > #!/usr/bin/perl
> > print "Content-type: text/html\n\n";
> > print "Hello, World.";
> >
> > When I type in the url www.somedomain.com/cgi-bin/first.pl I get an
> > Internal Server Error. In my error log I get the following:
> >
> > [Thu Apr 10 16:42:17 2003] [error] [client xx.xx.xxx.xxx] (OS 3)The
> > system cannot find the path specified.  : couldn't spawn child process:
> > D:/Apache2/cgi-bin/first.pl
> 
> This almost certainly means that apache can't execute perl.  Is perl
> really located at /usr/bin/perl on the same drive as apache?  Seems
> unlikely on a unix box.  Try putting in the correct full pathname to perl.
> 
> Joshua.
> 
> ---------------------------------------------------------------------

Hello Joshua;
   Yes, perl is installed on the same D:/ drive (version 5.8.0.build
804). I wonder if I should uninstall it and try a different version???

Can't figure out why it works with Xitami and not Apache 2.0.45???

Selmer

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi-bin doesn't work in Apache 2.0.45

Posted by Joshua Slive <jo...@slive.ca>.

On Thu, 10 Apr 2003, Selmer Ausland wrote:

> Hello;
>     I need some help getting my Apache 2.0.45 cgi-bin working. I am
> running Win NT 4.0 and this is the problem:
>
> I have a file called first.pl in my Apache 2.0.45 cgi-bin
>
> #!/usr/bin/perl
> print "Content-type: text/html\n\n";
> print "Hello, World.";
>
> When I type in the url www.somedomain.com/cgi-bin/first.pl I get an
> Internal Server Error. In my error log I get the following:
>
> [Thu Apr 10 16:42:17 2003] [error] [client xx.xx.xxx.xxx] (OS 3)The
> system cannot find the path specified.  : couldn't spawn child process:
> D:/Apache2/cgi-bin/first.pl

This almost certainly means that apache can't execute perl.  Is perl
really located at /usr/bin/perl on the same drive as apache?  Seems
unlikely on a unix box.  Try putting in the correct full pathname to perl.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] cgi-bin doesn't work in Apache 2.0.45

Posted by Wil Hatfield - HVHM Customer Care <wi...@hvhm.net>.
>     I need some help getting my Apache 2.0.45 cgi-bin working. I am
> running Win NT 4.0 and this is the problem: 

Agreed.  :-)

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org