LevelForFileTypesDetection=0 produces unexpected results

Reported by imagine on 2012-10-15
This bug affects 2 people
Affects Status Importance Assigned to Milestone
awstats (Ubuntu)

Bug Description

When setting LevelForFileTypesDetection=0 in the Awstats config file, Awstats starts to count every hit as a page load, ie the number of "Hits" and "Pages" in the Awstats report is identical. In other words, the Pages statistics becomes meaningless. This was not happening with older versions of Awstats, there must have been a change in version 7.0.
While this may not be a bug, it would be good if it's documented somewhere that LevelForFileTypesDetection must be set to 2 even if you turn ShowFileTypesStats off. Currently the documentation only says that leaving LevelForFileTypesDetection=2 reduces Awstats speed by 1%, so users who don't use/need the file types report might be tempted to turn it off.

Robie Basak (racb) on 2012-10-15
Changed in awstats (Ubuntu):
importance: Undecided → Medium
Eric Klien (l93sf) wrote :

This bug is beyond annoying as I documented at https://sourceforge.net/p/awstats/discussion/43430/thread/d2d5b969/

Here is the text from the posts that I did there:

After I upgraded from 6.95 to 7.0, the top ten pages started listing .png files, etc. I tried downgrading and the problem didn't go away. I put debug statements in awstats.pl and $NotPageList{png} has the correct value. Any hints of what type of debug statements I should add to figure out this problem?

Eric Klien

It seems that setting LevelForFileTypesDetection to 2 (from 0) stops the statistics from adding more .png hits to the top 10 page list although the old .png hits are still listed. (The apache log files are purged by awstats after processing them since my logs get pretty big.) This seems to be related to the bug documented at https://bugs.launchpad.net/ubuntu/+source/awstats/+bug/1066834

I cleaned up the stuff between BEGIN_SIDER and END_SIDER in the relevant .txt file and the problem seems to be solved. The fact that downgrading didn't clean up the mistake in the .txt file threw me off for a while when I tried to diagnose the problem.

Eric Klien (l93sf) wrote :

A solution to the problem is to change the following in awstats.pl:

                       if ($LevelForFileTypesDetection){
                               $datatoload{$filemime} = 1;


# if ($LevelForFileTypesDetection)
{ $datatoload{$filemime} = 1;

This still won't handle the .cur extension. You could handle it by adding it to MimeHashLib at lib/mime.pm or you could simply change ( $LevelForFileTypesDetection >= 2 || $MimeHashLib{$1} ) to ( $LevelForFileTypesDetection >= 0 || $MimeHashLib{$1} )

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in awstats (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers