Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strawberry Perl and IIS Seemingly Configured, But 404 Page Received

I have been looking at a few posts on this topic, but I'm still confused. Strawberry Perl and IIS 8 are installed on our Windows 2012 R2 server. I know to add a Strawberry Perl.exe under ISAPI and CGI Restrictions, and finally corrected my mistake (earlier edit of this post) of listing a DL). You can use a .exe, not just a DLL, so I have provided the path to Strawberry Perl's perl.exe. IIS 8 Menu

Edit 2/26/2019: As requested, here is the first part of Select.pl, which is listed in default documents:

#!/usr/local/bin/perl -w
# Permit/Web/Select.pl
# -*- tab-width: 8 -*-

use strict;
use warnings;
use lib qw( ../../include ./include );
use DbArgs;
use DBI;

######################################################################
# Prototypes
#
sub main();
sub HTMLPermitTypeRow($);
sub HTMLPermitClassRow($);
sub jsQuote($);

######################################################################
# Globals
#
my $HTML_ROOT_DIRECTORY     = DbArgs::HTMLRootDirectory();
my $debugging               = 0;

# start with Sunday to align with localtime order 0 to 6
#
my @weekdays                 = qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday);

# work Mon-Fri no holidays
#
my @previousworkdays        = qw(Friday Friday Yesterday Yesterday Yesterday Yesterday Friday);

my %input;

main();
exit(0);

######################################################################
#   main
#
sub main() {
    my $header;
    my $footer;
    my $inspectorsrow;
    my $today;
    my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst )= localtime( );
    my $inspected = $previousworkdays[$wday];

    %input  = DbArgs::ParseArgs();

    print "Content-type: text/html\n\n";

    # define required input
    # not defining optional input inspected, permittype, permitclass, reportformat
    #
    foreach ( qw( address contractor description inspector issue issue_thru owner ) ) {
        $input{$_} = '' unless defined $input{$_};
    }

    my $hiddenfields = '';
    foreach my $fieldname ( sort keys %input ) {
        my %definedFields = ( 'address'     => ''
                    , 'contractor'  => ''
                    , 'description' => ''

There is a permits pool, which logs in as Administrator, and the permits application uses the permits pool.

I have Select.pl listed as a default document, and the cgi handler is loaded.

When I try to reach http://locahost/permits or http://locahost/permits/Select.pl, I get a 404, but cannot find anything in the logs, Event or IIS that will give me a clue of what is going wrong. Any pointers would be appreciated.

like image 364
octopusgrabbus Avatar asked Oct 19 '25 01:10

octopusgrabbus


1 Answers

Can you run any html file? If so, place a simple perl script next to it and call it. print "Content-type: text/html \n\n"; print "OK";

If this works, the problem is in your script. If it does not work you probably have the wrong settings.

Check it out at http://gdavidcarter.blogspot.com/2016/04/installing-perl-on-windows-2012r2-iis-85.html as Jannes Botis has already written.

I do not have IIS and I can not check but since version 8 I probably do not need quotes in C:\Perl\bin\perl.exe %s %s (in contrast to previous versions where it is necessary)

like image 56
Slawomir Dziuba Avatar answered Oct 22 '25 05:10

Slawomir Dziuba



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!