Link to home
Start Free TrialLog in
Avatar of Harold
HaroldFlag for United States of America

asked on

AWStats in IIS 8.5

Not sure if anyone uses AWStats, but thought I'd ask. We're getting HTTP Error 404.2 - not found.

I've done this.  "Make sure the 4.0 items listed in the cgi / isapi restrictions are enabled (allowed)"
The user that is setup for authentication, has Read, Write and Execute to the folder where awstats is located and logs are stored.

I am not a web person, any help is appreciated.
Avatar of George Sas
George Sas
Flag of Denmark image

Have you tried following this guide ?
http://www.howtogeek.com/50526/setting-up-awstats-on-windows-server-and-iis/

Never used the AWstats but it seems it needs Perl to run.
Did you installed Perl and configured it to run under IIS ? Same article has links to the guide for Perl also.

Regards

George
Avatar of Harold

ASKER

Sas: ya, Perl is installed and verified. I've looked through this link but didn't really help in this error.
Try to put a simple perl file in the folder and try to browse it.
Will it show it ?

Code :

# Prints the message using two different delimeters.
print "Hello, world!\n";
print qq=Did you say "Hello?"\n=;
Avatar of Harold

ASKER

Sa: I created a test.pl file, copied the text to it and dropped in this folder domain.com/awstats/cgi-bin/test.pl

I get the same error, attached.
IIS-error-404-2.png
Try to place it in the root , if same error then this is because PERL is not registered as CGI script :

http://www.howtogeek.com/50479/how-to-install-perl-on-iis-7-for-windows-server-2008/
Avatar of Harold

ASKER

Sas: "place it in the root."  ??  Root of the site?
Avatar of Harold

ASKER

Sas: different error. 502
IIS-error-502-2.png
Avatar of Harold

ASKER

Sas: I've had the Handler Mappings assigned too.
PL-CGI-handler-mappings.png
K, try this sample :

$url = "http://$ENV{SERVER_NAME}$ENV{URL}";
$ip = "$ENV{REMOTE_ADDR}";
print <<ENDOFTEXT;
HTTP/1.0 200 OK
Content-Type: text/html

<HTML>
<HEAD><TITLE>Hello World!</TITLE></HEAD>
<BODY>
<H4>Hello World!</H4>
<P>You have reached <a href="$url">$url</a></P>
<P>Your IP Address is $ip</P>
<H5>Have a nice day!</H5>
</BODY>
</HTML>
ENDOFTEXT
exit(0);

Open in new window

Or try the code suggested in the guide :
    #!c:perlbinperl.exe

    use strict;
    use CGI;
    my $test = new CGI;

    print $test->header(“text/html”),$test->start_html(“Perl Test”);
    print $test->h1(“Perl is working!”);
    print $test->end_html;

Open in new window


Remember to place it in the root of the web site and not in the cgi-bin folder.
Avatar of Harold

ASKER

Sas: Tried this and get 502.2 bad gateway. I'm assuming I have to change the path to where Perl.exe exists, correct?

#!C:\Perl64\bin\perl.exe

use strict;
use CGI;
my $test = new CGI;

print "HTTP/1.0 200 OK\n";
print "Content-Type: text/html\n\n\n";
print $test->h1(“Perl is working!”);
print $test->end_html;
No, this is because you have wrong version of Perl.

https://community.activestate.com/node/10537
Avatar of Harold

ASKER

Sas: even if the OS is 64bit, you use 32 bit?
Avatar of Harold

ASKER

Sas: so I removed Perl64. Installed 32bit, pointed handler mappings to the new Perl location, restarted IIS and still get same error, 502.2 bad gateway.
ASKER CERTIFIED SOLUTION
Avatar of George Sas
George Sas
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Harold

ASKER

Sas: got the following with that could you sent.  But the awstats URL still gives 404.2

Hello World!

You have reached http://localhost

Your IP Address is ::1

Have a nice day!

my URL error.....
HTTP Error 404.2 - Not Found
The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.
Avatar of Harold

ASKER

Still not sure how to fix this.