logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Can't reach awstats page
Author
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Mon 26 Nov '12 4:16    Post subject: Can't reach awstats page Reply with quote

Hello,

When i try to reach www.bagu.biz/awstats/awstats.pl?config=hyze.fr The page never load...
I don't understand why because it work before my server restart.

I user activestat perl 5.16.1 build 1601
I can update my hosts whit the updat command
I have set :
Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.pl\Shell\ExecCGI\Command]
@="D:\\wamp\\apps\\perl\\bin\\perl.exe -wT"


According to my perl install dir
And then i have set :

Code:
# Apache parses all CGI scripts for the shebang line by default.
# This comment line, the first line of the script, consists of the symbols
# pound (#) and exclamation (!) followed by the path of the program that
# can execute this specific script.  For a perl script, with perl.exe in
# the C:\Program Files\Perl directory, the shebang line should be:

   #!D:/wamp/apps/perl/bin/perl.exe

# Note you _must_not_ indent the actual shebang line, and it must be the
# first line of the file.  Of course, CGI processing must be enabled by
# the appropriate ScriptAlias or Options ExecCGI directives for the files
# or directory in question.
#
# However, Apache on Windows allows either the Unix behavior above, or can
# use the Registry to match files by extention.  The command to execute
# a file of this type is retrieved from the registry by the same method as
# the Windows Explorer would use to handle double-clicking on a file.
# These script actions can be configured from the Windows Explorer View menu,
# 'Folder Options', and reviewing the 'File Types' tab.  Clicking the Edit
# button allows you to modify the Actions, of which Apache 1.3 attempts to
# perform the 'Open' Action, and failing that it will try the shebang line.
# This behavior is subject to change in Apache release 2.0.
#
# Each mechanism has it's own specific security weaknesses, from the means
# to run a program you didn't intend the website owner to invoke, and the
# best method is a matter of great debate.
#
# To enable the this Windows specific behavior (and therefore -disable- the
# equivilant Unix behavior), uncomment the following directive:
#
ScriptInterpreterSource Registry
#
# The directive above can be placed in individual <Directory> blocks or the
# .htaccess file, with either the 'registry' (Windows behavior) or 'script'
# (Unix behavior) option, and will override this server default option.


I really don't understand why it don't load. Can you help me please ?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 26 Nov '12 8:13    Post subject: Re: Can't reach awstats page Reply with quote

The answer is right there in the script;

# Apache parses all CGI scripts for the shebang line by default.
# This comment line, the first line of the script, consists of the symbols
# pound (#) and exclamation (!) followed by the path of the program that
# can execute this specific script.


So, this needs to be at the very top of the script, the first line.

#!D:/wamp/apps/perl/bin/perl.exe
Back to top
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Mon 26 Nov '12 10:28    Post subject: Reply with quote

It's already done.
Code:
#!d:/wamp/apps/perl/bin/perl.exe
#------------------------------------------------------------------------------
# Free realtime web server logfile analyzer to show advanced web statistics.
# Works from command line or as a CGI. You must use this script as often as
# necessary from your scheduler to update your statistics and from command
# line or a browser to read report results.


And when ScriptInterpreterSource registry is set, apache use the registry and not the shebang.

So i have set :
Code:
[HKEY_CLASSES_ROOT\.pl\Shell\ExecCGI\Command]
@="D:\\wamp\\apps\\perl\\bin\\perl.exe -wT"


When i don't do that, i get an error 500.

For the moment, i don't get any error, the page load in an infinite loop and never show anything...

There is no error message and there is no error in the browser...just an infinite loading...
Back to top
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Mon 26 Nov '12 13:45    Post subject: Reply with quote

I have made other tests.
I have made a file name test.pl with this content :
Code:
#!d:/wamp/apps/perl/bin/perl.exe -wT
print "Content-type: text/html\n\n";
print "Hello, World."


And i have the same result...the page don't trow any error, it just load infinitly.

So i made an other test with that :

Code:
#!D:/wamp/php/php-cgi.exe

<?php

echo "hello";

?>


And the result is the same...So there is something wrong with my CGI configuration...but what ?

I have this in my httpd.conf :
Code:
<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig conf/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php
    AddType text/html .pl

    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    AddHandler cgi-script .cgi .pl

    # For type maps (negotiated resources):
    #AddHandler type-map var

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
</IfModule>
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 27 Nov '12 21:42    Post subject: Reply with quote

is mod_cgi loaded?
Back to top
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Wed 28 Nov '12 13:30    Post subject: Reply with quote

Yes

Code:
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule antiloris_module modules/mod_antiloris.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
LoadModule fcgid_module modules/mod_fcgid.so
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so


If i don't load CGI module, the code is shown. If CGI module is load, well, you can take a look here : http://www.bagu.biz/awstats/awstats.pl
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 30 Nov '12 18:40    Post subject: Reply with quote

bagu wrote:
http://www.bagu.biz/awstats/awstats.pl


For me the link works fine.
Back to top
bagu



Joined: 06 Jan 2011
Posts: 193
Location: France

PostPosted: Fri 30 Nov '12 21:16    Post subject: Reply with quote

Yes, sorry about that.

Here are the news : i have reinstall windows.
Now, everything work fine...


I still don't understand what's happen and why CGI stop working suddenly.

Thanks for your attention.
Back to top


Reply to topic   Topic: Can't reach awstats page View previous topic :: View next topic
Post new topic   Forum Index -> Other Software