Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=781160819-27112003><FONT face=Arial size=2>(1) &amp; (2) 
SetHandler &amp; 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>&nbsp;</DIV>
<DIV><SPAN class=781160819-27112003><FONT face=Arial size=2>(3) 
ScriptInterpreterSource&nbsp;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>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=781160819-27112003><FONT face=Arial><BR><FONT 
size=2>#------------------------------------------------------------<BR># 
CGI-script<BR>#------------------------------------------------------------<BR>&lt;Location 
/SmoothieRedirected/cgi-bin&gt;<BR>&nbsp;SetHandler 
cgi-script<BR>&lt;/Location&gt;</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>AddHandler cgi-script cgi</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>ScriptInterpreterSource registry</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</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>&nbsp;</P><FONT face="Times New Roman">
<P><FONT size=2>print "Content-type: text/html\n\n </FONT></P>
<P><FONT size=2>&lt;HEAD&gt; </FONT></P>
<P><FONT size=2>&lt;TITLE&gt;Simple HTML Example&lt;/TITLE&gt; </FONT></P>
<P><FONT size=2>&lt;/HEAD&gt; </FONT></P>
<P><FONT size=2></FONT>&nbsp;</P>
<P><FONT size=2>&lt;BODY&gt; </FONT></P>
<P><FONT size=2>&lt;HR&gt; </FONT></P>
<P><FONT size=2>&lt;H1&gt;Hello, this is my first CGI script!&lt;/H1&gt; 
</FONT></P>
<P><FONT size=2>&lt;HR&gt; </FONT></P>
<P><FONT size=2>&lt;/BODY&gt; "; </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˛&nbsp;</FONT></B> <FONT 
face="Arial Narrow" color=#000000 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT>&nbsp;<FONT 
face="Arial Narrow" color=#000000 size=2></FONT> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR><FONT face=Arial color=#000000 
size=2>Software Development&nbsp;&nbsp;&nbsp; Tel: 
+353-21-4281689&nbsp;&nbsp;&nbsp; </FONT><BR><FONT face=Arial color=#000000 
size=2>Cork, Ireland.&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C3B51D.B9287E27--