ASP.NET & cgi

  • Thread starter Thread starter Mark Rae
  • Start date Start date
M

Mark Rae

Hi,

I'm not sure if this is the right newsgroup, but here goes...

I'm trying to integrate the webwho.zip cgi script from the following site:
http://www.webwho.co.uk/ into a standard ASP.NET site, but know nothing at
all about cgi.

Basically, I just want people to type the domain they want to look up into a
textbox, and then click a button to submit the form.

The site says that the script works "straight out of the box" but is also
massively configurable. I'd be happy just to get it working in my site! Can
anyone help?

Best,

Mark Rae
 
its a simple perl script, so it will work on any server which supports perl
scripts. to get to work with asp.net, you will need to install a perl
interpreter.


-- bruce (sqlwork.com)
 
Bruce,
its a simple perl script, so it will work on any server which supports
perl
scripts. to get to work with asp.net, you will need to install a perl
interpreter.

Thanks for the reply - according to my hosting company (www.hostinguk.net),
they have CGI and Perl 5 support, specifically "Perl for Win32 is
ActiveState's port of most of the functionality found in Perl, with the
addition of extra Win32 API specific calls that allow you to take advantage
of Windows specific functionality."

Will that be sufficient?

Also, does IIS 5.1 (WinXP Pro) have the same support for CGI / Perl?

Thanks,

Mark
 
That'll depend on what function does your CGI script use.

ActivePerl is not a full clone of Perl on *nix systems. Some of it's
function will not work correctly(e.g.: file locks) and some doesn't even
ported. You'll have to go to ActiveState's website to check it first.

Once confirmed it's OK, on IIS 5 it's simple. Just set the ASP.NET directory
to enable perl.exe to process .cgi extension files(This should be set when
creating new ADs, but don't know whether it's affect existing ADs.) Then set
the form's "action" property to point to the cgi. In IIS 6 of Win2003,
you'll have to enable Perl first.(Default state of Perl on IIS6 is
prohibited)
 
That'll depend on what function does your CGI script use.

ActivePerl is not a full clone of Perl on *nix systems. Some of it's
function will not work correctly(e.g.: file locks) and some doesn't even
ported. You'll have to go to ActiveState's website to check it first.

I've been told that it will run OK in ActivePerl.
Once confirmed it's OK, on IIS 5 it's simple. Just set the ASP.NET
directory
to enable perl.exe to process .cgi extension files

How do I do that?
(This should be set when creating new ADs, but don't know whether it's
affect existing ADs.)

New ADs? New Active Directories...???
Then set the form's "action" property to point to the cgi.

That's done.
In IIS 6 of Win2003, you'll have to enable Perl first.(Default state of
Perl on IIS6 is
prohibited)

That's fine - my hosting company will do that.
 
Mark Rae said:
I've been told that it will run OK in ActivePerl.
That's good. :)
settings,
How do I do that?
In your IIS management console, right click your website and select
"properties",
then click configure. See if ".cgi" extension exist. If not, create one with
exec path
set to:

C:\Perl\bin\perl.exe "%s" %s

You should actually see that ".pl" have been set automatically. But it won't
touch
the cgi extension as ".cgi" is not necessarily a Perl script.

Not that you have to explicitly declare ActivePerl responsible for handling
".cgi"
in the VD in other to make it work as IIS won't check the
"#C:\Perl\Perl.exe" header
as said by some Perl programming books.
New ADs? New Active Directories...???
Emmm... Sorry, I mean VD actually...
 
In your IIS management console, right click your website and select
"properties",
then click configure. See if ".cgi" extension exist. If not, create one
with exec path
set to:

C:\Perl\bin\perl.exe "%s" %s

You should actually see that ".pl" have been set automatically. But it
won't touch
the cgi extension as ".cgi" is not necessarily a Perl script.

Not that you have to explicitly declare ActivePerl responsible for
handling ".cgi"
in the VD in other to make it work as IIS won't check the
"#C:\Perl\Perl.exe" header
as said by some Perl programming books.

Excellent! It's working now. I'll need to read up on the Perl syntax so that
I can modify the script so that the output looks and feels like the rest of
the site, but at least it's working. Thanks for your help with that.
Emmm... Sorry, I mean VD actually...

I've modified the Default website too, so hopefully any new virtual
directories should "inherit" the configuration.
 
Back
Top