Don't include any spaces in the content-type line:
print "Content-type:text/html\n\n";
(I hope it's not that simple.)
-----Original Message-----
From: y perl [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 5:02 PM
To: [EMAIL PROTECTED]
Subject: INTALL: Netscape server config confusion
hello,
I am using Netscape Enterprise Server 3.5.1 (Windows
NT) on an NT workstation, and I'm having trouble
configuring it for perl and cgi. I have the latest
build of perl from Activestate (version 5.6.0, build
623). Scripts are working at the command prompt, but
not through the browser. I'm getting server errors.
I have sifted through faq's, Netscape's online
documentation, and this list's archives to hone down
my problem. Now I'm just confused about the details.
Please take a look and see if I'm missing something
here. This is a long message but it includes a lot of
straight facts about my NT and server settings.
As far as I can tell, the entire server is configured
for cgi.
In the web-based server administration utility, there
is a setting called "CGI as a file type" which
"activates CGI as a file type" for the "entire
server". [I don't know which lines in the obj.conf
file pertain to this particular setting.]
When I try to run a file from the configured "CGI
Directory" (which is by the way below the main site's
root; meaning, it's among the site's files at
resources/lib/web), from the browser window, I get
this kind of error in my server's error logs:
failure: for host 55.5.55.555 trying to GET
/resources/lib/web/calendar.pl, send-cgi reports:
could not send new process (File Not Found Error)
The file was there. I tried renaming the file to
calendar.cgi and got the same error.
I also enabled a shell-CGI directory for the server, a
folder called "shellCGI" which is placed at the same
level as the site's main document folder (root of the
site), with a path set up so that when I type
"www.myserver/shellCGI/myperl.pl" in the browser
window, it's mapped to the shellCGI folder.
When I run a script from that folder at the cmd
prompt, I get the output I want. When I try to run it
from the browser window, I get this kind of error in
the server's error log:
failure: for host 55.5.55.555 trying to GET
/shellCGI/calendar.pl, cgi-parse-output reports: the
CGI program D:\Perl\bin\Perl.exe did not produce a
valid header (program terminated without a valid CGI
header (check for core dump or other abnormal
termination)
I found older posts with people getting this latter
error message but no one solved the problem publicly.
Ultimately, I am trying to get Matt Kruse's calendar
script to work, but I get the same error using this
example script (example.pl):
print "Content-Type text/html\n\n";
$|=1;
print "Hello from ActivePerl!";
This script doesn't work through the browser in the
shell-CGI or CGI-directories, nor do several
variations of the script. Namely, I tried:
-Having a first shebang-type path line even though I'm
not using switches so it shouldn't matter with the NT
(am I wrong in my thinking?)
#!/perl/bin/ <--[If it does make a difference, is
this what the path should be if the path to perl.exe
is d:\Perl\bin\perl.exe and the path to this script is
d:\Program
Files\Netscape\SuiteSpot\shellCGI\example.pl ?]
-Trying use CGI::Carp qw(fatalsToBrowser); at least
two lines below the content-type line
-Trying print "Content-Type: text/html\r\n\r\n";
(added the \r's)
-Trying print "Content-type: text/html\n\n"; (small
"t" in "type")
-Trying print "Content_type: text/html\n\n";
(underscore)
By the way I don't know where I'm supposed to see the
errors by using the $|=1 line or the use CGI::Carp
line. All I see in the browser is the server error
messages (in both Netscape and IE). When I run the
scripts at the cmd prompt I seem to be getting the
expected output.
(For example, with the calendar script I directed the
output of the script to a file called calendar.txt at
the cmd prompt and looked at calendar.txt through the
browser--the calendar is there, and the additional
scripts try to work from there...So I know i'm getting
output that's at least part of what I want).
Finally, here are some settings that might be helpful
to know.
REGISTRY:
MyComputer\HKEY_CLASSES_ROOT\.cgi --is--
"cgi_auto_file"
MyComputer\HKEY_CLASSES_ROOT\cgi_auto_file\shell\open\command
--is-- "d:\Program
Files\Netscape\SuiteSpot\install\perl.exe %1"
(This last one WAS "C:\WINNT\System32\NOTEPAD.EXE %1"
and I changed it to the above since all perl scripts
on the web were opening with notepad and some Netscape
documentation at
http://help.netscape.com/kb/corporate/19971210-1.html
suggested the change.)
That particular perl.exe file in the "install" folder
is a copy of the one in D:\perl\bin\ .... I don't get
it. SHould this be set up this way?
MIME.TYPES file for the server:
There are these lines:
type=application/octet-stream exts=bin,exe
type=application/x-perl exts=pl
type=magnus-internal/cgi exts=cgi,bat
[I moved the "exe" from the last line to the first one
upon the suggestion of Netscape documentation at the
URL
http://help.netscape.com/kb/corporate/19960513-100.html]
OBJ.CONF file for the server:
There are these lines:
Init fn="init-cgi"
LD_LIBRARY_PATH="/Perl/lib;/Perl/site/lib"
NameTrans fn="pfx2dir" from="/shellCGI"
dir="d:/PROGRA~1/Netscape/SUITES~1/shellCGI"
name="shellcgi"
NameTrans fn="pfx2dir" from="/cgi-bin"
dir="d:/PROGRA~1/Netscape/SUITES~1/cgi-bin" name="cgi"
Service fn="send-cgi" type="magnus-internal/cgi"
Service fn="send-shellcgi" type="magnus-internal/cgi"
<Object name="cgi">
ObjectType fn="force-type" type="magnus-internal/cgi"
Service fn="send-cgi"
</Object>
<Object name="shellcgi">
ObjectType fn="force-type"
type="magnus-internal/shellcgi"
Service fn="send-shellcgi"
</Object>
I thought that in this NT environment I could put perl
and cgi scripts anywhere, not just in a designated
directory like a "shell-CGI" folder or a "cgi-bin."
So while I've been trying to implement these I'm
confused as to why it's necessary. Is it that the NT
box can run the files as long as I've associated the
file extensions .pl and .cgi with the application
perl.exe--but that the _server_ needs the designated
directories?
Thank you for any help you can give me. I've tried to
solve this problem myself, but now I could really use
another pair of eyes. Or lots of them. :)
yelena
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
