From: manolamancha <> Date: Wed, 9 Jun 2010 14:46:20 +0000 (+0000) Subject: Added download tracking, modified the Mime.pm file to indicate if a file type is... X-Git-Tag: AWSTATS_7_0_BETA2~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aee108ee59ff714a4dd7c31db1b933dbede264d3;p=thirdparty%2FAWStats.git Added download tracking, modified the Mime.pm file to indicate if a file type is a download, updated documentation, handles 206 partial content/download continuation correctly. --- diff --git a/README.TXT b/README.TXT index 3d44f593..5ee602c7 100644 --- a/README.TXT +++ b/README.TXT @@ -48,6 +48,7 @@ I - 1) Features * OS used (pages, hits, KB for each OS) * Robot visits * Worm attacks + * Download and continuation detection * Search engines, keyphrases and keywords used to find your site * HTTP errors (Page not found with last referer, etc,) * Screen size report diff --git a/docs/awstats_changelog.txt b/docs/awstats_changelog.txt index 3fe4862f..173aa5cf 100644 --- a/docs/awstats_changelog.txt +++ b/docs/awstats_changelog.txt @@ -18,6 +18,8 @@ New features/improvements: - Added parameter to ignore missing log files when merging for a site on multiple servers where a single server may not have created a log for a given day. - Update robots database. +- Added Download tracking where certain mime types are defined as downloads + and HTTP status 206 is tracked as download continuation Thanks to Chris Larsen (author of most thoses changes). diff --git a/docs/awstats_config.html b/docs/awstats_config.html index c1c9aad1..68326975 100644 --- a/docs/awstats_config.html +++ b/docs/awstats_config.html @@ -1,37 +1,34 @@ - - + -AWStats Documentation - Configuration directives and parameters - - - - +AWStats Documentation - Configuration directives and parameters + - + +
- - - + + - -
+

-AWStats logfile analyzer 6.95 Documentation
+AWStats logfile analyzer 6.95 Documentation

+  
+ -

AWStats configuration directives/options

+

AWStats configuration directives/options


Each directive available in the AWStats config file (.conf) is listed here (with examples and default values).
@@ -46,200 +43,198 @@ when reading it), follow the example:

