PK Ä%2 WEB-INF/PK Ä„%2 WEB-INF/cgi-bin/PK Ä%2ïÙ:0 WEB-INF/cgi-bin/awredir.pl#!/usr/bin/perl #------------------------------------------------------- # Save the click done on managed hits into a trace file # and return to browser a redirector to tell browser to visit this URL. # Ex: XXX #------------------------------------------------------- #use DBD::mysql; #------------------------------------------------------- # Defines #------------------------------------------------------- use vars qw/ $REVISION $VERSION /; $REVISION='$Revision: 1.1 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.1 (build $REVISION)"; use vars qw / $DIR $PROG $Extension $DEBUG $DEBUGFILE $REPLOG $DEBUGRESET $SITE $REPCONF /; ($DIR=$0) =~ s/([^\/\\]*)$//; ($PROG=$1) =~ s/\.([^\.]*)$//; $Extension=$1; $DEBUG=0; # Debug level $DEBUGFILE="$PROG.log"; # Debug output (A log file name or "screen" to have debug on screen) $REPLOG="$DIR"; # Debug directory $TRACEBASE=0; # Set to 1 to track click on links that point to extern site into a database $TRACEFILE=0; # Set to 1 to track click on links that point to extern site into a file $TXTDIR="$DIR/../../../logs"; # Directory where to write tracking file (if TRACEFILE=1) $TXTFILE="awredir.trc"; # Tracking file (if TRACEFILE=1) $EXCLUDEIP="127.0.0.1"; #------------------------------------------------------- # Functions #------------------------------------------------------- sub error { print "Content-type: text/html; charset=iso-8859-1\n"; print "\n"; print "\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print ") : # # # # # If code is not added in index page, all those detection capabilities will be # disabled. You must also check that ShowScreenSizeStats and ShowMiscStats # parameters are set to 1 to make results appear in AWStats report page. # If you want to use another directory than /js/, you must also change the # awstatsmisctrackerurl variable into the awstats_misc_tracker.js file. # Change : Effective for new updates only. # Possible value: URL of javascript tracker file added in your HTML code. # Default: "/js/awstats_misc_tracker.js" # MiscTrackerUrl="/js/awstats_misc_tracker.js" #----------------------------------------------------------------------------- # OPTIONAL ACCURACY SETUP SECTION (Not required but increase AWStats features) #----------------------------------------------------------------------------- # Following values allows you to define accuracy of AWStats entities (robots, # browsers, os, referers, file types) detection. # It might be a good idea for large web sites or ISP that provides AWStats to # high number of customers, to set this parameter to 1 (or 0), instead of 2. # Possible values: # 0 = No detection, # 1 = Medium/Standard detection # 2 = Full detection # Change : Effective for new updates only # Default: 2 (0 for LevelForWormsDetection) # LevelForBrowsersDetection=2 # 0 disables Browsers detection. # 2 reduces AWStats speed by 2% LevelForOSDetection=2 # 0 disables OS detection. # 2 reduces AWStats speed by 3% LevelForRefererAnalyze=2 # 0 disables Origin detection. # 2 reduces AWStats speed by 14% LevelForRobotsDetection=2 # 0 disables Robots detection. # 2 reduces AWStats speed by 2.5% LevelForSearchEnginesDetection=2 # 0 disables Search engines detection. # 2 reduces AWStats speed by 9% LevelForKeywordsDetection=2 # 0 disables Keyphrases/Keywords detection. # 2 reduces AWStats speed by 1% LevelForFileTypesDetection=2 # 0 disables File types detection. # 2 reduces AWStats speed by 1% LevelForWormsDetection=0 # 0 disables Worms detection. # 2 reduces AWStats speed by 15% #----------------------------------------------------------------------------- # OPTIONAL APPEARANCE SETUP SECTION (Not required but increase AWStats features) #----------------------------------------------------------------------------- # When you use AWStats as a CGI, you can have the reports shown in HTML frames. # Frames are only available for report viewed dynamically. When you build # pages from command line, this option is not used and no frames are built. # Possible values: 0 or 1 # Default: 1 # UseFramesWhenCGI=1 # This parameter ask your browser to open detailed reports into a different # window than the main page. # Possible values: # 0 - Open all in same browser window # 1 - Open detailed reports in another window except if using frames # 2 - Open always in a different window even if reports are framed # Default: 1 # DetailedReportsOnNewWindows=1 # You can add, in the HTML report page, a cache lifetime (in seconds) that # will be returned to browser in HTTP header answer by server. # This parameter is not used when report are built with -staticlinks option. # Example: 3600 # Default: 0 # Expires=0 # To avoid too large web pages, you can ask AWStats to limit number of rows of # all reported charts to this number when no other limit apply. # Default: 1000 # MaxRowsInHTMLOutput=1000 # Set your primary language (ISO-639-1 language codes). # Possible value: # Albanian=al, Bosnian=ba, Bulgarian=bg, Catalan=ca, # Chinese (Taiwan)=tw, Chinese (Simpliefied)=cn, Czech=cz, Danish=dk, # Dutch=nl, English=en, Estonian=et, Euskara=eu, Finnish=fi, # French=fr, Galician=gl, German=de, Greek=gr, Hebrew=he, Hungarian=hu, # Icelandic=is, Indonesian=id, Italian=it, Japanese=jp, Korean=kr, # Latvian=lv, Norwegian (Nynorsk)=nn, Norwegian (Bokmal)=nb, Polish=pl, # Portuguese=pt, Portuguese (Brazilian)=br, Romanian=ro, Russian=ru, # Serbian=sr, Slovak=sk, Slovenian=si, Spanish=es, Swedish=se, Turkish=tr, # Ukrainian=ua, Welsh=cy. # First available language accepted by browser=auto # Default: "auto" # Lang="auto" # Set the location of language files. # Example: "/usr/share/awstats/lang" # Default: "./lang" (means lang directory is in same location than awstats.pl) # DirLang="./lang" # Show menu header with reports' links # Possible values: 0 or 1 # Default: 1 # ShowMenu=1 # You choose here which reports you want to see in the main page and what you # want to see in those reports. # Possible values: # 0 - Report is not shown at all # 1 - Report is shown in main page with an entry in menu and default columns # XYZ - Report shows column informations defined by code X,Y,Z... # X,Y,Z... are code letters among the following: # U = Unique visitors # V = Visits # P = Number of pages # H = Number of hits (or mails) # B = Bandwith (or total mail size for mail logs) # L = Last access date # E = Entry pages # X = Exit pages # C = Web compression (mod_gzip,mod_deflate) # M = Average mail size (mail logs) # # Show monthly chart # Context: Web, Streaming, Mail, Ftp # Default: UVPHB, Possible column codes: UVPHB ShowMonthStats=UVPHB # Show days of month chart # Context: Web, Streaming, Mail, Ftp # Default: VPHB, Possible column codes: VPHB ShowDaysOfMonthStats=VPHB # Show days of week chart # Context: Web, Streaming, Mail, Ftp # Default: PHB, Possible column codes: PHB ShowDaysOfWeekStats=PHB # Show hourly chart # Context: Web, Streaming, Mail, Ftp # Default: PHB, Possible column codes: PHB ShowHoursStats=PHB # Show domains/country chart # Context: Web, Streaming, Mail, Ftp # Default: PHB, Possible column codes: PHB ShowDomainsStats=PHB # Show hosts chart # Context: Web, Streaming, Mail, Ftp # Default: PHBL, Possible column codes: PHBL ShowHostsStats=PHBL # Show authenticated users chart # Context: Web, Streaming, Ftp # Default: 0, Possible column codes: PHBL ShowAuthenticatedUsers=0 # Show robots chart # Context: Web, Streaming # Default: HBL, Possible column codes: HBL ShowRobotsStats=HBL # Show worms chart # Context: Web, Streaming # Default: 0 (If set to 1, see also LevelForWormsDetection), Possible column codes: HBL ShowWormsStats=0 # Show email senders chart (For use when analyzing mail log files) # Context: Mail # Default: 0, Possible column codes: HBML ShowEMailSenders=0 # Show email receivers chart (For use when analyzing mail log files) # Context: Mail # Default: 0, Possible column codes: HBML ShowEMailReceivers=0 # Show session chart # Context: Web, Streaming, Ftp # Default: 1, Possible column codes: None ShowSessionsStats=1 # Show pages-url chart. # Context: Web, Streaming, Ftp # Default: PBEX, Possible column codes: PBEX ShowPagesStats=PBEX # Show file types chart. # Context: Web, Streaming, Ftp # Default: HB, Possible column codes: HBC ShowFileTypesStats=HB # Show file size chart (Not yet available) # Context: Web, Streaming, Mail, Ftp # Default: 1, Possible column codes: None ShowFileSizesStats=0 # Show operating systems chart # Context: Web, Streaming, Ftp # Default: 1, Possible column codes: None ShowOSStats=1 # Show browsers chart # Context: Web, Streaming # Default: 1, Possible column codes: None ShowBrowsersStats=1 # Show screen size chart # Context: Web, Streaming # Default: 0 (If set to 1, see also MiscTrackerUrl), Possible column codes: None ShowScreenSizeStats=0 # Show origin chart # Context: Web, Streaming # Default: PH, Possible column codes: PH ShowOriginStats=PH # Show keyphrases chart # Context: Web, Streaming # Default: 1, Possible column codes: None ShowKeyphrasesStats=1 # Show keywords chart # Context: Web, Streaming # Default: 1, Possible column codes: None ShowKeywordsStats=1 # Show misc chart # Context: Web, Streaming # Default: a (See also MiscTrackerUrl parameter), Possible column codes: anjdfrqwp ShowMiscStats=a # Show http errors chart # Context: Web, Streaming # Default: 1, Possible column codes: None ShowHTTPErrorsStats=1 # Show smtp errors chart (For use when analyzing mail log files) # Context: Mail # Default: 0, Possible column codes: None ShowSMTPErrorsStats=0 # Show the cluster report (Your LogFormat must contains the %cluster tag) # Context: Web, Streaming, Ftp # Default: 0, Possible column codes: PHB ShowClusterStats=0 # Some graphical reports are followed by the data array of values. # If you don't want this array (to reduce report size for example), you can # set thoose options to 0. # Possible values: 0 or 1 # Default: 1 # # Data array values for the ShowMonthStats report AddDataArrayMonthStats=1 # Data array values for the ShowDaysOfMonthStats report AddDataArrayShowDaysOfMonthStats=1 # Data array values for the ShowDaysOfWeekStats report AddDataArrayShowDaysOfWeekStats=1 # Data array values for the ShowHoursStats report AddDataArrayShowHoursStats=1 # In the Origin chart, you have stats on where your hits came from. You can # includes hits on pages that comes from pages of same sites in this chart. # Possible values: 0 or 1 # Default: 0 # IncludeInternalLinksInOriginSection=0 # Following parameter can be used to choose maximum number of lines shown for # the particular following report. # # Stats by countries/domains MaxNbOfDomain = 10 MinHitDomain = 1 # Stats by hosts MaxNbOfHostsShown = 10 MinHitHost = 1 # Stats by authenticated users MaxNbOfLoginShown = 10 MinHitLogin = 1 # Stats by robots MaxNbOfRobotShown = 10 MinHitRobot = 1 # Stats by pages MaxNbOfPageShown = 10 MinHitFile = 1 # Stats by OS MaxNbOfOsShown = 10 MinHitOs = 1 # Stats by browsers MaxNbOfBrowsersShown = 10 MinHitBrowser = 1 # Stats by screen size MaxNbOfScreenSizesShown = 5 MinHitScreenSize = 1 # Stats by window size (following 2 parameters are not yet used) MaxNbOfWindowSizesShown = 5 MinHitWindowSize = 1 # Stats by referers MaxNbOfRefererShown = 10 MinHitRefer = 1 # Stats for keyphrases MaxNbOfKeyphrasesShown = 10 MinHitKeyphrase = 1 # Stats for keywords MaxNbOfKeywordsShown = 10 MinHitKeyword = 1 # Stats for sender or receiver emails MaxNbOfEMailsShown = 20 MinHitEMail = 1 # Choose if you want the week report to start on sunday or monday # Possible values: # 0 - Week start on sunday # 1 - Week start on monday # Default: 1 # FirstDayOfWeek=1 # List of visible flags that links to other language translations. # See Lang parameter for list of allowed flag/language codes. # If you don't want any flag link, set ShowFlagLinks to "". # This parameter is used only if ShowMenu parameter is set to 1. # Possible values: "" or "language_codes_separated_by_space" # Example: "en es fr nl de" # Default: "" # ShowFlagLinks="" # Each URL, shown in stats report views, are links you can click. # Possible values: 0 or 1 # Default: 1 # ShowLinksOnUrl=1 # When AWStats build HTML links in its report pages, it starts thoose link # with "http://". However some links might be HTTPS links, so you can enter # here the root of all your HTTPS links. If all your site is a SSL web site, # just enter "/". # This parameter is not used if ShowLinksOnUrl is 0. # Example: "/shopping" # Example: "/" # Default: "" # UseHTTPSLinkForUrl="" # Maximum length of URL part shown on stats page (number of characters). # This affects only URL visible text, link still work. # Default: 64 # MaxLengthOfShownURL=64 # You can enter HTML code that will be added at the top of AWStats reports. # Default: "" # HTMLHeadSection="" # You can enter HTML code that will be added at the end of AWStats reports. # Great to add advert ban. # Default: "" # HTMLEndSection="" # You can set Logo and LogoLink to use your own logo. # Logo must be the name of image file (must be in $DirIcons/other directory). # LogoLink is the expected URL when clicking on Logo. # Default: "awstats_logo6.png" # Logo="awstats_logo6.png" LogoLink="http://awstats.sourceforge.net" # Value of maximum bar width/height for horizontal/vertical HTML graphics bar. # Default: 260/90 # BarWidth = 260 BarHeight = 90 # You can ask AWStats to use a particular CSS (Cascading Style Sheet) to # change its look. To create a style sheet, you can use samples provided with # AWStats in wwwroot/css directory. # Example: "/awstatscss/awstats_bw.css" # Example: "/css/awstats_bw.css" # Default: "" # StyleSheet="" # Those colors parameters can be used (if StyleSheet parameter is not used) # to change AWStats look. # Example: color_name="RRGGBB" # RRGGBB is Red Green Blue components in Hex # color_Background="FFFFFF" # Background color for main page (Default = "FFFFFF") color_TableBGTitle="CCCCDD" # Background color for table title (Default = "CCCCDD") color_TableTitle="000000" # Table title font color (Default = "000000") color_TableBG="CCCCDD" # Background color for table (Default = "CCCCDD") color_TableRowTitle="FFFFFF" # Table row title font color (Default = "FFFFFF") color_TableBGRowTitle="ECECEC" # Background color for row title (Default = "ECECEC") color_TableBorder="ECECEC" # Table border color (Default = "ECECEC") color_text="000000" # Color of text (Default = "000000") color_textpercent="606060" # Color of text for percent values (Default = "606060") color_titletext="000000" # Color of text title within colored Title Rows (Default = "000000") color_weekend="EAEAEA" # Color for week-end days (Default = "EAEAEA") color_link="0011BB" # Color of HTML links (Default = "0011BB") color_hover="605040" # Color of HTML on-mouseover links (Default = "605040") color_u="FFAA66" # Background color for number of unique visitors (Default = "FFAA66") color_v="F4F090" # Background color for number of visites (Default = "F4F090") color_p="4477DD" # Background color for number of pages (Default = "4477DD") color_h="66DDEE" # Background color for number of hits (Default = "66DDEE") color_k="2EA495" # Background color for number of bytes (Default = "2EA495") color_s="8888DD" # Background color for number of search (Default = "8888DD") color_e="CEC2E8" # Background color for number of entry pages (Default = "CEC2E8") color_x="C1B2E2" # Background color for number of exit pages (Default = "C1B2E2") #----------------------------------------------------------------------------- # PLUGINS #----------------------------------------------------------------------------- # Add here all plugins file you want to load. # Plugin files must be .pm files stored in 'plugins' directory. # Uncomment LoadPlugin lines to enable a plugin after checking that perl # modules required by the plugin are installed. # Plugin: Tooltips # Perl modules required: None # Add some tooltips help on HTML report pages. # Note that enabled this kind of help will increased HTML report pages size, # so server load and bandwidth. # #LoadPlugin="tooltips" # Plugin: DecodeUTFKeys # Perl modules required: Encode and URI::Escape # Allow AWStats to show correctly (in language charset) keywords/keyphrases # strings even if they were UTF8 coded by the referer search engine. # #LoadPlugin="decodeutfkeys" # Plugin: IPv6 # Perl modules required: Net::IP and Net::DNS # This plugin gives AWStats capability to make reverse DNS lookup on IPv6 # addresses. # Note: If you are interesting in having country report, you should use the # geoipfree or geoip plugin instead of enabled reverse DNS lookup. # #LoadPlugin="ipv6" # Plugin: HashFiles # Perl modules required: Storable # AWStats DNS cache files are read/saved as native hash files. This increase # DNS cache files loading speed, above all for very large web sites. # #LoadPlugin="hashfiles" # Plugin: GeoIP # Perl modules required: Geo::IP or Geo::IP::PurePerl (from Maxmind) # Country chart is built from an Internet IP-Country database. # This plugin is useless for intranet only log files. # Note: You must choose between using this plugin (need Perl Geo::IP module # from Maxmind, database more up to date) or the GeoIPfree plugin (need # Perl Geo::IPfree module, database less up to date). # This plugin reduces AWStats speed of 8% ! # #LoadPlugin="geoip GEOIP_STANDARD" # Plugin: GeoIPfree # Perl modules required: Geo::IPfree version 0.2+ (from Graciliano M.P.) # Country chart is built from an Internet IP-Country database. # This plugin is useless for intranet only log files. # Note: You must choose between using this plugin (need Perl Geo::IPfree # module, database less up to date) or the GeoIP plugin (need Perl Geo::IP # module from Maxmind, database more up to date). # Note: Activestate provide a corrupted version of Geo::IPfree 0.2 Perl # module, so install it from elsewhere (from www.cpan.org for example). # This plugin reduces AWStats speed of 10% ! # #LoadPlugin="geoipfree" # Plugin: GeoIP_Region_Maxmind # Perl modules required: Geo::IP (from Maxmind) # This plugin add a chart of hits by regions. Only regions for US and # Canada can be detected. # Note: This plugin need Maxmind GeoIP Perl module AND the region database. # Note: I get some problem with Maxmind Geo::IP Perl module with ActiveState # on Windows but it works great on Linux with default Perl. # You need to purchase a license from Maxmind to get/use the Region database. # This plugin reduces AWStats speed. # #LoadPlugin="geoip_region_maxmind GEOIP_STANDARD /pathto/GeoIPRegion.dat" # Plugin: GeoIP_City_Maxmind # Perl modules required: Geo::IP (from Maxmind) # This plugin add a chart of hits by cities. # Note: This plugin need Maxmind GeoIP Perl module AND the city database. # Note: I get some problem with Maxmind Geo::IP Perl module with ActiveState # on Windows but it works great on Linux with default Perl. # You need to purchase a license from Maxmind to get/use the City database. # This plugin reduces AWStats speed. # #LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /pathto/GeoIPCity.dat" # Plugin: UserInfo # Perl modules required: None # Add a text (Firtname, Lastname, Office Department, ...) in authenticated user # reports for each login value. # A text file called userinfo.myconfig.txt, with two fields (first is login, # second is text to show, separated by a tab char) must be created in DirData # directory. # #LoadPlugin="userinfo" # Plugin: HostInfo # Perl modules required: Net::XWhois # Add a column into host chart with a link to open a popup window that shows # info on host (like whois records). # #LoadPlugin="hostinfo" # Plugin: ClusterInfo # Perl modules required: None # Add a text (for example a full hostname) in cluster reports for each cluster # number. # A text file called clusterinfo.myconfig.txt, with two fields (first is # cluster number, second is text to show) separated by a tab char. must be # created into DirData directory. # Note this plugin is useless if ShowClusterStats is set to 0 or if you don't # use a personalized log format that contains %cluster tag. # #LoadPlugin="clusterinfo" # Plugin: UrlAliases # Perl modules required: None # Add a text (Page title, description...) in URL reports before URL value. # A text file called urlalias.myconfig.txt, with two fields (first is URL, # second is text to show, separated by a tab char) must be created into # DirData directory. # #LoadPlugin="urlalias" # Plugin: TimeHiRes # Perl modules required: Time::HiRes (if Perl < 5.8) # Time reported by -showsteps option is in millisecond. For debug purpose. # #LoadPlugin="timehires" # Plugin: TimeZone # Perl modules required: Time::Local # Allow AWStats to correct a bad timezone for user of some IIS that use # GMT date in its log instead of local server time. # This module is useless for Apache and most IIS version. # This plugin reduces AWStats speed of 40% !!!!!!! # #LoadPlugin="timezone +2" # Plugin: Rawlog # Perl modules required: None # This plugin adds a form in AWStats main page to allow users to see raw # content of current log files. A filter is also available. # #LoadPlugin="rawlog" # Plugin: GraphApplet # Perl modules required: None # Supported charts are built by a 3D graphic applet. # #LoadPlugin="graphapplet /awstatsclasses" # EXPERIMENTAL FEATURE #----------------------------------------------------------------------------- # EXTRA SECTIONS #----------------------------------------------------------------------------- # You can define your own charts, you choose here what are rows and columns # keys. This feature is particularly usefull for marketing purpose, tracking # products orders for example. # For this, edit all parameters of Extra section. Each set of parameter is a # different chart. For several charts, duplicate section changing the number. # Note: Each Extra section reduces AWStats speed by 8%. # # WARNING: A wrong setup of Extra section might result in too large arrays # that will consume all your memory, making AWStats unusable after several # updates, so be sure to setup it correctly. # In most cases, you don't need this feature. # # ExtraSectionNameX is title of your personalized chart. # ExtraSectionCodeFilterX is list of codes the record code field must match. # Put an empty string for no test on code. # ExtraSectionConditionX are conditions you can use to count or not the hit, # Use one of the field condition (URL,QUERY_STRING,REFERER,UA,HOST,extraX) # and a regex to match, after a coma. Use "||" for "OR". # ExtraSectionFirstColumnTitleX is the first column title of the chart. # ExtraSectionFirstColumnValuesX is a string to tell AWStats which field to # extract value from (URL,QUERY_STRING,REFERER,UA,HOST,extraX) # and how to extract the value (using regex syntax). Each different value # found will appear in first column of report on a different row. Be sure # that list of different possible values will not grow indefinitely. # ExtraSectionFirstColumnFormatX is the string used to write value. # ExtraSectionStatTypesX are things you want to count. You can use standard # code letters (P for pages,H for hits,B for bandwidth,L for last access). # ExtraSectionAddAverageRowX add a row at bottom of chart with average values. # ExtraSectionAddSumRowX add a row at bottom of chart with sum values. # MaxNbOfExtraX is maximum number of rows shown in chart. # MinHitExtraX is minimum number of hits required to be shown in chart. # # Example to report the 20 products the most ordered by "order.cgi" script #ExtraSectionName1="Product orders" #ExtraSectionCodeFilter1="200 304" #ExtraSectionCondition1="URL,\/cgi\-bin\/order\.cgi||URL,\/cgi\-bin\/order2\.cgi" #ExtraSectionFirstColumnTitle1="Product ID" #ExtraSectionFirstColumnValues1="QUERY_STRING,productid=([^&]+)" #ExtraSectionFirstColumnFormat1="%s" #ExtraSectionStatTypes1=PL #ExtraSectionAddAverageRow1=0 #ExtraSectionAddSumRow1=1 #MaxNbOfExtra1=20 #MinHitExtra1=1 # There is also a global parameter ExtraTrackedRowsLimit that limit the # number of possible rows an ExtraSection can report. This parameter is # here to protect too much memory use when you make a bad setup in your # ExtraSection. It applies to all ExtraSection independently meaning that # none ExtraSection can report more rows than value defined by ExtraTrackedRowsLimit. # If you know an ExtraSection will report more rows than its value, you should # increase this parameter or AWStats will stop with an error. # Example: 2000 # Default: 500 # ExtraTrackedRowsLimit=500 #----------------------------------------------------------------------------- # INCLUDES #----------------------------------------------------------------------------- # You can include other config files using the directive with the name of the # config file. # This is particularly usefull for users who have a lot of virtual servers, so # a lot of config files and want to maintain common values in only one file. # Note that when a variable is defined both in a config file and in an # included file, AWStats will use the last value read for parameters that # contains one value and AWStats will concat all values from both files for # parameters that are lists of value. # #Include "" PK „%2‡4Ï_Çü Çü WEB-INF/cgi-bin/awstats.pl#!/usr/bin/perl #------------------------------------------------------------------------------ # 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. # See AWStats documentation (in docs/ directory) for all setup instructions. #------------------------------------------------------------------------------ # $Revision: 1.1 $ - $Author: Lluis $ - $Date: 2005/01/03 13:16:56 $ require 5.005; #$|=1; #use warnings; # Must be used in test mode only. This reduce a little process speed #use diagnostics; # Must be used in test mode only. This reduce a lot of process speed use strict;no strict "refs"; use Time::Local; # use Time::Local 'timelocal_nocheck' is faster but not supported by all Time::Local modules use Socket; #------------------------------------------------------------------------------ # Defines #------------------------------------------------------------------------------ use vars qw/ $REVISION $VERSION /; $REVISION='$Revision: 1.1 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="6.2 (build $REVISION)"; # ----- Constants ----- use vars qw/ $DEBUGFORCED $NBOFLINESFORBENCHMARK $FRAMEWIDTH $NBOFLASTUPDATELOOKUPTOSAVE $LIMITFLUSH $NEWDAYVISITTIMEOUT $VISITTIMEOUT $NOTSORTEDRECORDTOLERANCE $WIDTHCOLICON $TOOLTIPON $lastyearbeforeupdate /; $DEBUGFORCED=0; # Force debug level to log lesser level into debug.log file (Keep this value to 0) $NBOFLINESFORBENCHMARK=8192; # Benchmark info are printing every NBOFLINESFORBENCHMARK lines (Must be a power of 2) $FRAMEWIDTH=240; # Width of left frame when UseFramesWhenCGI is on $NBOFLASTUPDATELOOKUPTOSAVE=500; # Nb of records to save in DNS last update cache file $LIMITFLUSH=5000; # Nb of records in data arrays after how we need to flush data on disk $NEWDAYVISITTIMEOUT=764041; # Delay between 01-23:59:59 and 02-00:00:00 $VISITTIMEOUT=10000; # Lapse of time to consider a page load as a new visit. 10000 = 1 hour (Default = 10000) $NOTSORTEDRECORDTOLERANCE=20000; # Lapse of time to accept a record if not in correct order. 20000 = 2 hour (Default = 20000) $WIDTHCOLICON=32; $TOOLTIPON=0; # Tooltips plugin loaded # ----- Running variables ----- use vars qw/ $DIR $PROG $Extension $Debug $ShowSteps $DebugResetDone $DNSLookupAlreadyDone $RunAsCli $UpdateFor $HeaderHTTPSent $HeaderHTMLSent $LastLine $LastLineNumber $LastLineOffset $LastLineChecksum $LastUpdate $lowerval $PluginMode $TotalUnique $TotalVisits $TotalHostsKnown $TotalHostsUnknown $TotalPages $TotalHits $TotalBytes $TotalNotViewedPages $TotalNotViewedHits $TotalNotViewedBytes $TotalEntries $TotalExits $TotalBytesPages $TotalDifferentPages $TotalKeyphrases $TotalKeywords $TotalDifferentKeyphrases $TotalDifferentKeywords $TotalSearchEnginesPages $TotalSearchEnginesHits $TotalRefererPages $TotalRefererHits $TotalDifferentSearchEngines $TotalDifferentReferer $FrameName $Center $FileConfig $FileSuffix $Host $DayRequired $MonthRequired $YearRequired $QueryString $SiteConfig $StaticLinks $PageCode $PageDir $PerlParsingFormat $UserAgent $pos_vh $pos_host $pos_logname $pos_date $pos_tz $pos_method $pos_url $pos_code $pos_size $pos_referer $pos_agent $pos_query $pos_gzipin $pos_gzipout $pos_compratio $pos_timetaken $pos_cluster $pos_emails $pos_emailr $pos_hostr @pos_extra /; $DIR=$PROG=$Extension=''; $Debug = $ShowSteps = 0; $DebugResetDone = $DNSLookupAlreadyDone = 0; $RunAsCli = $UpdateFor = $HeaderHTTPSent = $HeaderHTMLSent = 0; $LastLine = $LastLineNumber = $LastLineOffset = $LastLineChecksum = $LastUpdate = 0; $lowerval = 0; $PluginMode = ''; $TotalUnique = $TotalVisits = $TotalHostsKnown = $TotalHostsUnknown = 0; $TotalPages = $TotalHits = $TotalBytes = 0; $TotalNotViewedPages = $TotalNotViewedHits = $TotalNotViewedBytes = 0; $TotalEntries = $TotalExits = $TotalBytesPages = $TotalDifferentPages = 0; $TotalKeyphrases = $TotalKeywords = $TotalDifferentKeyphrases = $TotalDifferentKeywords = 0; $TotalSearchEnginesPages = $TotalSearchEnginesHits = $TotalRefererPages = $TotalRefererHits = $TotalDifferentSearchEngines = $TotalDifferentReferer = 0; ($FrameName, $Center, $FileConfig, $FileSuffix, $Host, $DayRequired, $MonthRequired, $YearRequired, $QueryString, $SiteConfig, $StaticLinks, $PageCode, $PageDir, $PerlParsingFormat, $UserAgent)= ('','','','','','','','','','','','','','',''); $pos_vh = $pos_host = $pos_logname = $pos_date = $pos_tz = $pos_method = $pos_url = $pos_code = $pos_size = -1; $pos_referer = $pos_agent = $pos_query = $pos_gzipin = $pos_gzipout = $pos_compratio = -1; $pos_cluster = $pos_emails = $pos_emailr = $pos_hostr = -1; @pos_extra=(); # ----- Plugins variable ----- use vars qw/ %PluginsLoaded $PluginDir $AtLeastOneSectionPlugin /; %PluginsLoaded=(); $PluginDir=''; $AtLeastOneSectionPlugin=0; # ----- Time vars ----- use vars qw/ $starttime $nowtime $tomorrowtime $nowweekofmonth $nowweekofyear $nowdaymod $nowsmallyear $nowsec $nowmin $nowhour $nowday $nowmonth $nowyear $nowwday $nowyday $nowns $StartSeconds $StartMicroseconds /; $StartSeconds=$StartMicroseconds=0; # ----- Variables for config file reading ----- use vars qw/ $FoundNotPageList /; $FoundNotPageList=0; # ----- Config file variables ----- use vars qw/ $StaticExt $DNSStaticCacheFile $DNSLastUpdateCacheFile $MiscTrackerUrl $Lang $MaxRowsInHTMLOutput $MaxLengthOfShownURL $MaxLengthOfStoredURL $MaxLengthOfStoredUA %BarPng $BuildReportFormat $BuildHistoryFormat $ExtraTrackedRowsLimit /; $StaticExt='html'; $DNSStaticCacheFile='dnscache.txt'; $DNSLastUpdateCacheFile='dnscachelastupdate.txt'; $MiscTrackerUrl='/js/awstats_misc_tracker.js'; $Lang='auto'; $MaxRowsInHTMLOutput=1000; $MaxLengthOfShownURL=64; $MaxLengthOfStoredURL=256; # Note: Apache LimitRequestLine is default to 8190 $MaxLengthOfStoredUA=256; %BarPng=('vv'=>'vv.png','vu'=>'vu.png','hu'=>'hu.png','vp'=>'vp.png','hp'=>'hp.png', 'he'=>'he.png','hx'=>'hx.png','vh'=>'vh.png','hh'=>'hh.png','vk'=>'vk.png','hk'=>'hk.png'); $BuildReportFormat='html'; $BuildHistoryFormat='text'; $ExtraTrackedRowsLimit=500; use vars qw/ $EnableLockForUpdate $DNSLookup $AllowAccessFromWebToAuthenticatedUsersOnly $BarHeight $BarWidth $CreateDirDataIfNotExists $KeepBackupOfHistoricFiles $NbOfLinesParsed $NbOfLinesDropped $NbOfLinesCorrupted $NbOfOldLines $NbOfNewLines $NbOfLinesShowsteps $NewLinePhase $NbOfLinesForCorruptedLog $PurgeLogFile $ArchiveLogRecords $ShowDropped $ShowCorrupted $ShowUnknownOrigin $ShowLinksToWhoIs $ShowAuthenticatedUsers $ShowFileSizesStats $ShowScreenSizeStats $ShowSMTPErrorsStats $ShowEMailSenders $ShowEMailReceivers $ShowWormsStats $ShowClusterStats $IncludeInternalLinksInOriginSection $AuthenticatedUsersNotCaseSensitive $Expires $UpdateStats $MigrateStats $URLNotCaseSensitive $URLWithQuery $URLReferrerWithQuery $DecodeUA /; ($EnableLockForUpdate, $DNSLookup, $AllowAccessFromWebToAuthenticatedUsersOnly, $BarHeight, $BarWidth, $CreateDirDataIfNotExists, $KeepBackupOfHistoricFiles, $NbOfLinesParsed, $NbOfLinesDropped, $NbOfLinesCorrupted, $NbOfOldLines, $NbOfNewLines, $NbOfLinesShowsteps, $NewLinePhase, $NbOfLinesForCorruptedLog, $PurgeLogFile, $ArchiveLogRecords, $ShowDropped, $ShowCorrupted, $ShowUnknownOrigin, $ShowLinksToWhoIs, $ShowAuthenticatedUsers, $ShowFileSizesStats, $ShowScreenSizeStats, $ShowSMTPErrorsStats, $ShowEMailSenders, $ShowEMailReceivers, $ShowWormsStats, $ShowClusterStats, $IncludeInternalLinksInOriginSection, $AuthenticatedUsersNotCaseSensitive, $Expires, $UpdateStats, $MigrateStats, $URLNotCaseSensitive, $URLWithQuery, $URLReferrerWithQuery, $DecodeUA)= (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); use vars qw/ $AllowToUpdateStatsFromBrowser $DetailedReportsOnNewWindows $FirstDayOfWeek $KeyWordsNotSensitive $SaveDatabaseFilesWithPermissionsForEveryone $WarningMessages $DebugMessages $ShowLinksOnUrl $UseFramesWhenCGI $ShowMenu $ShowMonthStats $ShowDaysOfMonthStats $ShowDaysOfWeekStats $ShowHoursStats $ShowDomainsStats $ShowHostsStats $ShowRobotsStats $ShowSessionsStats $ShowPagesStats $ShowFileTypesStats $ShowOSStats $ShowBrowsersStats $ShowOriginStats $ShowKeyphrasesStats $ShowKeywordsStats $ShowMiscStats $ShowHTTPErrorsStats $AddDataArrayMonthStats $AddDataArrayShowDaysOfMonthStats $AddDataArrayShowDaysOfWeekStats $AddDataArrayShowHoursStats /; ($AllowToUpdateStatsFromBrowser, $DetailedReportsOnNewWindows, $FirstDayOfWeek, $KeyWordsNotSensitive, $SaveDatabaseFilesWithPermissionsForEveryone, $WarningMessages, $DebugMessages, $ShowLinksOnUrl, $UseFramesWhenCGI, $ShowMenu, $ShowMonthStats, $ShowDaysOfMonthStats, $ShowDaysOfWeekStats, $ShowHoursStats, $ShowDomainsStats, $ShowHostsStats, $ShowRobotsStats, $ShowSessionsStats, $ShowPagesStats, $ShowFileTypesStats, $ShowOSStats, $ShowBrowsersStats, $ShowOriginStats, $ShowKeyphrasesStats, $ShowKeywordsStats, $ShowMiscStats, $ShowHTTPErrorsStats, $AddDataArrayMonthStats, $AddDataArrayShowDaysOfMonthStats, $AddDataArrayShowDaysOfWeekStats, $AddDataArrayShowHoursStats )= (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); use vars qw/ $AllowFullYearView $LevelForRobotsDetection $LevelForWormsDetection $LevelForBrowsersDetection $LevelForOSDetection $LevelForRefererAnalyze $LevelForFileTypesDetection $LevelForSearchEnginesDetection $LevelForKeywordsDetection /; ($AllowFullYearView, $LevelForRobotsDetection, $LevelForWormsDetection, $LevelForBrowsersDetection, $LevelForOSDetection, $LevelForRefererAnalyze, $LevelForFileTypesDetection, $LevelForSearchEnginesDetection, $LevelForKeywordsDetection)= (2,2,0,2,2,2,2,2,2); use vars qw/ $DirLock $DirCgi $DirConfig $DirData $DirIcons $DirLang $AWScript $ArchiveFileName $AllowAccessFromWebToFollowingIPAddresses $HTMLHeadSection $HTMLEndSection $LinksToWhoIs $LinksToIPWhoIs $LogFile $LogType $LogFormat $LogSeparator $Logo $LogoLink $StyleSheet $WrapperScript $SiteDomain $UseHTTPSLinkForUrl $URLQuerySeparators $URLWithAnchor $ErrorMessages $ShowFlagLinks /; ($DirLock, $DirCgi, $DirConfig, $DirData, $DirIcons, $DirLang, $AWScript, $ArchiveFileName, $AllowAccessFromWebToFollowingIPAddresses, $HTMLHeadSection, $HTMLEndSection, $LinksToWhoIs, $LinksToIPWhoIs, $LogFile, $LogType, $LogFormat, $LogSeparator, $Logo, $LogoLink, $StyleSheet, $WrapperScript, $SiteDomain, $UseHTTPSLinkForUrl, $URLQuerySeparators, $URLWithAnchor, $ErrorMessages, $ShowFlagLinks)= ('','','','','','','','','','','','','','','','','','','','','','','','','','',''); use vars qw/ $color_Background $color_TableBG $color_TableBGRowTitle $color_TableBGTitle $color_TableBorder $color_TableRowTitle $color_TableTitle $color_text $color_textpercent $color_titletext $color_weekend $color_link $color_hover $color_other $color_h $color_k $color_p $color_e $color_x $color_s $color_u $color_v /; ($color_Background, $color_TableBG, $color_TableBGRowTitle, $color_TableBGTitle, $color_TableBorder, $color_TableRowTitle, $color_TableTitle, $color_text, $color_textpercent, $color_titletext, $color_weekend, $color_link, $color_hover, $color_other, $color_h, $color_k, $color_p, $color_e, $color_x, $color_s, $color_u, $color_v)= ('','','','','','','','','','','','','','','','','','','','','',''); # ---------- Init arrays -------- use vars qw/ @RobotsSearchIDOrder_list1 @RobotsSearchIDOrder_list2 @RobotsSearchIDOrder_listgen @SearchEnginesSearchIDOrder_list1 @SearchEnginesSearchIDOrder_list2 @SearchEnginesSearchIDOrder_listgen @BrowsersSearchIDOrder @OSSearchIDOrder @WordsToExtractSearchUrl @WordsToCleanSearchUrl @WormsSearchIDOrder @RobotsSearchIDOrder @SearchEnginesSearchIDOrder @_from_p @_from_h @_time_p @_time_h @_time_k @_time_nv_p @_time_nv_h @_time_nv_k @DOWIndex @fieldlib @keylist /; @RobotsSearchIDOrder = @SearchEnginesSearchIDOrder = (); @_from_p = @_from_h = (); @_time_p = @_time_h = @_time_k = @_time_nv_p = @_time_nv_h = @_time_nv_k = (); @DOWIndex = @fieldlib = @keylist = (); use vars qw/ @MiscListOrder %MiscListCalc @OSFamily %BrowsersFamily @SessionsRange %SessionsAverage %LangBrowserToLangAwstats %LangAWStatsToFlagAwstats @HostAliases @AllowAccessFromWebToFollowingAuthenticatedUsers @DefaultFile @SkipDNSLookupFor @SkipHosts @SkipUserAgents @SkipFiles @OnlyHosts @OnlyUserAgents @OnlyFiles @URLWithQueryWithOnly @URLWithQueryWithout @ExtraName @ExtraCondition @ExtraStatTypes @MaxNbOfExtra @MinHitExtra @ExtraFirstColumnTitle @ExtraFirstColumnValues @ExtraFirstColumnFormat @ExtraCodeFilter @ExtraConditionType @ExtraConditionTypeVal @ExtraFirstColumnValuesType @ExtraFirstColumnValuesTypeVal @ExtraAddAverageRow @ExtraAddSumRow @PluginsToLoad /; @MiscListOrder=('AddToFavourites','JavascriptDisabled','JavaEnabled','DirectorSupport','FlashSupport','RealPlayerSupport','QuickTimeSupport','WindowsMediaPlayerSupport','PDFSupport'); %MiscListCalc=('TotalMisc'=>'','AddToFavourites'=>'u','JavascriptDisabled'=>'hm','JavaEnabled'=>'hm','DirectorSupport'=>'hm','FlashSupport'=>'hm','RealPlayerSupport'=>'hm','QuickTimeSupport'=>'hm','WindowsMediaPlayerSupport'=>'hm','PDFSupport'=>'hm'); @OSFamily=('win','mac'); #%BrowsersFamily=('msie'=>1,'netscape'=>2,'mozilla'=>3); %BrowsersFamily=('msie'=>1,'netscape'=>2); @SessionsRange=('0s-30s','30s-2mn','2mn-5mn','5mn-15mn','15mn-30mn','30mn-1h','1h+'); %SessionsAverage=('0s-30s',15,'30s-2mn',75,'2mn-5mn',210,'5mn-15mn',600,'15mn-30mn',1350,'30mn-1h',2700,'1h+',3600); # HTTP-Accept or Lang parameter => AWStats code to use for lang # ISO-639-1 or 2 or other => awstats-xx.txt where xx is ISO-639-1 %LangBrowserToLangAwstats=( 'sq'=>'al','ar'=>'ar','ba'=>'ba','bg'=>'bg','zh-tw'=>'tw','zh'=>'cn','cz'=>'cz', 'de'=>'de','da'=>'dk', 'en'=>'en','et'=>'et','fi'=>'fi','fr'=>'fr','gl'=>'gl', 'es'=>'es','eu'=>'eu','ca'=>'ca', 'el'=>'gr','hu'=>'hu','is'=>'is','in'=>'id','it'=>'it', 'ja'=>'jp','ko'=>'kr','lv'=>'lv','nl'=>'nl','no'=>'nb','nb'=>'nb','nn'=>'nn', 'pl'=>'pl','pt'=>'pt','pt-br'=>'br','ro'=>'ro','ru'=>'ru','sr'=>'sr','sk'=>'sk', 'sv'=>'se','th'=>'th','tr'=>'tr','uk'=>'ua','cy'=>'cy','wlk'=>'cy' ); %LangAWStatsToFlagAwstats=( # If flag (country ISO-3166 two letters) is not same than AWStats Lang code 'ca'=>'es_cat','et'=>'ee','eu','es_eu', 'cy'=>'wlk', 'gl'=>'glg', 'he'=>'il', 'ar'=>'sa', 'sr'=>'cs' ); @HostAliases = @AllowAccessFromWebToFollowingAuthenticatedUsers=(); @DefaultFile = @SkipDNSLookupFor = (); @SkipHosts = @SkipUserAgents = @SkipFiles = (); @OnlyHosts = @OnlyUserAgents = @OnlyFiles = (); @URLWithQueryWithOnly = @URLWithQueryWithout = (); @ExtraName = @ExtraCondition = @ExtraStatTypes = @MaxNbOfExtra = @MinHitExtra = (); @ExtraFirstColumnTitle = @ExtraFirstColumnValues = @ExtraFirstColumnFormat = (); @ExtraCodeFilter = @ExtraConditionType = @ExtraConditionTypeVal = (); @ExtraFirstColumnValuesType = @ExtraFirstColumnValuesTypeVal = (); @ExtraAddAverageRow = @ExtraAddSumRow = (); @PluginsToLoad = (); # ---------- Init hash arrays -------- use vars qw/ %BrowsersHashIDLib %BrowsersHashIcon %BrowsersHereAreGrabbers %DomainsHashIDLib %MimeHashLib %MimeHashIcon %MimeHashFamily %OSHashID %OSHashLib %RobotsHashIDLib %RobotsAffiliateLib %SearchEnginesHashID %SearchEnginesHashLib %SearchEnginesKnownUrl %NotSearchEnginesKeys %WormsHashID %WormsHashLib %WormsHashTarget /; use vars qw/ %HTMLOutput %NoLoadPlugin %FilterIn %FilterEx %BadFormatWarning %MonthNumLib %ValidHTTPCodes %ValidSMTPCodes %TrapInfosForHTTPErrorCodes %NotPageList %DayBytes %DayHits %DayPages %DayVisits %MaxNbOf %MinHit %ListOfYears %HistoryAlreadyFlushed %PosInFile %ValueInFile %val %nextval %egal %TmpDNSLookup %TmpOS %TmpRefererServer %TmpRobot %TmpBrowser %MyDNSTable /; %HTMLOutput = %NoLoadPlugin = %FilterIn = %FilterEx = (); %BadFormatWarning = (); %MonthNumLib = (); %ValidHTTPCodes = %ValidSMTPCodes = (); %TrapInfosForHTTPErrorCodes=(); $TrapInfosForHTTPErrorCodes{404}=1; # TODO Add this in config file %NotPageList=(); %DayBytes = %DayHits = %DayPages = %DayVisits = (); %MaxNbOf = %MinHit = (); %ListOfYears = %HistoryAlreadyFlushed = %PosInFile = %ValueInFile = (); %val = %nextval = %egal = (); %TmpDNSLookup = %TmpOS = %TmpRefererServer = %TmpRobot = %TmpBrowser = %MyDNSTable = (); use vars qw/ %FirstTime %LastTime %MonthHostsKnown %MonthHostsUnknown %MonthUnique %MonthVisits %MonthPages %MonthHits %MonthBytes %MonthNotViewedPages %MonthNotViewedHits %MonthNotViewedBytes %_session %_browser_h %_domener_p %_domener_h %_domener_k %_errors_h %_errors_k %_filetypes_h %_filetypes_k %_filetypes_gz_in %_filetypes_gz_out %_host_p %_host_h %_host_k %_host_l %_host_s %_host_u %_waithost_e %_waithost_l %_waithost_s %_waithost_u %_keyphrases %_keywords %_os_h %_pagesrefs_p %_pagesrefs_h %_robot_h %_robot_k %_robot_l %_robot_r %_worm_h %_worm_k %_worm_l %_login_h %_login_p %_login_k %_login_l %_screensize_h %_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 %_unknownreferer_l %_unknownrefererbrowser_l %_emails_h %_emails_k %_emails_l %_emailr_h %_emailr_k %_emailr_l /; &Init_HashArray(); # ---------- Init Regex -------- use vars qw/ $regclean1 $regclean2 $regdate /; $regclean1=qr/<(recnb|\/td)>/i; $regclean2=qr/<\/?[^<>]+>/i; $regdate=qr/(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/; # ---------- Init Tie::hash arrays -------- # Didn't find a tie that increase speed #use Tie::StdHash; #use Tie::Cache::LRU; #tie %_host_p, 'Tie::StdHash'; #tie %TmpOS, 'Tie::Cache::LRU'; # PROTOCOL CODES use vars qw/ %httpcodelib %ftpcodelib %smtpcodelib /; # DEFAULT MESSAGE use vars qw/ @Message /; @Message=( 'Unknown', 'Unknown (unresolved ip)', 'Others', 'View details', 'Day', 'Month', 'Year', 'Statistics for', 'First visit', 'Last visit', 'Number of visits', 'Unique visitors', 'Visit', 'different keywords', 'Search', 'Percent', 'Traffic', 'Domains/Countries', 'Visitors', 'Pages-URL', 'Hours', 'Browsers', '', 'Referers', 'Never updated (See \'Build/Update\' on awstats_setup.html page)', 'Visitors domains/countries', 'hosts', 'pages', 'different pages-url', 'Viewed', 'Other words', 'Pages not found', 'HTTP Error codes', 'Netscape versions', 'IE versions', 'Last Update', 'Connect to site from', 'Origin', 'Direct address / Bookmarks', 'Origin unknown', 'Links from an Internet Search Engine', 'Links from an external page (other web sites except search engines)', 'Links from an internal page (other page on same site)', 'Keyphrases used on search engines', 'Keywords used on search engines', 'Unresolved IP Address', 'Unknown OS (Referer field)', 'Required but not found URLs (HTTP code 404)', 'IP Address', 'Error Hits', 'Unknown browsers (Referer field)', 'different robots', 'visits/visitor', 'Robots/Spiders visitors', 'Free realtime logfile analyzer for advanced web statistics', 'of', 'Pages', 'Hits', 'Versions', 'Operating Systems', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Navigation', 'File type', 'Update now', 'Bandwidth', 'Back to main page', 'Top', 'dd mmm yyyy - HH:MM', 'Filter', 'Full list', 'Hosts', 'Known', 'Robots', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Days of week', 'Who', 'When', 'Authenticated users', 'Min', 'Average', 'Max', 'Web compression', 'Bandwidth saved', 'Compression on', 'Compression result', 'Total', 'different keyphrases', 'Entry', 'Code', 'Average size', 'Links from a NewsGroup', 'KB', 'MB', 'GB', 'Grabber', 'Yes', 'No', 'Info.', 'OK', 'Exit', 'Visits duration', 'Close window', 'Bytes', 'Search Keyphrases', 'Search Keywords', 'different refering search engines', 'different refering sites', 'Other phrases', 'Other logins (and/or anonymous users)', 'Refering search engines', 'Refering sites', 'Summary', 'Exact value not available in "Year" view', 'Data value arrays', 'Sender EMail', 'Receiver EMail', 'Reported period', 'Extra/Marketing', 'Screen sizes', 'Worm/Virus attacks', 'Add to favorites (estimated)', 'Days of month', 'Miscellaneous', 'Browsers with Java support', 'Browsers with Macromedia Director Support', 'Browsers with Flash Support', 'Browsers with Real audio playing support', 'Browsers with Quictime audio playing support', 'Browsers with Windows Media audio playing support', 'Browsers with PDF support', 'SMTP Error codes', 'Countries', 'Mails', 'Size', 'First', 'Last', 'Exclude filter', 'Codes shown here gave hits or traffic "not viewed" by visitors, so they are not included in other charts.', 'Cluster', 'Robots shown here gave hits or traffic "not viewed" by visitors, so they are not included in other charts.', 'Numbers after + are successful hits on "robots.txt" files', 'Worms shown here gave hits or traffic "not viewed" by visitors, so thay are not included in other charts.', 'Not viewed traffic includes traffic generated by robots, worms, or replies with special HTTP status codes.', 'Traffic viewed', 'Traffic not viewed', 'Monthly history', 'Worms', 'different worms', 'Mails successfully sent', 'Mails failed/refused', 'Sensitive targets', 'Javascript disabled' ); #------------------------------------------------------------------------------ # Functions #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Function: Write on ouput header of HTTP answer # Parameters: None # Input: $HeaderHTTPSent $BuildReportFormat $PageCode $Expires # Output: $HeaderHTTPSent=1 # Return: None #------------------------------------------------------------------------------ sub http_head { if (! $HeaderHTTPSent) { if ($BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml') { print ($ENV{'HTTP_USER_AGENT'}=~/MSIE|Googlebot/i?"Content-type: text/html; charset=$PageCode\n":"Content-type: text/xml; charset=$PageCode\n"); } else { print "Content-type: text/html; charset=$PageCode\n"; } # Expires must be GMT ANSI asctime and must be after Content-type to avoid pb with some servers (SAMBAR) if ($Expires =~ /^\d+$/) { print "Cache-Control: public\n"; print "Last-Modified: ".gmtime($starttime)."\n"; print "Expires: ".(gmtime($starttime+$Expires))."\n"; } print "\n"; } $HeaderHTTPSent++;; } #------------------------------------------------------------------------------ # Function: Write on ouput header of HTML page # Parameters: None # Input: %HTMLOutput $PluginMode $Expires $Lang $StyleSheet $HTMLHeadSection $PageCode $PageDir # Output: $HeaderHTMLSent=1 # Return: None #------------------------------------------------------------------------------ sub html_head { my $dir=$PageDir?'right':'left'; if (scalar keys %HTMLOutput || $PluginMode) { my $MetaRobot=0; # meta robots my $periodtitle=" ($YearRequired".($MonthRequired ne 'all'?"-$MonthRequired":"").")"; # Write head section if ($BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml') { if ($PageCode) { print "\n"; } else { print "\n"; }; if ($FrameName ne 'index') { print "\n"; } else { print "\n"; } print "\n"; } else { if ($FrameName ne 'index') { print "\n\n"; } else { print "\n\n"; } print "\n"; } print "
\n"; print "\n"; if ($MetaRobot) { print "\n"; } else { print "\n"; } # Affiche tag meta content-type if ($BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml') { print ($ENV{'HTTP_USER_AGENT'}=~/MSIE|Googlebot/i?"\n":"\n"); } else { print "\n"; } if ($Expires) { print "\n"; } print "\n"; if ($MetaRobot && $FrameName ne 'mainleft') { print "\n"; } print "
\n"; if ($FrameName ne 'index') { # A STYLE section must be in head section. Do not use " for number in a style section print "\n"; if ($StyleSheet) { print "\n"; } } print "\n\n"; if ($FrameName ne 'index') { print "