CGI with Apache under Windows 2000
[1/4] from: rebol665::ifrance::com at: 23-Apr-2002 14:01
Hi List,
I am testing a little cgi script with Apache. This script is already tested
and running fine under Windows 98 and Personal Web Server. Any help would be
greatly appreciated :
(1) The script
(2) The /conf/srm.conf file
(3) The error.log
Patrick
(1) The script
8<--------------------------------------------------------------------------
--------
REBOL []
print "Content-Type: text/html^/^/"
print [
<HTML>
<TITLE>"CGI with Rebol"</TITLE>
<BODY>
<H1>"Hello CGI-World!"</H1>
</BODY>
</HTML>
]
8<--------------------------------------------------------------------------
--------
(2) The /conf/srm.conf file
8<--------------------------------------------------------------------------
--------
# REBOL section
ScriptAlias /cgi-bin/ "C:/Apache/cgi-bin/"
AddType application/x-httpd-cgi .r
8<--------------------------------------------------------------------------
--------
(3) The error.log
8<--------------------------------------------------------------------------
--------
[Tue Apr 23 13:51:44 2002] [error] [client 127.0.0.1]
c:/apache/cgi-bin/hw-cgi.r is not executable; ensure interpreted scripts
have "#!" first line
[Tue Apr 23 13:51:44 2002] [error] [client 127.0.0.1] (2)No such file or
directory: couldn't spawn child process: c:/apache/cgi-bin/hw-cgi.r
8<--------------------------------------------------------------------------
[2/4] from: joel:neely:fedex at: 23-Apr-2002 8:44
Hi, Pat,
pat665 wrote:
> (1) The script
> 8<--------------------------------------------------------------------------
<<quoted lines omitted: 9>>
> </HTML>
> ]
...
> (3) The error.log
> 8<--------------------------------------------------------------------------
<<quoted lines omitted: 6>>
> 8<--------------------------------------------------------------------------
> --------
What happens if you add the line
8<----------
#!pathtorebolinterpreter
8<----------
at the beginning of the cgi script (with suitable substitution)?
-jn-
[3/4] from: petr:krenzelok:trz:cz at: 23-Apr-2002 15:22
pat665 wrote:
You have to configure Apache in httpd.conf file. Put something like
following at the end of file:
<Directory "/home/rebol/public_html/cgi-bin"> ; your real OS path to
cgi-bin directory ....
Options ExecCGI
AllowOverride None
order allow,deny
allow from all
</Directory>
Then put your script inside above specified cgi-bin directory and make
sure you have following put on the first line of the script:
example script:
-------------
#! C:/rebol/command/rebolcmd.exe --cgi
REBOL []
print "Content-type: text/html^/^/"
print "OK"
------------
let your scripts have .cgi suffix, unless you allowed .r to be treated
as cgi scripts too ...
-pekr-
[4/4] from: rebol665:ifrance at: 23-Apr-2002 18:41
Hi Petr and Joel,
I have just added this line to my script, and it works so far.
#! d:/rebview/rebol.exe --cgi
I thought this kind of thing were only needed for linux and other unix like
system. My script is still a .r (not a .cgi), however I have tested with the
.cgi extension, and it is ok too.
Strange too, I have removed these two lines from srm.conf and it still works
fine.
ScriptAlias /cgi-bin/ "C:/Apache/cgi-bin/"
AddType application/x-httpd-cgi .r
However, my script is pretty basic and may be I will have to restore some of
these. In case, I will keep your answer close. Thanks again.
Patrick
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted