[Xitami] Linux 2.4.19 + Perl 5.7.0 & CGI
Rajesh Deshpande
xitami@lists.xitami.org
Sun, 25 Aug 2002 13:43:31 +0530
This is a multi-part message in MIME format.
------=_NextPartTM-000-ae8fa2b4-7418-4dd0-b80a-4e94838e2c52
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0029_01C24C3D.662DF880"
------=_NextPart_000_0029_01C24C3D.662DF880
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Recently I downloaded & installed Xitami Webserver on my Linux =
2.4.19/KDE 3.0 (reiserFS) machine.
I am trying out CGI scripts but always get :
Error 500 : internal error=20
can not create CGI process - program not found.
My setup is as follows:
HTML dir : /mnt/hdc1/webpages
Cgi-bin dir : /mnt/hdc1/cgi-bin
(Both directories on WIN95 (vfat) partitions)
My web pages are getting loaded perfectly. But CGI scripts gives error =
500.
Xitami documentation/FAQ says that error 500 is mostly because of wrong =
header or syntax error.
Following is the script "server_info.cgi" in cgi-bin directory, I am =
trying to execute:
#----------------------------------------------
#!/usr/bin/perl
use strict;
use CGI;
print <<END_OF_HTML;
Content-type: text/html
<HTML>
<HEAD>
<TITLE>About This Server</TITLE>
</HEAD>
<BODY>
<H1>Server Information</H1>
<HR>
<PRE>
Server Name : $ENV{SERVER_NAME}
Listening on port : $ENV{SERVER_PORT}
Server Software : $ENV{SERVER_SOFTWARE}
Server Protocol : $ENV{SERVER_PROTOCOL}
CGI Version : $ENV{GATEWAY_INTERFACE}
</PRE>
<HR>
</BODY>
</HTML>
END_OF_HTML
#-----------------------------------------------
I have perl 5.7.0 (perl+base+devel+.....many more libs) installed on my =
system and /usr/bin is where perl can be found.
I have enabled CGI and SSI on my server and made my scripts executable =
using chmod.
I could compiled my script using
#perl -wcT server_info.cgi
which gave "syntax OK" message.
The so called magic first line "#!perl" also does not work. It simply =
lists the contents of the file.
I tried to rename the script with .pl extension to overcome the problem =
but with no result.
Also tried to set filters for .cgi and .pl extensions with perl but that =
too did not work.
Xitami's "testcgi?" programs work OK, but they all seem to be C =
programs, not perl scripts.
Do I have to install any other perl libs specific to CGI on my system or =
I have missed out any settings?
I would appreciate If anybody can help me out in getting started with =
CGI.
Thanks & Regards,
Rajesh Deshpande.
------=_NextPart_000_0029_01C24C3D.662DF880
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4807.2300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Recently I downloaded & installed =
Xitami=20
Webserver on my Linux 2.4.19/KDE 3.0 (reiserFS) machine.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I am trying out CGI scripts but always =
get=20
:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><STRONG><FONT face=3DArial size=3D2>Error 500 : </FONT><FONT =
face=3DArial=20
size=3D2>internal error </FONT></STRONG></DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>can not create CGI process - =
program not=20
found.</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><U>My setup is as =
follows</U>:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3DArial size=3D2>HTML dir :=20
/mnt/hdc1/webpages</DIV>
<DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2>Cgi-bin dir :=20
/mnt/hdc1/cgi-bin</FONT></FONT></FONT><FONT face=3DArial=20
size=3D2></FONT></DIV></DIV></DIV>
<DIV><FONT face=3DArial size=3D2>(Both directories on WIN95=20
(vfat) partitions)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>My web pages are getting loaded =
perfectly. But CGI=20
scripts gives error 500.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Xitami documentation/FAQ says that =
error 500 is=20
mostly because of wrong header or syntax error.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Following is the script =
"server_info.cgi" in=20
cgi-bin directory, I am trying to execute:</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>#----------------------------------------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>#!/usr/bin/perl</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>use strict;<BR>use CGI;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>print =
<<END_OF_HTML;<BR>Content-type:=20
text/html</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial =
size=3D2><HTML><BR><HEAD><BR> =20
<TITLE>About This=20
Server</TITLE><BR></HEAD><BR><BODY><BR> &nbs=
p;=20
<H1>Server Information</H1><BR> =20
<HR><BR> <PRE><BR> =
Server=20
Name :=20
$ENV{SERVER_NAME}<BR> Listening on port :=20
$ENV{SERVER_PORT}<BR> Server Software :=20
$ENV{SERVER_SOFTWARE}<BR> Server Protocol =
:=20
$ENV{SERVER_PROTOCOL}<BR> CGI=20
Version :=20
$ENV{GATEWAY_INTERFACE}<BR> =
</PRE><BR> =20
<HR><BR></BODY><BR></HTML><BR>END_OF_HTML<BR>#---------=
--------------------------------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I have perl 5.7.0 =
(perl+base+devel+.....many more=20
libs) installed on my system and </FONT><FONT face=3DArial =
size=3D2>/usr/bin is=20
where perl can be found.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I have enabled CGI and SSI on my server =
and made my=20
scripts executable using chmod.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I could compiled my script =
using</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>#perl -wcT server_info.cgi</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>which gave "syntax OK" =
message.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>The so called magic first line =
"#!perl" also=20
does not work. It simply lists the contents of the file.</FONT></DIV>
<DIV>I tried to rename the script with .pl extension to overcome =
the=20
problem but with no result.</FONT></DIV></DIV>
<DIV><FONT face=3DArial size=3D2>Also tried to set filters for .cgi and =
.pl=20
extensions with perl but that too did not work.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Xitami's "testcgi?" programs work OK, =
but they all=20
seem to be C programs, not perl scripts.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Do I have to install any other perl =
libs specific=20
to CGI on my system or I have missed out any settings?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I would appreciate If anybody can help =
me out in=20
getting started with CGI.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks & Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Rajesh =
Deshpande.<BR></FONT></DIV></BODY></HTML>
------=_NextPart_000_0029_01C24C3D.662DF880--
------=_NextPartTM-000-ae8fa2b4-7418-4dd0-b80a-4e94838e2c52--