Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[users@httpd] cgi executables on windows
- From: Kerrigan_Martin@xxxxxxx
- Subject: [users@httpd] cgi executables on windows
- Date: Thu, 27 Nov 2003 14:36:16 -0500
------_=_NextPart_001_01C3B51D.B9287E27 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi: =20 I am using apache to run some perl scripts using cgi on Windows 2000. I = am having some trouble and any help would be greatly appreciated. It is = very simple and I performed this on UNIX before but I can't get it to work = on Windows. =20 The scripts are not running. Instead Apache is serving out the contents = of the script and I am literally seing the perl code. =20 I have attempted using 3 different configurations to get it to work = (see config extract below).=20 =20 (1) & (2) SetHandler & AddHandler directives. The script is located in /SmoothieRedirected/cgi-bin and is called = test.pl. I have another file called test.cgi that calls the perl script. When I = run the script from the command line it outputs html as expected. When I = invoke it from a form or directly using a URL, Apache doesn't invoke the = script but just literally serves out the content of test.cgi. I put in SetHandler = and AddHandler directives to attempt to get this to work. =20 (3) ScriptInterpreterSource directive I also tried setting the ScriptInterpreterSource directive to use the regisry and I invoked the perl script directly. Here, I see the perl code. =20 Note: * When I use a bat file, the browser downloads it and runs it in a dos window. * I am using the apache server as both a server and a proxy. I don't see why this should have any impact. =20 #------------------------------------------------------------ # CGI-script #------------------------------------------------------------ <Location /SmoothieRedirected/cgi-bin> SetHandler cgi-script </Location> =20 AddHandler cgi-script cgi =20 ScriptInterpreterSource registry =20 =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D The script is simply: #!C:/Perl/bin/perl.exe=20 =20 print "Content-type: text/html\n\n=20 <HEAD>=20 <TITLE>Simple HTML Example</TITLE>=20 </HEAD>=20 =20 <BODY>=20 <HR>=20 <H1>Hello, this is my first CGI script!</H1>=20 <HR>=20 </BODY> ";=20 ____________________________________________=20 Martin Kerrigan, EMC=B2 = =20 Software Development Tel: +353-21-4281689 =20 Cork, Ireland. e-mail: kerrigan_martin@emc.com=20 ____________________________________________=20 http://www.webmasterworld.com/forum13/3319.htm <http://www.webmasterworld.com/forum13/3319.htm>=20 =20 ------_=_NextPart_001_01C3B51D.B9287E27 Content-Type: text/html; charset="iso-8859-1" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD> <BODY> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2>Hi:</FONT></SPAN></DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2></FONT></SPAN> </DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2>I am using apache to run some perl scripts using cgi on Windows 2000. I am having some trouble and any help would be greatly appreciated. It is very simple and I performed this on UNIX before but I can't get it to work on Windows.</FONT></SPAN></DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2></FONT></SPAN> </DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2>The scripts are not running. Instead Apache is serving out the contents of the script and I am literally seing the perl code.</FONT></SPAN></DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2></FONT></SPAN> </DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2>I have attempted using 3 different configurations to get it to work (see config extract below). </FONT></SPAN></DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2></FONT></SPAN> </DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2>(1) & (2) SetHandler & AddHandler directives.</FONT></SPAN></DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2>The script is located in /SmoothieRedirected/cgi-bin and is called test.pl. I have another file called test.cgi that calls the perl script. When I run the script from the command line it outputs html as expected. When I invoke it from a form or directly using a URL, Apache doesn't invoke the script but just literally serves out the content of test.cgi. I put in SetHandler and AddHandler directives to attempt to get this to work.</FONT></SPAN></DIV> <DIV><SPAN class=781160819-27112003></SPAN><SPAN class=781160819-27112003><FONT face=Arial size=2></FONT></SPAN> </DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2>(3) ScriptInterpreterSource directive</FONT></SPAN></DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2>I also tried setting the ScriptInterpreterSource directive to use the regisry and I invoked the perl script directly.</FONT></SPAN></DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2>Here, I see the perl code.</FONT></SPAN></DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2></FONT></SPAN> </DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2>Note:</FONT></SPAN></DIV> <UL> <LI><SPAN class=781160819-27112003><FONT face=Arial size=2>When I use a bat file, the browser downloads it and runs it in a dos window.</FONT></SPAN></LI> <LI><SPAN class=781160819-27112003><FONT face=Arial size=2>I am using the apache server as both a server and a proxy. I don't see why this should have any impact.</FONT></SPAN></LI></UL> <DIV><SPAN class=781160819-27112003><FONT face=Arial size=2></FONT></SPAN> </DIV> <DIV><SPAN class=781160819-27112003><FONT face=Arial><BR><FONT size=2>#------------------------------------------------------------<BR># CGI-script<BR>#------------------------------------------------------------<BR><Location /SmoothieRedirected/cgi-bin><BR> SetHandler cgi-script<BR></Location></FONT></DIV> <DIV><FONT size=2></FONT> </DIV> <DIV><FONT size=2>AddHandler cgi-script cgi</FONT></DIV> <DIV><FONT size=2></FONT> </DIV> <DIV><FONT size=2>ScriptInterpreterSource registry</FONT></DIV> <DIV><FONT size=2></FONT> </DIV> <DIV><FONT size=2></FONT> </DIV> <DIV><SPAN class=781160819-27112003><FONT size=2>=======================================================</FONT></SPAN></DIV> <DIV><SPAN class=781160819-27112003><FONT size=2>The script is simply:</FONT></SPAN></DIV> <DIV> <P><FONT size=2>#!C:/Perl/bin/perl.exe </FONT></P> <P><FONT size=2></FONT> </P><FONT face="Times New Roman"> <P><FONT size=2>print "Content-type: text/html\n\n </FONT></P> <P><FONT size=2><HEAD> </FONT></P> <P><FONT size=2><TITLE>Simple HTML Example</TITLE> </FONT></P> <P><FONT size=2></HEAD> </FONT></P> <P><FONT size=2></FONT> </P> <P><FONT size=2><BODY> </FONT></P> <P><FONT size=2><HR> </FONT></P> <P><FONT size=2><H1>Hello, this is my first CGI script!</H1> </FONT></P> <P><FONT size=2><HR> </FONT></P> <P><FONT size=2></BODY> "; </FONT></P></FONT></FONT></SPAN></DIV> <P><B><FONT face=Garamond color=#000080 size=2>____________________________________________</FONT></B> <BR><B><FONT face=Garamond color=#000080 size=2>Martin Kerrigan, EMC˛ </FONT></B> <FONT face="Arial Narrow" color=#000000 size=2> </FONT> <FONT face="Arial Narrow" color=#000000 size=2></FONT> <BR><FONT face=Arial color=#000000 size=2>Software Development Tel: +353-21-4281689 </FONT><BR><FONT face=Arial color=#000000 size=2>Cork, Ireland. e-mail: kerrigan_martin@emc.com</FONT> <BR><B><FONT face=Garamond color=#000080 size=2>____________________________________________</FONT></B> </P><STRONG><FONT face=Garamond color=#000080 size=2><A href="http://www.webmasterworld.com/forum13/3319.htm">http://www.webmasterworld.com/forum13/3319.htm</A></FONT></STRONG><BR> <DIV> </DIV></BODY></HTML> ------_=_NextPart_001_01C3B51D.B9287E27--
- Follow-Ups:
- Re: [users@httpd] cgi executables on windows
- From: Michael Scott
- Re: [users@httpd] cgi executables on windows
- Prev by Date: RE: [users@httpd] Multipart/Form-Data
- Next by Date: Re: [users@httpd] Using Apache with dynamic IP address
- Previous by thread: [users@httpd] QUESTION: which one to start first
- Next by thread: Re: [users@httpd] cgi executables on windows
- Index(es):