DIRECTIVES IN MAIN SETUP SECTION (Required to make AWStats work)
+
  • LogType +
  • LogFormat +
  • LogSeparator +
  • DNSLookup +
  • DirData +
  • DirCgi +
  • DirIcons +
  • SiteDomain +
  • HostAliases +
  • AllowToUpdateStatsFromBrowser +
  • AllowFullYearView +

  • DIRECTIVES IN OPTIONAL SETUP SECTION (Not required but increase AWStats features)
    +
  • DNSStaticCacheFile +
  • DNSLastUpdateCacheFile +
  • SkipDNSLookupFor +
  • AllowAccessFromWebToAuthenticatedUsersOnly +
  • AllowAccessFromWebToFollowingAuthenticatedUsers +
  • AllowAccessFromWebToFollowingIPAddresses +
  • CreateDirDataIfNotExists +
  • BuildHistoryFormat +
  • BuildReportFormat +
  • SaveDatabaseFilesWithPermissionsForEveryone +
  • PurgeLogFile +
  • ArchiveLogRecords +
  • KeepBackupOfHistoricFiles +
  • DefaultFile +
  • SkipHosts +
  • SkipUserAgents +
  • SkipFiles +
  • OnlyHosts +
  • OnlyUserAgents +
  • OnlyUsers +
  • OnlyFiles +
  • NotPageList +
  • ValidHTTPCodes +
  • ValidSMTPCodes +
  • AuthenticatedUsersNotCaseSensitive +
  • URLNotCaseSensitive +
  • URLWithAnchor +
  • URLQuerySeparators +
  • URLWithQuery +
  • URLWithQueryWithOnlyFollowingParameters +
  • URLWithQueryWithoutFollowingParameters +
  • URLReferrerWithQuery +
  • WarningMessages +
  • ErrorMessages +
  • DebugMessages +
  • NbOfLinesForCorruptedLog +
  • SplitSearchString +
  • WrapperScript +
  • DecodeUA +
  • MiscTrackerUrl +

  • DIRECTIVES IN OPTIONAL ACCURACY SETUP SECTION (Not required but increase AWStats features)
    +
    DIRECTIVES IN OPTIONAL APPEARANCE SETUP SECTION (Not required but increase AWStats features)
    +
  • DetailedReportsOnNewWindows +
  • Expires +
  • MaxRowsInHTMLOutput +
  • Lang +
  • DirLang +
  • ShowHeader +
  • ShowMenu +
  • ShowSummary +
  • ShowMonthStats +
  • ShowDaysOfMonthStats +
  • ShowDaysOfWeekStats +
  • ShowHoursStats +
  • ShowDomainsStats +
  • ShowHostsStats +
  • ShowAuthenticatedUsers +
  • ShowRobotsStats +
  • ShowWormsStats +
  • ShowSessionsStats +
  • ShowPagesStats +
  • ShowCompressionStats +
  • ShowFileTypesStats +
  • ShowFileSizesStats
  • ShowDownloadsStats
  • ShowOSStats +
  • ShowBrowsersStats +
  • ShowScreenSizeStats +
  • ShowOriginStats +
  • ShowKeyphrasesStats +
  • ShowKeywordsStats +
  • ShowMiscStats +
  • ShowHTTPErrorsStats +
  • ShowSMTPErrorsStats +
  • ShowClusterStats +
  • AddDataArrayMonthStats +
  • AddDataArrayShowDaysOfMonthStats +
  • AddDataArrayShowDaysOfWeekStats +
  • AddDataArrayShowHoursStats +
  • IncludeInternalLinksInOriginSection +
  • MaxNbOfDomain +
  • MinHitDomain +
  • MaxNbOfHostsShown +
  • MinHitHost +
  • MaxNbOfLoginShown +
  • MinHitLogin +
  • MaxNbOfRobotShown +
  • MinHitRobot
  • MaxNbOfDownloadsShown
  • MinHitDownloads
  • MaxNbOfPageShown +
  • MaxNbOfOsShown +
  • MinHitOs +
  • MaxNbOfBrowsersShown +
  • MinHitBrowser +
  • MinHitFile +
  • MaxNbOfScreenSizesShown +
  • MinHitScreenSize +
  • MaxNbOfRefererShown +
  • MinHitRefer +
  • MaxNbOfKeywordsShown +
  • MinHitKeyword +
  • FirstDayOfWeek +
  • ShowFlagLinks +
  • ShowLinksOnUrl +
  • MaxLengthOfURL +
  • ShowLinksToWhoIs +
  • UseHTTPSLinksForUrl +
  • LinksToWhoIs +
  • LinksToIPWhoIs +
  • HTMLHeadSection +
  • HTMLEndSection +
  • BarWidth +
  • BarHeight +
  • Logo +
  • LogoLink +
  • StyleSheet +
  • color_Background +
  • color_TableBGTitle +
  • color_TableTitle +
  • color_TableBG +
  • color_TableRowTitle +
  • color_TableBGRowTitle +
  • color_TableBorder +
  • color_text +
  • color_titletext +
  • color_weekend +
  • color_link +
  • color_hover +
  • color_u +
  • color_v +
  • color_p +
  • color_h +
  • color_k +
  • color_s +
  • color_e +
  • color_x +

  • DIRECTIVES FOR PLUGINS
    +
    DIRECTIVES IN EXTRA SECTIONS
    +
  • ExtraSectionCodeFilterX +
  • ExtraSectionConditionX +
  • ExtraSectionFirstColumnTitleX +
  • ExtraSectionFirstColumnValuesX +
  • ExtraSectionFirstColumnFormatX +
  • ExtraSectionStatTypesX +
  • ExtraSectionAddAverageRowX +
  • ExtraSectionAddSumRowX +
  • MaxNbOfExtraX +
  • MinHitExtraX +
  • ExtraTrackedRowsLimit +

  • INCLUDES
    + @@ -343,7 +338,7 @@ when reading it), follow the example:

    # %uaquot User agent with format: "Mozilla/4.0 (compatible, ...)"
    # %ua User agent with format: Mozilla/4.0_(compatible...)
    # %gzipin mod_gzip compression input bytes: In:XXX -
    # %gzipout mod_gzip compression output bytes & ratio: Out:YYY:ZZpct. +
    # %gzipout mod_gzip compression output bytes & ratio: Out:YYY:ZZpct.
    # %gzipratio mod_gzip compression ratio: ZZpct.
    # %deflateratio mod_deflate compression ratio with format: (ZZ)
    # %email EMail sender (for mail log) @@ -439,7 +434,7 @@ when reading it), follow the example:
    DirIcons
    Version : 1.0+

    # Relative or absolute web URL of your awstats icon directory. -
    # If you build static reports ("... -output > outputpath/output.html"), enter +
    # If you build static reports ("... -output > outputpath/output.html"), enter
    # path of icon directory relative to the output directory 'outputpath'.
    # Example: "/awstatsicons"
    # Example: "../icon" @@ -1055,7 +1050,7 @@ when reading it), follow the example:

    # the next parameter URLWithQueryWithoutFollowingParameters.
    # Possible values:
    # 0 - URLs are cleaned from the query string (ie: "/mypage.html") -
    # 1 - Full URL with query string is used (ie: "/mypage.html?p=x&q=y") +
    # 1 - Full URL with query string is used (ie: "/mypage.html?p=x&q=y")
    # Default: 0
    #
    URLWithQuery=0 @@ -1071,7 +1066,7 @@ when reading it), follow the example:

    # such cases, it is higly recommanded to ask AWStats to keep only parameters
    # you need (if you know them) before counting, manipulating and storing URL.
    # Enter here list of wanted parameters. For example, with "param", one hit on -
    # /mypage.cgi?param=abc&id=Yo4UomP9d and /mypage.cgi?param=abc&id=Mu8fdxl3r +
    # /mypage.cgi?param=abc&id=Yo4UomP9d and /mypage.cgi?param=abc&id=Mu8fdxl3r
    # will be reported as 2 hits on /mypage.cgi?param=abc
    # This parameter is not used when URLWithQuery is 0 and can't be used with
    # URLWithQueryWithoutFollowingParameters. @@ -1092,7 +1087,7 @@ when reading it), follow the example:

    # such cases, it is higly recommanded to ask AWStats to remove such parameters
    # from the URL before counting, manipulating and storing URL. Enter here list
    # of all non wanted parameters. For example, if you enter "id", one hit on -
    # /mypage.cgi?param=abc&id=Yo4UomP9d and /mypage.cgi?param=abc&id=Mu8fdxl3r +
    # /mypage.cgi?param=abc&id=Yo4UomP9d and /mypage.cgi?param=abc&id=Mu8fdxl3r
    # will be reported as 2 hits on /mypage.cgi?param=abc
    # This parameter is not used when URLWithQuery is 0 and can't be used with
    # URLWithQueryWithOnlyFollowingParameters. @@ -1112,7 +1107,7 @@ when reading it), follow the example:

    # are counted as two different referrer pages.
    # Possible values:
    # 0 - Referrer URLs are cleaned from the query string (ie: "/mypage.html") -
    # 1 - Full URL with query string is used (ie: "/mypage.html?p=x&q=y") +
    # 1 - Full URL with query string is used (ie: "/mypage.html?p=x&q=y")
    # Default: 0
    #
    URLReferrerWithQuery=0 @@ -1220,7 +1215,7 @@ AWStats 4.1+ supports both keywords AND keyphrases by default with no need of an
    # To enable all this features, you must copy the awstats_misc_tracker.js file
    # into a /js/ directory stored in your web document root and add the following
    # HTML code at the end of your index page (before </BODY>) : -
    # <script language=javascript src="/js/awstats_misc_tracker.js"></script> +
    # <script language=javascript src="/js/awstats_misc_tracker.js"></script>
    # If code is not added in index page, all this detection capabilities will be
    # disabled. You must also check that ShowScreenSizeStats and ShowMiscStats
    # parameters are set to 1 to make results appear in report page. @@ -1358,7 +1353,7 @@ ShowOSStats,ShowOriginStats,ShowKeyphrasesStats,ShowKeywordsStats,ShowHTTPErrors 5.6+ for ShowMiscStats,ShowSTMPErrorsStats
    5.8+ for ShowClusterStats
    6.0+ for ShowWormsStats
    -6.4+ for ShowSummary
    +6.4+ for ShowSummary
    7.0+ for ShowDownloadsStats

    # You choose here which reports you want to see in the main page and what you
    # want to see in those reports.
    # Possible values: @@ -1463,7 +1458,7 @@ ShowOSStats,ShowOriginStats,ShowKeyphrasesStats,ShowKeywordsStats,ShowHTTPErrors
    # Context: Web, Streaming, Mail, Ftp
    # Default: 1, Possible column codes: None
    ShowFileSizesStats=0 -
    +

    # Show downloads chart.
    # Context: Web, Streaming, Ftp
    # Default: HB, Possible column codes: HB
    ShowDownloadsStats=HB   

    # Show operating systems chart
    # Context: Web, Streaming, Ftp
    # Default: 1, Possible column codes: None @@ -1565,7 +1560,7 @@ ShowOSStats,ShowOriginStats,ShowKeyphrasesStats,ShowKeywordsStats,ShowHTTPErrors
    # Stats by robots
    MaxNbOfRobotShown = 10
    MinHitRobot = 1 -
    # Stats by pages +
    # Stats for Downloads
    MaxNbOfDownloadsShown = 10
    MinHitDownloads = 1
    # Stats by pages
    MaxNbOfPageShown = 10
    MinHitFile = 1
    # Stats by OS @@ -1826,10 +1821,9 @@ all ExtraSection...X directives and how to use them.


    - - - + \ No newline at end of file diff --git a/docs/awstats_glossary.html b/docs/awstats_glossary.html index cc4d5849..3f47f352 100644 --- a/docs/awstats_glossary.html +++ b/docs/awstats_glossary.html @@ -1,650 +1,800 @@ - - + - -AWStats Documentation - Glossary +AWStats Documentation - Glossary + - - - - - - + +
    - - - + + + - - +
    +

    -AWStats logfile analyzer 6.95 Documentation
    +AWStats logfile analyzer 6.95 +Documentation

    +  
    - - -

    Glossary


    - +
    +
    +

    Glossary

    +
    Unique Visitor:
    - A unique visitor is a host that has made at least 1 hit -on 1 page of your web site during the current period shown by the report. -If this host make several visits during this period, it is counted only once.
    +A unique +visitor is a person or computer (host) that has made at least 1 hit +on 1 page of your web site during the current period shown by the +report. +If this user makes several visits during this period, it is counted +only once. Visitors are tracked by IP address, so if multiple users are +accessing your site from the same IP (such as a home or office +network), they will be counted as a single unique visitor.
    The period shown by AWStats reports is by default the current month.
    -However if you use AWStats as a CGI you can click on the "year" link to have a report for all the year. -In a such report, period is full year, so Unique Visitors are number of hosts that have made at least 1 hit -on 1 page of your web site during those year.
    +However if you use AWStats as a CGI you can click on the "year" link to +have a report for all the year. +In such a report, period is a full year, so Unique Visitors are number +of hosts that have made at least 1 hit +on 1 page of your web site during the year.

    - Visits:
    Number of visits made by all visitors.
    -Think "session" here, say a unique IP accesses a page, and then requests three others without an hour -between any of the requests, all of the "pages" are included in the visit, therefore you should expect -multiple pages per visit and multiple visits per unique visitor (assuming that some of the unique IPs are +Think "session" here, say a unique IP accesses a page, and then +requests three other pages within an hour. All of the "pages" are +included in the visit, therefore you should expect +multiple pages per visit and multiple visits per unique visitor +(assuming that some of the unique IPs are logged with more than an hour between requests)

    - Pages:
    -The number of "pages" logged. Only files that don't match an entry in the NotPageList config -parameter (and match an entry of OnlyFiles config parameter if used) are counted as "Pages". -Usually pages are reserved for HTML files or CGI files, not images nor other files requested as a result -of loading a "Page" (like js,css... files).
    -
    - -Hits:
    -Any files requested from the server (including files that are "Pages") except those that match +The number of "pages" viewed by visitors. Pages are usually HTML, PHP +or ASP files, not images or other files requested as a result +of loading a "Page" (like js,css... files). Files listed in the +NotPageList config +parameter (and match an entry of OnlyFiles config parameter if used) +are not counted as "Pages". +
    Hits:
    +Any files requested from the server (including files that are "Pages") +except those that match the SkipFiles config parameter.

    - - Bandwidth:
    -Total number of bytes for pages, images and files downloaded by web browsing.
    -Note 1: Of course, this number includes only traffic for web only (or mail only, or ftp only +Total number of bytes for pages, images and files downloaded by web +browsing.
    +Note 1: Of course, this number includes only traffic for web only (or +mail only, or ftp only depending on value of LogType).
    -Note 2: This number does not include technical header data size used inside the HTTP or HTTPS protocol or by +Note 2: This number does not include technical header data size used +inside the HTTP or HTTPS protocol or by protocols at a lower level (TCP, IP...).
    -Because of two previous notes, this number is often lower than bandwith reported by your provider (your -provider counts in most cases bandwitdh at a lower level and includes all IP and UDP traffic).
    +Because of two previous notes, this number is often lower than bandwith +reported by your provider (your +provider counts in most cases bandwitdh at a lower level and includes +all IP and UDP traffic).

    - Entry Page:
    First page viewed by a visitor during its visit.
    -Note: When a visit started at end of month to end at beginning of next month, +Note: When a visit started at end of month to end at beginning of next +month, you might have an Entry page for the month report and no Exit pages.
    That's why Entry pages can be different than Exit pages.

    - Exit Page:
    Last page viewed by a visitor during its visit.
    -Note: When a visit started at end of month to end at beginning of next month, +Note: When a visit started at end of month to end at beginning of next +month, you might have an Entry page for the month report and no Exit pages.
    That's why Entry pages can be different than Exit pages.

    - Session Duration:
    The time a visitor spent on your site for each visit.
    -Some Visits durations are 'unknown' because they can't always be calculated. This is the major reason for this:
    +Some Visits durations are 'unknown' because they can't always be +calculated. This is the major reason for this:
    - Visit was not finished when 'update' occured.
    -- Visit started the last hour (after 23:00) of the last day of a month (A technical reason prevents AWStats from +- Visit started the last hour (after 23:00) of the last day of a month +(A technical reason prevents AWStats from calculating duration of such sessions).

    - Grabber:
    -A browser that is used primarily for copying locally an entire site. These include +A browser that is used primarily for copying locally an entire site. +These include for example "teleport", "webcapture", "webcopier"...

    - Direct access / Bookmark:
    -This number represent the number of hits or ratio of hits when a visit to your site comes -from a direct access. This means the first page of your web site was called:
    +This number represent the number of hits or ratio of hits when a visit +to your site comes +from a direct access. This means the first page of your web site was +called:
    - By typing your URL on the web browser address bar
    - By clicking on your URL stored by a visitor inside its favorites
    -- By clicking on your URL found everywhere but not another internet web pages (a link in a document, +- By clicking on your URL found everywhere but not another internet web +pages (a link in a document, an application, etc...)
    - Clicking an URL of your site inside a mail is often counted here.

    - Add To Favourites:
    -This value, available in the "miscellanous chart", reports an estimated indicator -that can be used to have an idea of the number of times a visitor has added your web +This value, available in the "miscellanous chart", reports an estimated +indicator +that can be used to have an idea of the number of times a visitor has +added your web site into its favourite bookmarks.
    The technical rules for that is the following formula:
    Number of Add to Favourites = round((x+y) / r)
    where
    -x = Number of hits made by IE browsers for "/anydir/favicon.ico", with a referer field not defined, and with no 404 error code
    -y = Number of hits made by IE browsers for "/favicon.ico", with a referer field not defined, with or without 404 error code
    -r = Ratio of hits made by IE browsers compared to hits made by all browsers (r <= 1)
    -
    -As you can see in formula, only IE is used to count reliable "add", the "Add to favourites" -for other browsers are estimated using ratio of other browsers usage compared to ratio of -IE usage. The reason is that only IE do a hit on favicon.ico nearly ONLY when a user add the -page to its favourites. The other browsers make often hits on this file also for other reasons -so we can't count one "hit" as one "add" since it might be a hit for another reason.
    -AWStats differentiate also hits with error and not to avoid counting multiple hits -made recursively in upper path when favicon.ico file is not found in deeper directory +x = Number of hits made by IE browsers for "/anydir/favicon.ico", with +a referer field not defined, and with no 404 error code
    +y = Number of hits made by IE browsers for "/favicon.ico", with a +referer field not defined, with or without 404 error code
    +r = Ratio of hits made by IE browsers compared to hits made by all +browsers (r <= 1)
    +
    +As you can see in formula, only IE is used to count reliable "add", the +"Add to favourites" +for other browsers are estimated using ratio of other browsers usage +compared to ratio of +IE usage. The reason is that only IE do a hit on favicon.ico nearly +ONLY when a user add the +page to its favourites. The other browsers make often hits on this file +also for other reasons +so we can't count one "hit" as one "add" since it might be a hit for +another reason.
    +AWStats differentiate also hits with error and not to avoid counting +multiple hits +made recursively in upper path when favicon.ico file is not found in +deeper directory of path.
    -Note that this number is just an indicator that is in most case higher than true value. -The reason is that even IE browser sometimes make hit on favicon without an "Add to favourites" +Note that this number is just an indicator that is in most case higher +than true value. +The reason is that even IE browser sometimes make hit on favicon +without an "Add to favourites" action by a user. -
    - - -HTTP Status Codes:
    -HTTP status codes are returned by web servers to indicate the status of a request. -Codes 200 and 304 are used to tell the browser the page can be viewed. -All other codes generates hits and traffic 'not seen' by the visitor. For example a return -code 301 or 302 will tell the browser to ask another page. The browser will do another hit -and should finaly receive the page with a return code 200 and 304. -All codes that are 'unseen' traffic are isolated by AWStats in the HTTP Status report chart, +
    HTTP Status Codes:
    +HTTP status codes are returned by web servers to indicate the status of +a request. +Codes 200 and 304 are used to +tell the browser the page can be viewed. +206 codes indicate partial +downloading of content and is reported in the Downloads section. All +other codes generates hits and traffic 'not seen' by the visitor. +For example a return +code 301 or 302 will tell the browser to ask another page. The browser +will do another hit +and should finaly receive the page with a return code 200 +and 304. +All codes that are 'unseen' traffic are isolated by AWStats in the HTTP +Status report chart, enabled by the directives ShowHTTPErrorsStats. -in config file. You can also change value for 'not error' hits (set by default to 200 and 304 -with the ValidHTTPcodes directive. -The following table outlines all status codes defined for the HTTP/1.1 draft specification -outlined in IETF rfc 2068.
    -They are 3-digit codes where the first digit of this code identifies the class of the status -code and the remaining 2 digits correspond to the specific condition within the response class. +in config file. You can also change value for 'not error' hits (set by +default to 200 and 304 +with the ValidHTTPcodes +directive. +The following table outlines all status codes defined for the HTTP/1.1 +draft specification +outlined in IETF +rfc 2068.
    +They are 3-digit codes where the first digit of this code identifies +the class of the status +code and the remaining 2 digits correspond to the specific condition +within the response class. They are classified in 5 categories:
    - - - -
    - - -1xx class - Informational -
    Informational status codes are provisional -responses from the web server... they give the client a heads-up on what -the server is doing. Informational codes do not indicate an error condition.  - - +
    + - -
    100100 Continue -
    The continue status code tells the +
    +1xx +class - Informational +
    +Informational +status codes are provisional +responses from the web server... they give the client a heads-up on +what +the server is doing. Informational codes do not indicate an error +condition.  + + + + + - - - + +
    100100 Continue +
    +The +continue status code tells the browser to continue sending a request to the server. 
    101101 Switching Protocols -
    The server sends this response when +
    101101 Switching +Protocols +
    +The +server sends this response when the client asks to switch from HTTP/1.0 to HTTP/1.1 
    - -

    2xx class - Successful -
    This class of status code indicates -that the client's request was received, understood, and successful.  - - +

    2xx class - Successful +
    +This +class of status code indicates +that the client's request was received, understood, and +successful.  +

    + - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - - - + + + +
    200200 Successful200200 Successful
    201201 Created201201 Created
    202202 Accepted202202 Accepted
    203203 Non-Authorative Information203203 +Non-Authorative Information
    204204 No Content204204 No Content
    205205 Reset Content205205 Reset Content
    206206 Partial Content -
    The partial content success code is -issued when the server fulfills a partial GET request. This happens when -the client is downloading a multi-part document or part of a larger file. 
    206206 Partial Content +
    +The +partial content success code is +issued when the server fulfills a partial GET request. This happens +when +the client is downloading a multi-part document or part of a larger +file. 
    - -3xx class - Redirection -
    This code tells the client that the -browser should be redirected to another URL in order to complete the request. +3xx +class - Redirection +
    +This +code tells the client that the +browser should be redirected to another URL in order to complete the +request. This is not an error condition.  - - +
    + - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - +
    300300 Multiple Choices300300 Multiple +Choices
    301301 Moved Permanently301301 Moved +Permanently
    302302 Moved Temporarily302302 Moved +Temporarily
    303303 See Other303303 See Other
    304304 Not Modified304304 Not Modified
    305305 Use Proxy305305 Use Proxy
    - -4xx class - Client Error -
    This status code indicates that the -client has sent bad data or a malformed request to the server. Client errors -are generally issued by the webserver when a client tries to gain access +4xx +class - Client Error +
    +This +status code indicates that the +client has sent bad data or a malformed request to the server. Client +errors +are generally issued by the webserver when a client tries to gain +access to a protected area using a bad username and password.  - - +
    + - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - +
    400400 Bad Request400400 Bad Request
    401401 Unauthorized401401 Unauthorized
    402402 Payment Required402402 Payment +Required
    403403 Forbidden403403 Forbidden
    404404 Not Found404404 Not Found
    405400 Method Not Allowed405400 Method Not +Allowed
    406400 Not Acceptable406400 Not Acceptable
    407400 Proxy Authentication Required407400 Proxy +Authentication Required
    408400 Request Timeout408400 Request Timeout
    409409 Conflict409409 Conflict
    410410 Gone410410 Gone
    411411 Length Required411411 Length Required
    412412 Precondition Failed412412 Precondition +Failed
    413413 Request Entity Too Long413413 Request Entity +Too Long
    414414 Request-URI Too Long414414 Request-URI +Too Long
    415415 Unsupported Media Type415415 Unsupported +Media Type
    - -5xx class - Server Error -
    This status code indicates that the +5xx +class - Server Error +
    +This +status code indicates that the client's request couldn't be succesfully processed due to some internal -error in the web server. These error codes may indicate something is seriously +error in the web server. These error codes may indicate something is +seriously wrong with the web server.  - - - - - - - + +
    500500 Internal Server Error -
    An internal server error has caused -the server to abort your request. This is an error condition that may also -indicate a misconfiguration with the web server. However, the most common -reason for 500 server errors is when you try to execute a script that has + + + + + - - - + - - - + - - - + - - - + - - - + - +
    500500 Internal +Server Error +
    +An +internal server error has caused +the server to abort your request. This is an error condition that may +also +indicate a misconfiguration with the web server. However, the most +common +reason for 500 server errors is when you try to execute a script that +has syntax errors. 
    501501 Not Implemented -
    This code is generated by a webserver -when the client requests a service that is not implemented on the server. +
    501501 Not Implemented +
    +This +code is generated by a webserver +when the client requests a service that is not implemented on the +server. Typically, not implemented codes are returned when a client attempts to -POST data to a non-CGI (ie, the form action tag refers to a non-executable +POST data to a non-CGI (ie, the form action tag refers to a +non-executable file). 
    502502 Bad Gateway -
    The server, when acting as a proxy, -issues this response when it receives a bad response from an upstream or +
    502502 Bad Gateway +
    +The +server, when acting as a proxy, +issues this response when it receives a bad response from an upstream +or support server. 
    503503 Service Unavailable -
    The web server is too busy processing -current requests to listen to a new client. This error represents a serious +
    503503 Service +Unavailable +
    +The +web server is too busy processing +current requests to listen to a new client. This error represents a +serious problem with the webserver (normally solved with a reboot). 
    504504 Gateway Timeout -
    Gateway timeouts are normally issued +
    504504 Gateway Timeout +
    +Gateway +timeouts are normally issued by proxy servers when an upstream or support server doesn't respond to a request in a timely fashion. 
    505505 HTTP Version Not Supported -
    The server issues this status code -when a client tries to talk using an HTTP protocol that the server doesn't +
    505505 HTTP Version +Not Supported +
    +The +server issues this status code +when a client tries to talk using an HTTP protocol that the server +doesn't support or is configured to ignore.
    +


    -


    - -SMTP Status Codes:
    - -SMTP status codes are returned by mail servers to indicate the status of a sending/receiving mail. -The status code depends on mail server and preprocessor used to analyze log file.
    -All codes that are failure codes are isolated by AWStats in the SMTP Status report chart, -enabled by the directives
    ShowSMTPErrorsStats in AWStats -config file. You can decide which codes are successfull mail transfer that should not appear -in this chart with the ValidSMTPCodes directive.
    -Here are values reported for most mail servers (This should also be values when mail log file +SMTP Status Codes:
    +SMTP status codes are returned by mail servers to indicate the status +of a sending/receiving mail. +The status code depends on mail server and preprocessor used to analyze +log file.
    +All codes that are failure codes are isolated by AWStats in the SMTP +Status report chart, +enabled by the directives
    ShowSMTPErrorsStats +in AWStats +config file. You can decide which codes are successfull mail transfer +that should not appear +in this chart with the ValidSMTPCodes +directive.
    +Here are values reported for most mail servers (This should also be +values when mail log file is preprocessing with maillogconvert.pl).
    SMTP Errors are classified in 3 categories:
    - - - -\n" : "   " ); } - if ($ShowFileTypesStats) { + if ($ShowFileTypesStats && $LevelForFileTypesDetection > 0) { print( $frame? "\n" : "   " ); } + if ($ShowDownloadsStats && $LevelForFileTypesDetection > 0) { + print( $frame? "\n" : "   " ); + print( $frame + ? "\n" : "   " ); + } if ($ShowPagesStats) { print( $frame? ""; } else { - my $nameicon = $MimeHashIcon{$key} || "notavailable"; - my $nametype = - $MimeHashLib{ $MimeHashFamily{$key} || "" } || " "; + my $nameicon = $MimeHashLib{$key}[0] || "notavailable"; + my $nametype = $MimeHashFamily{$MimeHashLib{$key}[0]} || " "; print " 
    \n"; + &tab_head( $Message[178], 19, 0, "downloads" ); + print "
    "; + if ( $ShowFileTypesStats =~ /H/i ){print "" + .""; } + if ( $ShowFileTypesStats =~ /B/i ){ + print ""; + print ""; + } + print "\n"; + my $count = 0; + for my $u (sort {$_downloads{$b}->{'AWSTATS_HITS'} <=> $_downloads{$a}->{'AWSTATS_HITS'}}(keys %_downloads) ){ + print ""; + my $ext = Get_Extension($regext, $u); + if ( !$ext) { + print ""; + } + else { + my $nameicon = $MimeHashLib{$ext}[0] || "notavailable"; + my $nametype = $MimeHashFamily{$MimeHashLib{$ext}[0]} || " "; + print ""; + } + print ""; + if ( $ShowFileTypesStats =~ /H/i ){ + print ""; + print ""; + } + if ( $ShowFileTypesStats =~ /B/i ){ + print ""; + print ""; + } + print "\n"; + $count++; + if ($count >= $MaxRowsInHTMLOutput){last;} + } + &tab_end(); + &html_end(1); +} + #------------------------------------------------------------------------------ # Function: Prints the Summary section at the top of the main page # Parameters: _ @@ -13659,6 +13882,116 @@ sub HTMLMainDaysofWeek{ &tab_end(); } +#------------------------------------------------------------------------------ +# Function: Prints the Downloads chart and table +# Parameters: - +# Input: - +# Output: HTML +# Return: - +#------------------------------------------------------------------------------ +sub HTMLMainDownloads{ + my $NewLinkParams = shift; + my $NewLinkTarget = shift; + if (!$LevelForFileTypesDetection > 0){return;} + if ($Debug) { debug( "ShowDownloadStats", 2 ); } + my $regext = qr/\.(\w{1,6})$/; + print "$Center 
    \n"; + my $Totalh = 0; + if ($MaxNbOf{'DownloadsShown'} < 1){$MaxNbOf{'DownloadsShown'} = 10;} # default if undefined + my $title = + "$Message[178] ($Message[77] $MaxNbOf{'DownloadsShown'})   -   $Message[80]"; + &tab_head( "$title", 0, 0, 'downloads' ); + my $cnt=0; + for my $u (sort {$_downloads{$b}->{'AWSTATS_HITS'} <=> $_downloads{$a}->{'AWSTATS_HITS'}}(keys %_downloads) ){ + $Totalh += $_downloads{$u}->{'AWSTATS_HITS'}; + $cnt++; + if ($cnt > 4){last;} + } + # Graph the top five in a pie chart + if (scalar keys %_downloads > 1){ + foreach my $pluginname ( keys %{ $PluginsLoaded{'ShowGraph'} } ) + { + my @blocklabel = (); + my @valdata = (); + my @valcolor = ($color_p); + my $cnt = 0; + for my $u (sort {$_downloads{$b}->{'AWSTATS_HITS'} <=> $_downloads{$a}->{'AWSTATS_HITS'}}(keys %_downloads) ){ + push @valdata, ($_downloads{$u}->{'AWSTATS_HITS'} / $Totalh * 1000 ) / 10; + push @blocklabel, Get_Filename($u); + $cnt++; + if ($cnt > 4) { last; } + } + my $columns = 2; + if ($ShowDownloadsStats =~ /H/i){$columns += length($ShowDownloadsStats)+1;} + else{$columns += length($ShowDownloadsStats);} + print ""; + } + } + + my $total_dls = scalar keys %_downloads; + print ""; + if ( $ShowDownloadsStats =~ /H/i ){print "" + .""; } + if ( $ShowDownloadsStats =~ /B/i ){ + print ""; + print ""; + } + print "\n"; + my $count = 0; + for my $u (sort {$_downloads{$b}->{'AWSTATS_HITS'} <=> $_downloads{$a}->{'AWSTATS_HITS'}}(keys %_downloads) ){ + print ""; + my $ext = Get_Extension($regext, $u); + if ( !$ext) { + print ""; + } + else { + my $nameicon = $MimeHashLib{$ext}[0] || "notavailable"; + my $nametype = $MimeHashFamily{$MimeHashLib{$ext}[0]} || " "; + print ""; + } + print ""; + if ( $ShowDownloadsStats =~ /H/i ){ + print ""; + print ""; + } + if ( $ShowDownloadsStats =~ /B/i ){ + print ""; + print ""; + } + print "\n"; + $count++; + if ($count >= $MaxNbOf{'DownloadsShown'}){last;} + } + &tab_end(); +} + #------------------------------------------------------------------------------ # Function: Prints the hours chart and table # Parameters: - @@ -14675,6 +15008,7 @@ sub HTMLMainPages{ 2 ); } + my $regext = qr/\.(\w{1,6})$/; print "$Center   
    \n"; my $title = @@ -16584,7 +16918,7 @@ if ( $FrameName ne 'index' ) { $filebrowser = 'browsers_phone'; } if ($UpdateStats) { # If update - if ( $LevelForFileTypesDetection < 2 ) { + if ($LevelForFileTypesDetection) { $datatoload{$filemime} = 1; } # Only if need to filter on known extensions if ($LevelForRobotsDetection) { @@ -16934,7 +17268,6 @@ if ($Debug) { my $lastlinenb = 0; my $lastlineoffset = 0; my $lastlineoffsetnext = 0; - if ($Debug) { debug( "UpdateStats is $UpdateStats", 2 ); } if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) { # Update only on index page or when not framed to avoid update twice @@ -17874,24 +18207,10 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) my $PageBool = 1; # Extension - my $extension; - if ( $urlwithnoquery =~ /$regext/o - || ( $urlwithnoquery =~ /[\\\/]$/ && $DefaultFile[0] =~ /$regext/o ) - ) - { - $extension = - ( $LevelForFileTypesDetection >= 2 || $MimeHashFamily{$1} ) - ? lc($1) - : 'Unknown'; - if ( $NotPageList{$extension} ) { $PageBool = 0; } - } - else { - $extension = 'Unknown'; - } - - if ( @NotPageFiles && &NotPageFile( $field[$pos_url] ) ) { - $PageBool = 0; - } + my $extension = Get_Extension($regext, $urlwithnoquery); + if ( $NotPageList{$extension} || + ($MimeHashLib{$extension}[1]) && $MimeHashLib{$extension}[1] ne 'p') { $PageBool = 0;} + if ( @NotPageFiles && &NotPageFile( $field[$pos_url] ) ) { $PageBool = 0; } # Analyze: misc tracker (must be before return code) #--------------------------------------------------- @@ -18006,9 +18325,32 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) if ( $LogType eq 'W' || $LogType eq 'S' ) { # HTTP record or Stream record if ( $ValidHTTPCodes{ $field[$pos_code] } ) { # Code is valid - if ( $field[$pos_code] == 304 && $pos_size>0) { $field[$pos_size] = 0; } - } - else { # Code is not valid + if ( int($field[$pos_code]) == 304 && $pos_size>0) { $field[$pos_size] = 0; } + # track downloads + if (int($field[$pos_code]) == 200 && $MimeHashLib{$extension}[1] eq 'd'){ + $_downloads{$urlwithnoquery}->{'AWSTATS_HITS'}++; + $_downloads{$urlwithnoquery}->{'AWSTATS_SIZE'} += ($pos_size>0 ? int($field[$pos_size]) : 0); + # TODO - debug this - tracking by host this way corrupts and allows other mimes in, may be array related + #$_downloads{$urlwithnoquery}->{$field[$pos_host]}[0] = $timerecord; + #$_downloads{$urlwithnoquery}->{$field[$pos_host]}[1] = $timerecord; + #if ($pos_size>0){$_downloads{$urlwithnoquery}->{$field[$pos_host]}[2] = int($field[$pos_size]);} + if ($Debug) { debug( " New download detected: '$urlwithnoquery'", 2 ); } + } + # handle 206 download continuation message IF we had a successful 200 before, otherwise it goes in errors + }elsif(int($field[$pos_code]) == 206 + #&& $_downloads{$urlwithnoquery}->{$field[$pos_host]}[0] > 0 + && ($MimeHashLib{$extension}[1] eq 'd')){ + $_downloads{$urlwithnoquery}->{'AWSTATS_SIZE'} += ($pos_size>0 ? int($field[$pos_size]) : 0); + $_downloads{$urlwithnoquery}->{'AWSTATS_206'}++; + #$_downloads{$urlwithnoquery}->{$field[$pos_host]}[1] = $timerecord; + if ($pos_size>0){ + #$_downloads{$urlwithnoquery}->{$field[$pos_host]}[2] = int($field[$pos_size]); + $DayBytes{$yearmonthdayrecord} += int($field[$pos_size]); + $_time_k[$hourrecord] += int($field[$pos_size]); + } + $countedtraffic = 6; # 206 continued download, so we track bandwidth but not pages or hits + if ($Debug) { debug( " Download continuation detected: '$urlwithnoquery'", 2 ); } + }else { # Code is not valid if ( $field[$pos_code] !~ /^\d\d\d$/ ) { $field[$pos_code] = 999; } @@ -18176,9 +18518,9 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) # Analyze: File type - Compression #--------------------------------- - if ( !$countedtraffic ) { + if ( !$countedtraffic || $countedtraffic == 6) { if ($LevelForFileTypesDetection) { - $_filetypes_h{$extension}++; + if ($countedtraffic != 6){$_filetypes_h{$extension}++;} if ( $field[$pos_size] ne '-' && $pos_size>0) { $_filetypes_k{$extension} += int( $field[$pos_size] ); } @@ -18238,13 +18580,12 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) # TODO Use an id for hash key of url # $_url_t{$_url_id} } - $_time_h[$hourrecord]++; - $DayHits{$yearmonthdayrecord}++; #Count accesses for hour (hit) - if ( $field[$pos_size] ne '-' && $pos_size>0) { - $_time_k[$hourrecord] += int( $field[$pos_size] ); - $DayBytes{$yearmonthdayrecord} += - int( $field[$pos_size] ); #Count accesses for hour (kb) - } + if ($countedtraffic != 6){$_time_h[$hourrecord]++;} + if ($countedtraffic != 6){$DayHits{$yearmonthdayrecord}++;} #Count accesses for hour (hit) + if ( $field[$pos_size] ne '-' && $pos_size>0) { + $_time_k[$hourrecord] += int( $field[$pos_size] ); + $DayBytes{$yearmonthdayrecord} += int( $field[$pos_size] ); #Count accesses for hour (kb) + } # Analyze: Login #--------------- @@ -18266,8 +18607,7 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) if ($PageBool) { $_login_p{ $field[$pos_logname] }++; } #Count accesses for page (page) - $_login_h{ $field[$pos_logname] } - ++; #Count accesses for page (hit) + if ($countedtraffic != 6){$_login_h{$field[$pos_logname]}++;} #Count accesses for page (hit) if ($pos_size>0){$_login_k{ $field[$pos_logname] } += int( $field[$pos_size] );} #Count accesses for page (kb) $_login_l{ $field[$pos_logname] } = $timerecord; @@ -18280,7 +18620,7 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) my $HostResolved = '' ; # HostResolved will be defined in next paragraf if countedtraffic is true - if ( !$countedtraffic ) { + if ( !$countedtraffic || $countedtraffic == 6) { my $ip = 0; if ($DNSLookup) { # DNS lookup is 1 or 2 if ( $Host =~ /$regipv4l/o ) { # IPv4 lighttpd @@ -18507,7 +18847,7 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) # Store country if ($PageBool) { $_domener_p{$Domain}++; } - $_domener_h{$Domain}++; + if ($countedtraffic != 6){$_domener_h{$Domain}++;} if ( $field[$pos_size] ne '-' && $pos_size>0) { $_domener_k{$Domain} += int( $field[$pos_size] ); } @@ -20077,6 +20417,9 @@ if ( scalar keys %HTMLOutput ) { if ( $HTMLOutput{'keywords'} ) { &HTMLShowKeywords(); } + if ( $HTMLOutput{'downloads'} ) { + &HTMLShowDownloads(); + } foreach my $code ( keys %TrapInfosForHTTPErrorCodes ) { if ( $HTMLOutput{"errors$code"} ) { &HTMLShowErrorCodes($code); @@ -20245,6 +20588,12 @@ if ( scalar keys %HTMLOutput ) { if ($ShowFileSizesStats) { # TODO } + + # BY DOWNLOADS + #------------------------- + if ($ShowDownloadsStats) { + &HTMLMainDownloads($NewLinkParams, $NewLinkTarget); + } # BY PAGE #------------------------- diff --git a/wwwroot/cgi-bin/lang/awstats-en.txt b/wwwroot/cgi-bin/lang/awstats-en.txt index 7a2cc302..40b9e612 100644 --- a/wwwroot/cgi-bin/lang/awstats-en.txt +++ b/wwwroot/cgi-bin/lang/awstats-en.txt @@ -178,4 +178,5 @@ message173=Opera versions message174=Safari versions message175=Chrome versions message176=Konqueror versions -message177=, \ No newline at end of file +message177=, +message178=Downloads \ No newline at end of file diff --git a/wwwroot/cgi-bin/lib/mime.pm b/wwwroot/cgi-bin/lib/mime.pm index 54f8976d..5422fe72 100644 --- a/wwwroot/cgi-bin/lib/mime.pm +++ b/wwwroot/cgi-bin/lib/mime.pm @@ -1,18 +1,21 @@ # AWSTATS MIME DATABASE #------------------------------------------------------- # If you want to add MIME types, -# you must add an entry in MimeFamily and may be MimeHashLib +# you must add an entry in MimeHashLib and assign it to a family #------------------------------------------------------- # $Revision$ - $Author$ - $Date$ #package AWSMIME; - -# MimeHashLib -# List of mime's label ("mime id in lower case", "mime text") +# MimeHashFamily +# This is a hash table of mime groupings and descriptions. +# Report icons will appear if names the same as a family, e.g. +# if you have a "text.png" icon in the icon/mime directory, the +# report will load the icon +# Format: 'family', 'descriptive text', #--------------------------------------------------------------- -%MimeHashLib = ( +%MimeHashFamily = ( 'text', 'Text file', 'page', 'HTML or XML static page', 'script', 'Dynamic Html page or Script file', @@ -24,7 +27,7 @@ 'archive', 'Archive', 'audio', 'Audio file', 'video', 'Video file', -'javascript','JavaScript file', +'jscript', 'JavaScript file', 'vbs', 'Visual Basic script', 'conf', 'Config file', 'css', 'Cascading Style Sheet file', @@ -50,284 +53,152 @@ 'encrypt', 'Encrypted document', ); -# MimeHashIcon -# Each Mime ID is associated to a string that is the name of icon -# file for this Mime type. -#--------------------------------------------------------------------------- -%MimeHashIcon = ( -# Text file -'txt','text', -'log','text', -# HTML Static page -'chm','html', -'html','html', -'htm','html', -'hdml','html', -'mht','html', -'wml','html', -'wmlp','html', -'xhtml','html', -'xml','html', -'vak','glasses', -'sgm','html', -'sgml','html', -# HTML Dynamic pages or script -'asp','script', -'aspx','dotnet', -'ashx','dotnet', -'asmx','dotnet', -'axd', 'dotnet', -'cfm','script', -'jsp','script', -'cgi','script', -'ksh','script', -'php','php', -'php3','php', -'php4','php', -'pl','pl', -'py','script', -'sh','script', -'shtml','html', -'tcl','script', -'xsp','script', -'rss','rss', -# Image -'gif','image', -'png','image', -'bmp','image', -'jpg','image', -'jpeg','image', -'cdr','image', -'ico','image', -'svg','svg', -'psd','phshop', -# Document -'doc','doc', -'wmz','doc', -'rtf','doc', -'pdf','pdf', -'frl','pdf', -'xls','xls', -'ppt','ppt', -'pps','ppt', -'mso','doc', -'sxw','ooffice', -'sxc','ooffice', -'sxi','ooffice', -'sxd','ooffice', -'sxm','ooffice', -'sxg','ooffice', -'csv','other', -'xsl','html', -'lit','lit', -'ai','ai', -'mdb','mdb', -'rpt','crystal', -# Package -'rpm',($LogType eq 'S'?'audio':'archive'), -'deb','archive', -'msi','archive', -# Archive -'7z','archive', -'ace','archive', -'bz2','archive', -'cab','archive', -'emz','archive', -'gz','archive', -'jar','archive', -'lzma','archive', -'rar','archive', -'tar','archive', -'tgz','archive', -'tbz2','archive', -'z','archive', -'zip','archive', -# Audio -'aac','audio', -'flac','audio', -'mp3','audio', -'oga','audio', -'ogg','audio', -'wma','audio', -'wav','audio', -'m4a','audio', -'m3u','audio', -'asf','audio', -# Video -'avi','video', -'divx','video', -'mp4','video', -'m4v','video', -'mpeg','video', -'mpg','video', -'ogv','video', -'ogx','video', -'rm','real', -'swf','flash', -'flv','flash', -'f4v','flash', -'wmv','video', -'wmf','video', -'mov','quicktime', -'qt','quicktime', -# Web scripts -'js','jscript', -'vbs','jscript', -# Config -'cf','other', -'conf','other', -'css','css', -'ini','other', -'dtd','other', -# Program -'exe','script', -'dll','script', -'jnlp','jnlp', -'bin', 'library', -# Fonts -'ttf','ttf', -'fon','fon', -# Encrypted files -'pgp','encrypt', -'gpg','encrypt', -); - - -%MimeHashFamily=( +# MimeHashLib +# This is a hash of arrays where the key is a specific file extension +# and the array is a list of family and file type, e.g. 'd' for download +# If a file does not have a type defined, it is counted as a page. Each +# mime entry can have only one type +# Format: 'extension', ['family', 'type'], +# Valid Types: +# i - image +# d - download +# p - page +#--------------------------------------------------------------- +%MimeHashLib=( # Text file -'txt','text', -'log','text', +'txt',['text','d'], +'log',['text','d'], # HTML Static page -'chm','page', -'html','page', -'htm','page', -'mht','page', -'wml','page', -'wmlp','page', -'xhtml','page', -'xml','page', -'vak','page', -'sgm','page', -'sgml','page', +'chm',['page',''], +'html',['page',''], +'htm',['page',''], +'mht',['page',''], +'wml',['page',''], +'wmlp',['page',''], +'xhtml',['page',''], +'xml',['page',''], +'vak',['page',''], +'sgm',['page',''], +'sgml',['page',''], # HTML Dynamic pages or script -'asp','script', -'aspx','dotnet', -'ashx','dotnet', -'asmx','dotnet', -'axd', 'dotnet', -'cfm','script', -'jsp','script', -'cgi','script', -'ksh','script', -'php','php', -'php3','php', -'php4','php', -'pl','pl', -'py','script', -'sh','script', -'shtml','script', -'tcl','script', -'xsp','script', -'rss','rss', +'asp',['script',''], +'aspx',['dotnet',''], +'ashx',['dotnet',''], +'asmx',['dotnet',''], +'axd', ['dotnet',''], +'cfm',['script',''], +'class',['script',''], +'js',['jscript',''], +'jsp',['script',''], +'cgi',['script',''], +'ksh',['script',''], +'php',['php',''], +'php3',['php',''], +'php4',['php',''], +'pl',['pl',''], +'py',['script',''], +'rss',['rss',''], +'sh',['script',''], +'shtml',['script',''], +'tcl',['script',''], +'xsp',['script',''], +'vbs',['vbs',''], # Image -'gif','image', -'png','image', -'bmp','image', -'jpg','image', -'jpeg','image', -'cdr','image', -'ico','image', -'svg','svg', -'psd','phshop', -'ai','ai', +'gif',['image','i'], +'png',['image','i'], +'bmp',['image','i'], +'jpg',['image','i'], +'jpeg',['image','i'], +'cdr',['image','d'], +'ico',['image','i'], +'svg',['image','i'], # Document -'doc','document', -'wmz','document', -'rtf','document', -'mso','document', -'pdf','pdf', -'frl','pdf', -'xls','document', -'ppt','document', -'pps','document', -'sxw','ooffice', -'sxc','ooffice', -'sxi','ooffice', -'sxd','ooffice', -'sxm','ooffice', -'sxg','ooffice', -'csv','csv', -'xsl','xsl', -'lit','lit', -'mdb','mdb', -'rpt','crystal', +'ai',['document','d'], +'doc',['document','d'], +'wmz',['document','d'], +'rtf',['document','d'], +'mso',['document','d'], +'pdf',['pdf','d'], +'frl',['pdf','d'], +'xls',['document','d'], +'ppt',['document','d'], +'pps',['document','d'], +'psd',['document','d'], +'sxw',['ooffice','d'], +'sxc',['ooffice','d'], +'sxi',['ooffice','d'], +'sxd',['ooffice','d'], +'sxm',['ooffice','d'], +'sxg',['ooffice','d'], +'csv',['csv','d'], +'xsl',['xsl','d'], +'lit',['lit','d'], +'mdb',['mdb',''], +'rpt',['crystal',''], # Package -'rpm',($LogType eq 'S'?'audio':'package'), -'deb','package', -'msi','package', +'rpm',[($LogType eq 'S'?'audio':'package'),'d'], +'deb',['package','d'], +'msi',['package','d'], # Archive -'7z','archive', -'ace','archive', -'bz2','archive', -'cab','archive', -'emz','archive', -'gz','archive', -'jar','archive', -'lzma','archive', -'rar','archive', -'tar','archive', -'tgz','archive', -'tbz2','archive', -'z','archive', -'zip','archive', +'7z',['archive','d'], +'ace',['archive','d'], +'bz2',['archive','d'], +'cab',['archive','d'], +'emz',['archive','d'], +'gz',['archive','d'], +'jar',['archive','d'], +'lzma',['archive','d'], +'rar',['archive','d'], +'tar',['archive','d'], +'tgz',['archive','d'], +'tbz2',['archive','d'], +'z',['archive','d'], +'zip',['archive','d'], # Audio -'aac','audio', -'flac','audio', -'mp3','audio', -'oga','audio', -'ogg','audio', -'wav','audio', -'wma','audio', -'m4a','audio', -'m3u','audio', -'asf','audio', +'aac',['audio','d'], +'flac',['audio','d'], +'mp3',['audio','d'], +'oga',['audio','d'], +'ogg',['audio','d'], +'wav',['audio','d'], +'wma',['audio','d'], +'m4a',['audio','d'], +'m3u',['audio','d'], +'asf',['audio','d'], # Video -'avi','video', -'divx','video', -'mp4','video', -'m4v','video', -'mpeg','video', -'mpg','video', -'ogv','video', -'ogx','video', -'rm','video', -'swf','swf', -'flv','flv', -'f4v','flv', -'wmv','video', -'wmf','video', -'mov','video', -'qt','video', -# Web scripts -'js','javascript', -'vbs','vbs', +'avi',['video','d'], +'divx',['video','d'], +'mp4',['video','d'], +'m4v',['video','d'], +'mpeg',['video','d'], +'mpg',['video','d'], +'ogv',['video','d'], +'ogx',['video','d'], +'rm',['video','d'], +'swf',['swf',''], +'flv',['flv','d'], +'f4v',['flv','d'], +'wmv',['video','d'], +'wmf',['video','d'], +'mov',['video','d'], +'qt',['video','d'], # Config -'cf','conf', -'conf','conf', -'css','css', -'ini','conf', -'dtd','dtd', +'cf',['conf',''], +'conf',['conf',''], +'css',['css',''], +'ini',['conf',''], +'dtd',['dtd',''], # Program -'exe','runtime', -'jnlp','jnlp', -'dll','library', -'bin', 'library', +'exe',['runtime',''], +'jnlp',['jnlp',''], +'dll',['library',''], +'bin',['library',''], # Font -'ttf','ttf', -'fon','fon', +'ttf',['ttf',''], +'fon',['fon',''], # Encrypted files -'pgp','encrypt', -'gpg','encrypt', +'pgp',['encrypt',''], +'gpg',['encrypt',''], );
    - - - -2xx/3xx class - Success -
    -They are SMTP protocols successfull answers + + + + + + +
    +2xx/3xx class - Success +
    +They +are SMTP protocols successfull answers - - +
    + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - +
    200200 Non standard success response -
    Non standard success response
    200200 Non standard +success response +
    +Non +standard success response
    211211 System status, or system help reply -
    System status, or system help reply
    211211 System status, +or system help reply +
    +System +status, or system help reply
    214214 Help message -
    Help message
    214214 Help message +
    +Help +message
    220220 Service ready -
    Service ready
    220220 +Service ready +
    + +Service ready
    221221 Service closing transmission channel -
    Service closing transmission channel
    221221 +Service closing transmission channel +
    + +Service closing transmission channel
    250250 Requested mail action taken and completed -
    Your ISP mail server have successfully executes a command and the DNS is reporting a positive delivery.
    250250 Requested mail +action taken and completed +
    +Your +ISP mail server have successfully executes a command and the DNS is +reporting a positive delivery.
    251251 User not local: will forward to -
    Your message to a specified email address is not local to the mail server, but it will accept and forward the message to a different recipient email address.
    251251 User not +local: will forward to +
    +Your +message to a specified +email address is not local to the mail server, but it will accept and +forward the message to a different recipient email address.
    252252 Recipient cannot be verified -
    Recipient cannot be verified but mail server accepts the message and attempts delivery
    252252 Recipient +cannot be verified +
    +Recipient +cannot be verified but mail server accepts the message and attempts +delivery
    354354 Start mail input and end with . -
    Indicates mail server is ready to accept the message or instruct your mail client to send the message body after the mail server have received the message headers.
    354354 Start mail +input and end with . +
    +Indicates +mail server is ready +to accept the message or instruct your mail client to send the message +body after the mail server have received the message headers.
    - - - -4xx class - Temporary Errors -
    -Those codes are temporary error message. They are used to tell client sender that -an error occured but he can try to solve it but trying again, so in most cases, clients that -receive such codes will keep the mail in their queue and will try again later.
    +4xx class - Temporary Errors +
    +Those +codes are temporary error message. They are used to tell client sender +that +an error occured but he can try to solve it but trying again, so in +most cases, clients that +receive such codes will keep the mail in their queue and will try again +later.
    - - +
    + - - + + - - + + - - + + - - + + - - - - + + + +
    421421 Service not available, closing transmission channel -
    This may be a reply to any command if the service knows it must shut down.
    421421 +Service not available, closing transmission channel +
    +This +may be a reply to any command if the service knows it must shut down.
    450450 Requested mail action not taken: mailbox busy or access denied -
    Your ISP mail server indicates that an email address does not exist or the mailbox is busy. It could be the network connection went down while sending, or it could also happen if the remote mail server does not want to accept mail from you for some reason i.e. (IP address, From address, Recipient, etc.)
    450450 Requested mail +action not taken: mailbox busy or access denied +
    +Your +ISP mail server indicates +that an email address does not exist or the mailbox is busy. It could +be the network connection went down while sending, or it could also +happen if the remote mail server does not want to accept mail from you +for some reason i.e. (IP address, From address, Recipient, etc.)
    451451 Requested mail action aborted: error in processing -
    Your ISP mail server indicates that the mailing has been interrupted, usually due to overloading from too many messages or transient failure is one in which the message sent is valid, but some temporary event prevents the successful sending of the message. Sending in the future may be successful.
    451451 Requested mail +action aborted: error in processing +
    +Your +ISP mail server indicates +that the mailing has been interrupted, usually due to overloading from +too many messages or transient failure is one in which the message sent +is valid, but some temporary event prevents the successful sending of +the message. Sending in the future may be successful.
    452452 Requested mail action not taken: insufficient system storage -
    Your ISP mail server indicates, probable overloading from too many messages and sending in the future may be successful.
    452452 Requested mail +action not taken: insufficient system storage +
    +Your +ISP mail server indicates, probable overloading from too many messages +and sending in the future may be successful.
    453453 Too many messages -
    Some mail servers have the option to reduce the number of concurrent connection and also the number of messages sent per connection. If you have a lot of messages queued up it could go over the max number of messages per connection. To see if this is the case you can try submitting only a few messages to that domain at a time and then keep increasing the number until you find the maximum number accepted by the server.
    453453 Too many +messages +
    +Some +mail servers have the +option to reduce the number of concurrent connection and also the +number of messages sent per connection. If you have a lot of messages +queued up it could go over the max number of messages per connection. +To see if this is the case you can try submitting only a few messages +to that domain at a time and then keep increasing the number until you +find the maximum number accepted by the server.
    - - -5xx class - Permanent Errors -
    -This are permanent error codes. Mail transfer is definitly a failure. No other try will be done. +5xx class - Permanent Errors +
    +This +are permanent error codes. Mail transfer is definitly a failure. No +other try will be done. - - +
    + - - - - - - - - + - - + - - + - - + + - - + + - - + + - - + - - + + + + + + - - + + - - + + + + + - - + + - + +
    500500 Syntax error, command unrecognized or command line too long -
    501501 Syntax error in parameters or arguments -
    502502 Command not implemented +500500 Syntax error, +command unrecognized or command line too long +
    503503 Server encountered bad sequence of commands +501501 Syntax error +in parameters or arguments +
    504504 Command parameter not implemented +502502 Command not +implemented +
    521521 does not accept mail or closing transmission channel -
    You must be pop-authenticated before you can use this SMTP server and you must use your mail address for the Sender/From field.
    503503 Server +encountered bad sequence of commands +
    530530 Access denied -
    A sendmailism ?
    504504 Command +parameter not implemented +
    550550 Requested mail action not taken (Relaying not allowed, Unknown recipient user, ...) -
    Sending an email to recipients outside of your domain are not allowed or your mail server does not know that you have access to use it for relaying messages and authentication is required. Or to prevent the sending of SPAM some mail servers will not allow (relay) send mail to any e-mail using another company’s network and computer resources.
    521521 +does not accept mail or closing transmission channel +
    +You +must be pop-authenticated before you can use this SMTP server and you +must use your mail address for the Sender/From field.
    551551 User not local: please try or Invalid Address: Relay request denied +530530 Access denied +
    +A +sendmailism ?
    552552 Requested mail action aborted: exceeded storage allocation -
    ISP mail server indicates, probable overloading from too many messages.
    550550 Requested mail +action not taken (Relaying not allowed, Unknown recipient user, ...) +
    +Sending +an email to recipients +outside of your domain are not allowed or your mail server does not +know that you have access to use it for relaying messages and +authentication is required. Or to prevent the sending of SPAM some mail +servers will not allow (relay) send mail to any e-mail using another +company’s network and computer resources.
    551551 User not +local: please try or Invalid Address: Relay +request denied +
    553553 Requested mail action not taken: mailbox name not allowed -
    Some mail servers have the option to reduce the number of concurrent connection and also the number of messages sent per connection. If you have a lot of messages queued up (being sent) for a domain, it could go over the maximum number of messages per connection and/or some change to the message and/or destination must be made for successful delivery.
    552552 Requested mail +action aborted: exceeded storage allocation +
    +ISP +mail server indicates, probable overloading from too many messages.
    554554 Requested mail action rejected: access denied +553553 Requested mail +action not taken: mailbox name not allowed +
    +Some +mail servers have the +option to reduce the number of concurrent connection and also the +number of messages sent per connection. If you have a lot of messages +queued up (being sent) for a domain, it could go over the maximum +number of messages per connection and/or some change to the message +and/or destination must be made for successful delivery.
    554554 Requested mail +action rejected: access denied +
    557557 Too many duplicate messages -
    Resource temporarily unavailable Indicates (probable) that there is some kind of anti-spam system on the mail server.
    557557 Too many +duplicate messages +
    +Resource +temporarily unavailable Indicates (probable) that there is some kind of +anti-spam system on the mail server.
    - -
    - - - -

    - - - - - + \ No newline at end of file diff --git a/docs/awstats_what.html b/docs/awstats_what.html index 97e9be52..f2324e38 100644 --- a/docs/awstats_what.html +++ b/docs/awstats_what.html @@ -1,18 +1,15 @@ - - + -AWStats Documentation - What is AWStats - - - + +AWStats Documentation - What is AWStats - +
    @@ -20,7 +17,7 @@ @@ -29,16 +26,13 @@

    -AWStats logfile analyzer 6.95 Documentation
    +AWStats logfile analyzer 6.95 Documentation

      


    -

    What +

    What is AWStats / Features Overview



    AWStats is short for Advanced -Web Statistics. AWStats is powerful +Web Statistics. AWStats is powerful log analyzer which creates advanced web, ftp, mail and streaming server statistics reports  based on the rich data contained in server logs.  Data is graphically presented in easy to read @@ -60,12 +54,10 @@ WebStar and most web, proxy, wap and streaming media servers as well as ftp and mail server logs.

    See how the most famous open source statistics tools (AWStats, Analog, -Webalizer) stack up feature by feature in this comparison +Webalizer) stack up feature by feature in this comparison table.

    -AWStats is free software distributed under the GNU +AWStats is free software distributed under the GNU General Public License. The license chart illustrates what you can and cannot do.
    @@ -104,7 +96,7 @@ Streaming Media browsers..., around 482 with the "p (pages, hits, KB for each OS, 45 OS detected).
    * Robots visits, including -search engine crawlers (381 robots detected).
    +search engine crawlers (381 robots detected).
    * Track Downloads such as PDFs, compressed files and others
    * Search engines, Keywords and Phrases used to find your site (The 122 most famous search engines are detected like Yahoo, Google, Altavista, etc...)
    @@ -154,8 +146,7 @@ files.
    web-hosting providers).
    * Cross Site Scripting Attacks protection.
    -* Reports available in many international languages. See AWStats F.A.Q. for full list.  +* Reports available in many international languages. See AWStats F.A.Q. for full list.  Users can provide files for additional languages not yet available.
    * No need for esoteric perl libraries. AWStats works with all basic perl interpreters.
    @@ -184,8 +175,7 @@ perform * You must be able to run perl scripts (.pl files) from command line and/or as a CGI.  If not, you can solve this by downloading latest Perl version at ActivePerl -(Win32) or Perl.com +(Win32) or Perl.com (Unix/Linux/Other).
    See AWStats F.A.Q. for examples of supported OS and Web servers.
    @@ -203,5 +193,4 @@ First version of this tool was designed to analyze folowing web sites:   - - + \ No newline at end of file diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index 194f8b78..f4fd2925 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -1015,7 +1015,12 @@ ShowFileTypesStats=HB # Show file size chart (Not yet available) # Context: Web, Streaming, Mail, Ftp # Default: 1, Possible column codes: None -ShowFileSizesStats=0 +ShowFileSizesStats=0 + +# Show downloads chart. +# Context: Web, Streaming, Ftp +# Default: HB, Possible column codes: HB +ShowDownloadsStats=HB # Show operating systems chart # Context: Web, Streaming, Ftp @@ -1107,6 +1112,9 @@ MinHitLogin = 1 # Stats by robots MaxNbOfRobotShown = 10 MinHitRobot = 1 +# Stats for Downloads +MaxNbOfDownloadsShown = 10 +MinHitDownloads = 1 # Stats by pages MaxNbOfPageShown = 10 MinHitFile = 1 diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index d02fa233..a7c12445 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -238,7 +238,7 @@ use vars qw/ $WarningMessages $ShowLinksOnUrl $UseFramesWhenCGI $ShowMenu $ShowSummary $ShowMonthStats $ShowDaysOfMonthStats $ShowDaysOfWeekStats $ShowHoursStats $ShowDomainsStats $ShowHostsStats - $ShowRobotsStats $ShowSessionsStats $ShowPagesStats $ShowFileTypesStats + $ShowRobotsStats $ShowSessionsStats $ShowPagesStats $ShowFileTypesStats $ShowDownloadsStats $ShowOSStats $ShowBrowsersStats $ShowOriginStats $ShowKeyphrasesStats $ShowKeywordsStats $ShowMiscStats $ShowHTTPErrorsStats $AddDataArrayMonthStats $AddDataArrayShowDaysOfMonthStats $AddDataArrayShowDaysOfWeekStats $AddDataArrayShowHoursStats @@ -263,6 +263,7 @@ use vars qw/ $ShowSessionsStats, $ShowPagesStats, $ShowFileTypesStats, + $ShowDownloadsStats, $ShowOSStats, $ShowBrowsersStats, $ShowOriginStats, @@ -474,7 +475,7 @@ use vars qw/ use vars qw/ %BrowsersHashIDLib %BrowsersHashIcon %BrowsersHereAreGrabbers %DomainsHashIDLib - %MimeHashLib %MimeHashIcon %MimeHashFamily + %MimeHashLib %MimeHashFamily %OSHashID %OSHashLib %RobotsHashIDLib %RobotsAffiliateLib %SearchEnginesHashID %SearchEnginesHashLib %SearchEnginesWithKeysNotInQuery %SearchEnginesKnownUrl %NotSearchEnginesKeys @@ -520,6 +521,7 @@ use vars qw/ %_misc_p %_misc_h %_misc_k %_cluster_p %_cluster_h %_cluster_k %_se_referrals_p %_se_referrals_h %_sider404_h %_referer404_h %_url_p %_url_k %_url_e %_url_x + %_downloads %_unknownreferer_l %_unknownrefererbrowser_l %_emails_h %_emails_k %_emails_l %_emailr_h %_emailr_k %_emailr_l /; @@ -721,7 +723,8 @@ use vars qw/ @Message /; 'Safari versions', 'Chrome versions', 'Konqueror versions', - ' ' + ',', + 'Downloads', ); #------------------------------------------------------------------------------ @@ -1596,6 +1599,52 @@ sub GetSessionRange { return $SessionsRange[6]; } +#------------------------------------------------------------------------------ +# Function: Return string with just the extension of a file in the URL +# Parameters: $regext, $url without query string +# Input: None +# Output: None +# Return: A lowercase string with the name of the extension, e.g. "html" +#------------------------------------------------------------------------------ +sub Get_Extension{ + my $extension; + my $regext = shift; + my $urlwithnoquery = shift; + if ( $urlwithnoquery =~ /$regext/o + || ( $urlwithnoquery =~ /[\\\/]$/ && $DefaultFile[0] =~ /$regext/o ) + ) + { + $extension = + ( $LevelForFileTypesDetection >= 2 || $MimeHashLib{$1} ) + ? lc($1) + : 'Unknown'; + } + else { + $extension = 'Unknown'; + } + return $extension; +} + +#------------------------------------------------------------------------------ +# Function: Returns just the file of the url +# Parameters: - +# Input: $url +# Output: String with the file name +# Return: - +#------------------------------------------------------------------------------ +sub Get_Filename{ + my $temp = shift; + my $idx = -1; + # check for slash + $idx = rindex($temp, "/"); + if ($idx > -1){ $temp = substr($temp, $idx+1);} + else{ + $idx = rindex($temp, "\\"); + if ($idx > -1){ $temp = substr($temp, $idx+1);} + } + return $temp; +} + #------------------------------------------------------------------------------ # Function: Compare two browsers version # Parameters: $a @@ -2666,6 +2715,7 @@ sub Check_Config { if ( $ShowSessionsStats !~ /[01]/ ) { $ShowSessionsStats = 1; } if ( $ShowPagesStats !~ /[01PBEX]/i ) { $ShowPagesStats = 'PBEX'; } if ( $ShowFileTypesStats !~ /[01HBC]/ ) { $ShowFileTypesStats = 'HB'; } + if ( $ShowDownloadsStats !~ /[01HB]/ ) { $ShowDownloadsStats = 'HB';} if ( $ShowFileSizesStats !~ /[01]/ ) { $ShowFileSizesStats = 1; } if ( $ShowOSStats !~ /[01]/ ) { $ShowOSStats = 1; } if ( $ShowBrowsersStats !~ /[01]/ ) { $ShowBrowsersStats = 1; } @@ -2695,7 +2745,7 @@ sub Check_Config { 'OsShown', 'BrowsersShown', 'ScreenSizesShown', 'RefererShown', 'KeyphrasesShown', 'KeywordsShown', - 'EMailsShown' + 'EMailsShown', 'DownloadsShown' ); my @maxnboflistdefaultval = ( 10, 10, 10, 10, 5, 10, 10, 10, 5, 10, 10, 10, 20 ); @@ -2711,7 +2761,7 @@ sub Check_Config { 'Domain', 'Host', 'Login', 'Robot', 'Worm', 'File', 'Os', 'Browser', 'ScreenSize', 'Refer', 'Keyphrase', 'Keyword', - 'EMail' + 'EMail', 'Downloads' ); my @minhitlistdefaultval = ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ); foreach my $i ( 0 .. ( @minhitlist - 1 ) ) { @@ -2811,6 +2861,7 @@ sub Check_Config { if ( $ShowWormsStats eq '1' ) { $ShowWormsStats = 'HBL'; } if ( $ShowPagesStats eq '1' ) { $ShowPagesStats = 'PBEX'; } if ( $ShowFileTypesStats eq '1' ) { $ShowFileTypesStats = 'HB'; } + if ( $ShowDownloadsStats eq '1' ) { $ShowDownloadsStats = 'HB';} if ( $ShowOriginStats eq '1' ) { $ShowOriginStats = 'PH'; } if ( $ShowClusterStats eq '1' ) { $ShowClusterStats = 'PHB'; } if ( $ShowMiscStats eq '1' ) { $ShowMiscStats = 'anjdfrqwp'; } @@ -3276,17 +3327,18 @@ sub Read_History_With_TmpUpdate { 'session' => 13, 'sider' => 14, 'filetypes' => 15, - 'os' => 16, - 'browser' => 17, - 'screensize' => 18, - 'unknownreferer' => 19, - 'unknownrefererbrowser' => 20, - 'origin' => 21, - 'sereferrals' => 22, - 'pagerefs' => 23, - 'searchwords' => 24, - 'keywords' => 25, - 'errors' => 26 + 'downloads' => 16, + 'os' => 17, + 'browser' => 18, + 'screensize' => 19, + 'unknownreferer' => 20, + 'unknownrefererbrowser' => 21, + 'origin' => 22, + 'sereferrals' => 23, + 'pagerefs' => 24, + 'searchwords' => 25, + 'keywords' => 26, + 'errors' => 27, ); my $order = ( scalar keys %allsections ) + 1; @@ -3411,6 +3463,14 @@ sub Read_History_With_TmpUpdate { { $SectionsToLoad{'filetypes'} = $order++; } + + if ( $UpdateStats + || $MigrateStats + || ($HTMLOutput{'main'} && $ShowDownloadsStats ) + || $HTMLOutput{'downloads'} ) + { + $SectionsToLoad{'downloads'} = $order++; + } if ( $UpdateStats || $MigrateStats || ( $HTMLOutput{'main'} && $ShowOSStats ) @@ -5259,6 +5319,62 @@ sub Read_History_With_TmpUpdate { next; } + # BEGIN_DOWNLOADS + if ( $field[0] eq 'BEGIN_DOWNLOADS' ) { + if ($Debug) { + debug(" Begin of DOWNLOADS section"); + } + $field[0] = ''; + my $count = 0; + my $counttoload = int($field[1]); + my $countloaded = 0; + do { + if ( $field[0] ) { + $count++; + if ( $SectionsToLoad{'downloads'}) { + $countloaded++; + $_downloads{$field[0]}->{'AWSTATS_HITS'} += int( $field[1] ); + $_downloads{$field[0]}->{'AWSTATS_206'} += int( $field[2] ); + $_downloads{$field[0]}->{'AWSTATS_SIZE'} += int( $field[3] ); + } + } + $_ = ; + chomp $_; + s/\r//; + @field = + split( /\s+/, + ( $readxml ? XMLDecodeFromHisto($_) : $_ ) ); + $countlines++; + } until ( $field[0] eq 'END_DOWNLOADS' + || $field[0] eq "${xmleb}END_DOWNLOADS" + || !$_ ); + if ( $field[0] ne 'END_DOWNLOADS' + && $field[0] ne "${xmleb}END_DOWNLOADS" ) + { + error( +"History file \"$filetoread\" is corrupted (End of section DOWNLOADS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).", + "", "", 1 + ); + } + if ($Debug) { + debug( +" End of DOWNLOADS section ($count entries, $countloaded loaded)" + ); + } + delete $SectionsToLoad{'downloads'}; + if ( $SectionsToSave{'downloads'} ) { + Save_History( 'downloads', + $year, $month, $date ); + delete $SectionsToSave{'downloads'}; + if ($withpurge) { %_downloads = (); } + } + if ( !scalar %SectionsToLoad ) { + debug(" Stop reading history file. Got all we need."); + last; + } + next; + } + # BEGIN_SEREFERRALS if ( $field[0] eq 'BEGIN_SEREFERRALS' ) { if ($Debug) { debug(" Begin of SEREFERRALS section"); } @@ -6166,6 +6282,9 @@ sub Save_History { print HISTORYTMP "${xmlrb}POS_FILETYPES${xmlrs}"; $PosInFile{"filetypes"} = tell HISTORYTMP; print HISTORYTMP "$spacebar${xmlre}\n"; + print HISTORYTMP "${xmlrb}POS_DOWNLOADS${xmlrs}"; + $PosInFile{'downloads'} = tell HISTORYTMP; + print HISTORYTMP "$spacebar${xmlre}\n"; print HISTORYTMP "${xmlrb}POS_OS${xmlrs}"; $PosInFile{"os"} = tell HISTORYTMP; print HISTORYTMP "$spacebar${xmlre}\n"; @@ -6763,6 +6882,30 @@ sub Save_History { } print HISTORYTMP "${xmleb}END_FILETYPES${xmlee}\n"; } + if ( $sectiontosave eq 'downloads' ) { + print HISTORYTMP "\n"; + if ($xml) { + print HISTORYTMP "
    \n"; + } + print HISTORYTMP "# Downloads - Hits - Bandwidth\n"; + $ValueInFile{$sectiontosave} = tell HISTORYTMP; + print HISTORYTMP "${xmlbb}BEGIN_DOWNLOADS${xmlbs}" + . ( scalar keys %_downloads ) + . "${xmlbe}\n"; + for my $u (sort {$_downloads{$b}->{'AWSTATS_HITS'} <=> $_downloads{$a}->{'AWSTATS_HITS'}}(keys %_downloads) ){ + #if (!$_downloads{$u}->{'AWSTATS_HITS'}){next;} # TODO - fix some strange bug where other files are getting in to the hash + print HISTORYTMP "${xmlrb}" + . XMLEncodeForHisto($u) + . "${xmlrs}" + . XMLEncodeForHisto($_downloads{$u}->{'AWSTATS_HITS'} || 0) + . "${xmlrs}" + . XMLEncodeForHisto($_downloads{$u}->{'AWSTATS_206'} || 0) + ."${xmlrs}" + . XMLEncodeForHisto($_downloads{$u}->{'AWSTATS_SIZE'} || 0) + ."${xmlre}\n"; + } + print HISTORYTMP "${xmleb}END_DOWNLOADS${xmlee}\n"; + } if ( $sectiontosave eq 'os' ) { print HISTORYTMP "\n"; if ($xml) { @@ -7542,6 +7685,7 @@ sub Init_HashArray { %_cluster_p = %_cluster_h = %_cluster_k = (); %_se_referrals_p = %_se_referrals_h = %_sider404_h = %_referer404_h = %_url_p = %_url_k = %_url_e = %_url_x = (); + %_downloads = (); %_unknownreferer_l = %_unknownrefererbrowser_l = (); %_emails_h = %_emails_k = %_emails_l = %_emailr_h = %_emailr_k = %_emailr_l = (); @@ -8849,11 +8993,12 @@ sub DefinePerlParsingFormat { $LogFormatString =~ s/s-cache-info/%other/g; $LogFormatString =~ s/cluster-node/%cluster/g; $LogFormatString =~ s/s-sitename/%other/g; - $LogFormatString =~ s/s-ip/%other/g; - $LogFormatString =~ s/s-port/%other/g; - $LogFormatString =~ s/cs\(Cookie\)/%other/g; - $LogFormatString =~ s/sc-substatus/%other/g; - $LogFormatString =~ s/sc-win32-status/%other/g; + $LogFormatString =~ s/s-ip/%other/g; + $LogFormatString =~ s/s-port/%other/g; + $LogFormatString =~ s/cs\(Cookie\)/%other/g; + $LogFormatString =~ s/sc-substatus/%other/g; + $LogFormatString =~ s/sc-win32-status/%other/g; + # Added for MMS $LogFormatString =~ @@ -9963,7 +10108,7 @@ sub HTMLMenu{ $ShowSessionsStats, $ShowPagesStats, $ShowFileTypesStats, $ShowFileSizesStats, $ShowOSStats, $ShowBrowsersStats, - $ShowScreenSizeStats + $ShowScreenSizeStats, $ShowDownloadsStats ); if ($linetitle) { print "
    $Message[117]"; print( $frame? "
    " : "" ); print "$Message[73]"; print( $frame? "
    " : "" ); + print +"$Message[178]"; + print( $frame? "
      \"...\" " + : "" + ); + print "$Message[80]\n"; + print( $frame? "
    " : "" ); print @@ -10268,6 +10432,7 @@ sub HTMLMenu{ # Return: - #------------------------------------------------------------------------------ sub HTMLMainFileType{ + if (!$LevelForFileTypesDetection > 0){return;} if ($Debug) { debug( "ShowFileTypesStatsCompressionStats", 2 ); } print "$Center 
    \n"; my $Totalh = 0; @@ -10350,9 +10515,8 @@ sub HTMLMainFileType{ . " />
    $Message[0]
    $Message[178]$Message[57]206 $Message[57]$Message[75]$Message[106]
    "; + &HTMLShowURLInfo($u); + print "".Format_Number($_downloads{$u}->{'AWSTATS_HITS'})."".Format_Number($_downloads{$u}->{'AWSTATS_206'})."".Format_Bytes($_downloads{$u}->{'AWSTATS_SIZE'})."".Format_Bytes(($_downloads{$u}->{'AWSTATS_SIZE'}/ + ($_downloads{$u}->{'AWSTATS_HITS'} + $_downloads{$u}->{'AWSTATS_206'})))."
    "; + my $function = "ShowGraph_$pluginname"; + &$function( + "$Message[80]", "downloads", + 0, \@blocklabel, + 0, \@valcolor, + 0, 0, + 0, \@valdata + ); + print "
    $Message[178]: $total_dls$Message[57]206 $Message[57]$Message[75]$Message[106]
    "; + &HTMLShowURLInfo($u); + print "".Format_Number($_downloads{$u}->{'AWSTATS_HITS'})."".Format_Number($_downloads{$u}->{'AWSTATS_206'})."".Format_Bytes($_downloads{$u}->{'AWSTATS_SIZE'})."".Format_Bytes(($_downloads{$u}->{'AWSTATS_SIZE'}/ + ($_downloads{$u}->{'AWSTATS_HITS'} + $_downloads{$u}->{'AWSTATS_206'})))."