[erlang-questions] Cannot get CGI directive on INETS to work

Carl McDade carlmcdade@REDACTED
Sat May 23 18:21:23 CEST 2009


Hi,

Windows XP sp3
Python (python.exe)
MinGW
GNU Bash for Windows (sh.exe)
Erlang R13B


I am running the inets examples and have not had any luck with getting
CGI to work. The exec.shtml parses but the command tag  #exec cgi=""
is not functioning.

exec.shtml:

<HTML>
<HEAD>
<TITLE>/exec.shtml</TITLE>
</HEAD>
<BODY>
<H1>/exec.shtml</H1>
<PRE>
<!--#exec cgi="/cgi-bin/printenv.sh"-->
<!--#exec cgi="/cgi-bin/python.py"-->
</PRE>


</BODY>
</HTML>

python.py:

#!C:/Python30/python.exe -u

print '<html><head>'
print '<title>My Page</title>'
print '</head><body>'
print '<h1>Powers of two</h1>\n<ol>'
for n in range(1,11):
  print '<li>'+str(2**n)+'</li>'
print '</ol></body></html>'

printenv.sh:

#!C:/MinGW/bin/bash

echo "Content-type: text/html"
echo ""
echo "<HTML> <HEAD> <TITLE>OS Environment</TITLE> </HEAD> <BODY><PRE>"
env
echo "</PRE></BODY></HTML>"


inets conf:

ScriptAlias /cgi-bin/ c:/var/tmp/server_root/cgi-bin/

mime.types:

application/x-sh		sh
application/x-python	py


All the other CGI directives (include... etc.) work but exec only
leads to this dead end.

/exec.shtml

[an error occurred while processing this directive]


Has anyone ever gotten this to work? or is there a bug in the system?

-- 
Carl McDade
Content Management Systems Consultant
www.hiveminds.co.uk
________________________



More information about the erlang-questions mailing list