Perl cgi on Windows 2003 Server fails

  • Thread starter Hallvard ?strem
  • Start date
H

Hallvard ?strem

My well tested Perl CGI scripts will not run on my web server after
moving it from Windows NT 4.0 to a brand new Windows 2003 Server. The
web server software is FirstClass Server 7.1 from Open Text Corp.
(http://www.opentext.com/products/firstclass/), and the web server
setup is identical with the setup on NT, which should be OK. Perl
version on Windows 2003 Server is 5.806. Here are some of my
observations:

1. Scripts are running OK from the command prompt on the server, and
the Perl installation looks OK. I've been through the more classical
Perl for win32 pitfalls checks.

2. Client browser returns this message:
---
1.1 200 OK Server: FirstClass/7.1 Content-type: text/html Don't know
how to run /cgi-bin/example.pl
---
(Example.pl is a simple "Hello World" demo which runs OK from the
prompt -- and normally on any web server with CGI-capabillity.)

3. Compiled CGI scripts, e.g. EXE-files, runs OK on the server.

4. Checked out the system PATH environment variable, and it points at
C:\Perl\bin like it should.

5. Web server service is set up with the Local System user account,
and should have the proper access rights.

6. I've installed an Apache test server in order to rule out the
possibility that the problem somehow could be related to my FirstClass
Server setup. The symptoms were almost identical, allthough Apache
returned an not specified "Internal Server Error" message. Compiled
CGI ran OK on Apache as well.

In other words, there must be something in the Windows 2003 Server
setup that I've missed? It seems like FirstClass Server can't find the
Perl interpreter, even though the system PATH is OK. I've been through
loads of FAQs and documentation, but haven't come across a solution so
far. So I'll appreciate a helping hand on this.

Regards,
Hallvard Østrem
 
K

Kevin Collins

Hallvard ?strem said:
My well tested Perl CGI scripts will not run on my web server after
moving it from Windows NT 4.0 to a brand new Windows 2003 Server. The
web server software is FirstClass Server 7.1 from Open Text Corp.
(http://www.opentext.com/products/firstclass/), and the web server
setup is identical with the setup on NT, which should be OK. Perl
version on Windows 2003 Server is 5.806. Here are some of my
observations:

1. Scripts are running OK from the command prompt on the server, and
the Perl installation looks OK. I've been through the more classical
Perl for win32 pitfalls checks.

2. Client browser returns this message:
---
1.1 200 OK Server: FirstClass/7.1 Content-type: text/html Don't know
how to run /cgi-bin/example.pl
---
(Example.pl is a simple "Hello World" demo which runs OK from the
prompt -- and normally on any web server with CGI-capabillity.)

3. Compiled CGI scripts, e.g. EXE-files, runs OK on the server.

4. Checked out the system PATH environment variable, and it points at
C:\Perl\bin like it should.

5. Web server service is set up with the Local System user account,
and should have the proper access rights.

6. I've installed an Apache test server in order to rule out the
possibility that the problem somehow could be related to my FirstClass
Server setup. The symptoms were almost identical, allthough Apache
returned an not specified "Internal Server Error" message. Compiled
CGI ran OK on Apache as well.

In other words, there must be something in the Windows 2003 Server
setup that I've missed? It seems like FirstClass Server can't find the
Perl interpreter, even though the system PATH is OK. I've been through
loads of FAQs and documentation, but haven't come across a solution so
far. So I'll appreciate a helping hand on this.

Regards,
Hallvard Østrem

I would suspect that the ".pl" file extension is not set system-wide, or you
possibly need to define a "handler" (Apache term) for .pl files.

Kevin
 
H

Hallvard ?strem

Thanks for your help, Kevin. The problem persists even if the server
application runs as the current user, that is a user who can execute
perl scripts from the DOS prompt.

FirstClass CGI setup is quite simple and doesn't require any
configuration other than the cgi-bin folder being installed in the
appropriate folder on the file system. The script should execute as
long as it finds the file in the cgi-bin path, and it does if it is
e.g. a precompiled script.

Since my server setup worked just fine on Windows NT, I'm quite sure
my problem must be related to Perl/Windows 2003 Server somehow. Since
Perl works fine from the prompt, I also believe it to be more likely
related to the Windows 2003 Server setup, but how is still a mystery
to me. I'm out of ideas...

Hallvard
 
B

Ben Morrow

Quoth (e-mail address removed) (Hallvard ?strem):
Thanks for your help, Kevin. The problem persists even if the server
application runs as the current user, that is a user who can execute
perl scripts from the DOS prompt.

FirstClass CGI setup is quite simple and doesn't require any
configuration other than the cgi-bin folder being installed in the
appropriate folder on the file system. The script should execute as
long as it finds the file in the cgi-bin path, and it does if it is
e.g. a precompiled script.

Since my server setup worked just fine on Windows NT, I'm quite sure
my problem must be related to Perl/Windows 2003 Server somehow. Since
Perl works fine from the prompt, I also believe it to be more likely
related to the Windows 2003 Server setup, but how is still a mystery
to me. I'm out of ideas...

What happens if you create a file script.pl and double-click on it? Does
it run with perl, or not? You haven't yet indicated that it does.

Ben
 
E

Eric Stanfield

Have you checked the Web Security extensions (think that is the correct
lingo) in IIS on your 2003 server? Out of the box, the latest IIS is very
gimped as far as what it will let execute. Look in the IIS manager, on the
left side it is listed there then the options of what to allow/disallow are
shown in the right pane.

Hallvard ?strem said:
Thanks for your help, Kevin. The problem persists even if the server
application runs as the current user, that is a user who can execute
perl scripts from the DOS prompt.

FirstClass CGI setup is quite simple and doesn't require any
configuration other than the cgi-bin folder being installed in the
appropriate folder on the file system. The script should execute as
long as it finds the file in the cgi-bin path, and it does if it is
e.g. a precompiled script.

Since my server setup worked just fine on Windows NT, I'm quite sure
my problem must be related to Perl/Windows 2003 Server somehow. Since
Perl works fine from the prompt, I also believe it to be more likely
related to the Windows 2003 Server setup, but how is still a mystery
to me. I'm out of ideas...

Hallvard


(e-mail address removed) (Kevin Collins) wrote in message
 
C

ChrisO

Hallvard said:
Thanks for your help, Kevin. The problem persists even if the server
application runs as the current user, that is a user who can execute
perl scripts from the DOS prompt.

FirstClass CGI setup is quite simple and doesn't require any
configuration other than the cgi-bin folder being installed in the
appropriate folder on the file system. The script should execute as
long as it finds the file in the cgi-bin path, and it does if it is
e.g. a precompiled script.

Since my server setup worked just fine on Windows NT, I'm quite sure
my problem must be related to Perl/Windows 2003 Server somehow. Since
Perl works fine from the prompt, I also believe it to be more likely
related to the Windows 2003 Server setup, but how is still a mystery
to me. I'm out of ideas...

Hallvard

I, for one, would be a little curious as to which Perl you are running
as well. The symptoms you've described don't directly implicate the
version of Perl, but I'm curious nonetheless. The version you specified
doesn't sound like ActiveState Perl which I consider to be the de facto
standard in the Windows world. Your Perl of course wouldn't *have* to
be ASPN in order to work, hence my curiosity.

-ceo
 
H

Hallvard ?strem

Perl version is ActiveState 5.8.0 for Win32.

*.pl files execute just fine from the prompt or by clicking in
Windows. In other words, system path and file associations should be
OK.

IIS is not installed on the server at all, as long as I'm not
intending to use it. My FirstClass Server provides SMTP and POP3 as
well as web services, and it should not depend on Windows IIS -- if
that's the case, that would be a shame. At least, this was not the
case in Windows NT 4.0 where an identical web server setup has been
delivering CGI for years.

The big question is what could be the difference between NT and 2003
in this respect, when everything else is identical?

I've been wondering a bit about MIME, but have not experienced before
that FCS CGI were depending on MIME definitions (...like in Apache.
Nevertheless, a test installation of Apache shows the same symptoms --
Perl CGI scripts don't run). A few experiments in that direction were
not very successfull either. And again, my MIME configuration didn't
create any problems for CGI scripts on Windows NT.

Anyone having an Apache installation on Windows 2003 Server with a
working Perl CGI setup?
 
C

ChrisO

l said:
If perl is running correctly via command line or explorer then your
problem is not in windows but in your web server configuration.

In reading the online documentation on your behalf:
http://www.firstclass.com/FirstClas...tion/Online Books/Internet Services guide.pdf


page 158 "Adding a CGI script" step 4 "Follow the information contained
in the CGI ReadMe to configure your executable."

I do not have Firstclass so I can not give you the solution.

Or the behavior of FC changed inbetween WNT 4.0 and W2K3... More than
likely, if Perl is acting fine on the command line. That's *my* guess.
Last time I used FC was in 1993, so that's about as well as I can do
with this. I haven't run into very many FC users in a while, so you
(the OP) may be a bit stuck. FC is kinda off the beaten path... :(

-ceo
 
H

Hallvard ?strem

Problem finally solved.

A "ScriptMap" key was missing in the Windows 2003 Server registry, and
a reinstallation of Perl fixed it. Perl was originally installed
BEFORE the FirstClass Server software on the server, and this produced
the situation with this particular registry entry missing.

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\FCS\Parameters\ScriptMap]
".pl"="C:\\Perl\\bin\\perl.exe %s %s"

(FCS=FirstClass Server)

A reinstallation of Perl will get it right.

Thanks for all your help!
Hallvard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top