CGI with Apache on Win2k

Rich Mooney tech at paynesparkman.com
Fri Jul 19 09:02:01 EDT 2002


I've solved some of my own problems.  It appears that my CGI file that was
hosed up.  Problem #1 was the path in the first line of my CGI file - it
needed to start with "C:".  Problem number 2 was I needed 2 headers.  Here's
my corrected CGI file:

#! C:/Program Files/Apache Group/Apache2/cgi-bin/mc
on startup
    put "Your CGI script worked." into buffer
    put "Content-type: text/plain" &cr
    put "Content-Length:" && the length of buffer &cr &cr
    put buffer &cr
end startup

I also tried using only the Content-type header then putting "Your CGI
script worked again." directly but, that didn't work either.  I've still got
problems with some computers accessing the CGI and others not but, I'm
pretty sure that has to do with my Apache configuration.

Rich Mooney
Payne Sparkman Mfg.
shop at paynesparkman.com
----- Original Message -----
From: "shop" <shop at paynesparkman.com>
To: "MetaCard Mail List" <metacard at lists.runrev.com>
Sent: Wednesday, July 17, 2002 5:06 PM
Subject: CGI with Apache on Win2k


> I've just started experimenting with a CGI under Apache 2.0.39 on Win2k.
>
> Here's my CGI file called test.cgi:
> #!/cgi-bin/mc (also tried #!mc)
> on startup
>     put "Your CGI script worked."
> end startup
>
> Here's pertinent stuff from my httpd.conf file:
> ServerRoot "C:/Program Files/Apache Group/Apache2"
>
> ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"
>
> <Directory "C:/Program Files/Apache Group/Apache2/cgi-bin/">
>     AllowOverride None
>     Options All (I tried ExecCGI first)
>     Order allow,deny
>     Allow from all
> </Directory>
>
> AddHandler cgi-script .cgi
>
> I can tell that the server is working because I get the default Apache
page
> when there is no index.html and I am now able to bring up the index.html I
> added.
> Here's the error I get:
>
> Server error!
>   Error message:
>   couldn't create child process: 22503: C:/Program Files/Apache
> Group/Apache2/cgi-bin/test.cgi
>   If you think this is a server error, please contact the webmaster
> Error 500
>
> I'm tempted to think it's a problem with my path statements since none of
> the unix-oriented instructions show path statements begining with "C:".
> However, if I misspell test.cgi in the address bar of my browser, I get
> Object Not Found.  If my path statements were wrong I would expect to get
> the Object Not Found error regardless of how I spelled my url.  The only
> other suspect I can come up with is permissions.  I've seen a number of
> references to this being a problem, but I'm finding it difficult to map
the
> unix oriented directions to Win2k.  Besides, if this is the problem,
> shouldn't I get an error which says I don't have permission to access that
> file?  I also tried adding the tools and home stacks to the cgi-bin folder
> wiht no luck.  Any suggestions? Andu (thanks for your earlier help by the
> way)?
>
> Rich Mooney
> Payne Sparkman Mfg.
> shop at paynesparkman.com
>
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard





More information about the metacard mailing list