Running Perl scripts with Apache on Win32

Stefano Bargioni bargioni at usc.urbe.it
Thu Mar 30 02:21:05 EST 2000


Luc Grondin <grondin.luc at uqam.ca> wrote:


> Hello!
>
> I am trying to set up an Apache server on my Win98 workstation in order to
> develop and test Perl scripts (before uploading them in production).  For a
> while, I had an OmniHTTPd server running and was able to execute perl
> scripts located in the cgi-bin directory.  However, I decided to use Apache
> for Win32 instead.  It is working fine to serve files located in the htdocs
> directory, but I have no success with scripts located in the cgi-bin.  An
> error 500 is generated.  These are excerpts from the log files:
>
> access.log:
> localhost - - [29/Mar/2000:13:53:25 -0500] "GET /cgi-bin/testip.pl
> HTTP/1.0" 500 595 "http://localhost/res.html" "Mozilla/4.7 [fr] (Win98; U)"
>
> error.log:
> [Wed Mar 29 13:53:24 2000] [error] [client 127.0.0.1] (2)No such file or
> directory: couldn't spawn child process: c:/apache/cgi-bin/testip.pl
>
> In fact, there is a file as indicated in the path above.
>
> There may be something wrong in the httpd.conf.  I have kept it close to
> the way it was generated by the installation process:
>
> #
> ScriptAlias /cgi-bin/ "C:/Apache/cgi-bin/"
> #
> # "C:/Apache/cgi-bin" should be changed to whatever your ScriptAliased
> # CGI directory exists, if you have that configured.
> #
>
>     Order allow,deny
>     Allow from all
>     AllowOverride None
>     Options None
>
>
> I would appreciate it if an Apache wizard could give me some directions.  I
> have looked trough the documentation with no success so far.
>

Luc, 3 ideas to check your installation:
1. can you retrieve files like http://localhost/test.html? If no, add to httpd.conf
a directive of localhost.
2. if you are running a shell like bash or perl, you need the 'shebang' line at the
top of the script to invoke it:
#!shell_path
(from "Apache: the definitive guide" by B. & P. Laurie)
3. may be you need to use (I'm not sure)
ScriptAlias /cgi-bin/ "C:\Apache\cgi-bin\"
instead of
ScriptAlias /cgi-bin/ "C:/Apache/cgi-bin/"

But I suggest you to avoid using Apache on Win32 systems: a lot of problems
(performance and security) could affect you.
Bye. Stefano
--
Dott. Stefano Bargioni
Biblioteca della Pontificia Universita' della Santa Croce - Roma
<mailto:bargioni at usc.urbe.it>                  <http://www.usc.urbe.it>
Personal web page:    <http://www.usc.urbe.it/html/php.script?bargioni>
--- "Si apud bibliothecam hortulum habes, nihil deerit"  (Cicerone) ---




More information about the Web4lib mailing list