I have installed Abyss Web Server X1 v2.3.2 and ActivePerl (5.8.8 build 817) with the ISAPI DLL. I am currently trying to run Perl scripts using the ISAPI interface. Here is the relevant bit from abyss.conf (CGI/ISAPI, type is Perl ISAPI):
<interpreter>
<ext>
pl
</ext>
<interface>
0
</interface>
<file>
Z:\pkg\Perl\bin\perlis.dll
</file>
<checkexists>
yes
</checkexists>
<type>
2
</type>
<updatepaths>
no
</updatepaths>
</interpreter>
It seems to insert extra newlines before the script output so the script cannot add the Content-Type header. I tried the following two scripts:
plain.pl:
print "Content-Type: text/plain\r\n\r\nHello!";
test.pl (taking a little from the CGI perldoc)
use CGI qw /:standard/;
print header, start_html('test'), h1('Hello');
This is what I get when trying to access the files from the command line (using the LWP "get" utility)
Z:\>get -ue http://localhost/cgi-bin/plain.pl
GET http://localhost/cgi-bin/plain.pl
Connection: Close
Date: Sat, 28 Oct 2006 14:10:50 GMT
Server: Abyss/2.3.2-X1-Win32 AbyssLib/2.3.2 Abyss/2.3.2-X1-Win32 AbyssLib/2.3.2
Client-Date: Sat, 28 Oct 2006 14:10:50 GMT
Client-Peer: 127.0.0.1:80
Client-Response-Num: 1
Content-Type: text/plain
Hello!
Z:\>get -ue http://localhost/cgi-bin/test.pl
GET http://localhost/cgi-bin/test.pl
Connection: Close
Date: Sat, 28 Oct 2006 14:12:15 GMT
Server: Abyss/2.3.2-X1-Win32 AbyssLib/2.3.2 Abyss/2.3.2-X1-Win32 AbyssLib/2.3.2
Client-Date: Sat, 28 Oct 2006 14:12:15 GMT
Client-Peer: 127.0.0.1:80
Client-Response-Num: 1
Content-Type: text/html; charset=ISO-8859-1
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<h1>Hello</h1>
When I test it in the browser, the "Content-Type" header shows up in the browser display.
I have turned on logging for the ISAPI and this is the contents:
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/plain.pl Request #0 New request
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/plain.pl Request #0 Prefetch-ReadClient() = ""
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/plain.pl Request #0 ServerSupportFunction(dwHSERequest=HSE_REQ_MAP_URL_TO_PATH, lpvBuffer="")
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/plain.pl Request #0 GetServerVariable(szVariableName="SCRIPT_NAME")="/cgi-bin/plain.pl"
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/plain.pl Request #0 GetServerVariable(szVariableName="SERVER_PROTOCOL")="HTTP/1.1"
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/plain.pl Request #0 WriteClient(Buffer="HTTP/1.1 200 OK
", dwSize=17, dwSync=0)
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/plain.pl Request #0 WriteClient(Buffer="Date: Sat, 28 Oct 2006 14:10:50 GMT
", dwSize=37, dwSync=0)
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/plain.pl Request #0 GetServerVariable(szVariableName="SERVER_SOFTWARE")="Abyss/2.3.2-X1-Win32 AbyssLib/2.3.2"
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/plain.pl Request #0 WriteClient(Buffer="Server: Abyss/2.3.2-X1-Win32 AbyssLib/2.3.2
", dwSize=47, dwSync=0)
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/plain.pl Request #0 WriteClient(Buffer="Content-Type: text/plain
Hello!", dwSize=34, dwSync=0)
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/plain.pl Request #0 HttpExtensionProc() = HSE_STATUS_SUCCESS (1) / ecb.dwHttpStatusCode = 200
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 New request
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 Prefetch-ReadClient() = ""
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 ServerSupportFunction(dwHSERequest=HSE_REQ_MAP_URL_TO_PATH, lpvBuffer="")
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 GetServerVariable(szVariableName="SCRIPT_NAME")="/cgi-bin/test.pl"
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 GetServerVariable(szVariableName="SERVER_SOFTWARE")="Abyss/2.3.2-X1-Win32 AbyssLib/2.3.2"
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 GetServerVariable(szVariableName="GATEWAY_INTERFACE")="CGI/1.1"
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 GetServerVariable(szVariableName="SERVER_PROTOCOL")="HTTP/1.1"
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 GetServerVariable(szVariableName="SERVER_PROTOCOL")="HTTP/1.1"
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 WriteClient(Buffer="HTTP/1.1 200 OK
", dwSize=17, dwSync=0)
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 WriteClient(Buffer="Date: Sat, 28 Oct 2006 14:12:15 GMT
", dwSize=37, dwSync=0)
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 GetServerVariable(szVariableName="SERVER_SOFTWARE")="Abyss/2.3.2-X1-Win32 AbyssLib/2.3.2"
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 WriteClient(Buffer="Server: Abyss/2.3.2-X1-Win32 AbyssLib/2.3.2
", dwSize=47, dwSync=0)
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 WriteClient(Buffer="Content-Type: text/html; charset=ISO-8859-1
", dwSize=47, dwSync=0)
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 WriteClient(Buffer="<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
", dwSize=316, dwSync=0)
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 WriteClient(Buffer="<h1>Hello</h1>", dwSize=14, dwSync=0)
Module: Z:\pkg\Perl\bin\perlis.dll URI: /cgi-bin/test.pl Request #1 HttpExtensionProc() = HSE_STATUS_SUCCESS (1) / ecb.dwHttpStatusCode = 200
I think this shows that there are two newlines sent after the "Server:..." header. I have tested these scripts with CGI and they work fine. Is this a problem in my configuration, in Abyss or a in the ActivePerl ISAPI DLL?
Thanks