]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Updated documentation
authoreldy <>
Sat, 27 Sep 2003 19:30:59 +0000 (19:30 +0000)
committereldy <>
Sat, 27 Sep 2003 19:30:59 +0000 (19:30 +0000)
docs/awstats_setup.html
wwwroot/cgi-bin/awstats.pl

index d559a5872521c43882005f895b0af65618580aeb..8491e175529abc2b97d2c2bff3a65a358aabff72 100644 (file)
@@ -44,9 +44,11 @@ AWStats common use is made in 3 steps:<br>
 <br><a name="INSTALL"><H2 style="font: 22px arial,helvetica,sanserif color: #606060"><u>Step 1 : Install and Setup</u></H2></a>
 
 <br>
-<b>A) With Apache or compatible server (on Unix/Linux, Windows, MacOS...)</b><br>
+<a name="INSTALLAPACHE"><b>A) With Apache or compatible server (on Unix/Linux, Windows, MacOS...)</b></a><br>
+<br>
+<font style="color: #111155"><b>* Step 1-1</b>:</font><br>
+(in most cases, if Apache is correctly setup, this step is not required, just read it to know)<br>
 <br>
-* Step 1-1<br>
 Configure your apache web server to have <b>NCSA combined/XLF/ELF</b> log format (you can use your own log format but
 this predefined logformat is often the best choice and make setup easier). You can do this by changing, in <b>httpd.conf</b>,
 following directives (See your apache manual for more information):<br>
@@ -58,29 +60,41 @@ To be sure the log format change is effective, you can stop Apache, remove all o
 your homepage. This is an example of records you should get then in your new log file:<br>
 <i>62.161.78.75 - - [dd/mmm/yyyy:hh:mm:ss +0000] "GET / HTTP/1.1" 200 1234 "http://www.from.com/from.html" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"</i><br>
 <br>
-* Step 1-2<br>
-Copy the contents of the uncompressed cgi-bin folder from your hard drive to your server's cgi-bin
+
+<font style="color: #111155"><b>* Step 1-2</b>:</font><br>
+(if you use a package provided with a Linux distribution, this might not be necessary)<br><br>
+Copy the contents of the provided cgi-bin folder from your hard drive to your server's cgi-bin
 directory (this includes <b>awstats.pl</b>, <b>awstats.model.conf</b>, and the <b>lang</b>, <b>lib</b> and <b>plugins</b> sub-directories).<br>
 <br>
-* Step 1-3<br>
-If necessary (should not with most Perl interpreter), edit the first (top-most) line of awstats.pl file that is<br>
+
+<font style="color: #111155"><b>* Step 1-3</b>:</font><br>
+(with most Perl interpreter, this step is not required)<br><br>
+If necessary, edit the first (top-most) line of awstats.pl file that is<br>
 <i>#!/usr/bin/perl</i><br>
 to reflect the path were your Perl interpreter is installed. Default value works for most of Unix OS, but it also might be<br>
 <i>#!/usr/local/bin/perl</i><br>
 With Apache for Windows and ActivePerl interpreter, it might be<br>
 <i>#!c:/program files/activeperl/bin/perl</i><br>
 <br>
-* Step 1-4<br>
+
+<font style="color: #111155"><b>* Step 1-4</b>:</font><br>
+(if you use a package provided with a Linux distribution, this might not be necessary)<br><br>
 Move AWStats <b>icon sub-directories</b> and its content into a directory readable by your
 web server, for example /yourwwwroot/icon or /yourwwwroot/icons.<br>
 <br>
-* Step 1-5<br>
-Copy <b>awstats.model.conf</b> file into a new file named <b>awstats.myvirtualhostname.conf</b>.
-This new file must be stored in<br>
-- /etc/awstats or /etc/opt/awstats or /etc or same directory than awstats.pl (so cgi-bin) for Unix/Linux users.<br>
-- same directory than awstats.pl (so cgi-bin) for Windows and other OS.<br>
+
+<font style="color: #111155"><b>* Step 1-5</b>:</font><br>
+(if you use a package provided with a Linux distribution, your config file might
+have been already created under /etc/awstats directory)<br><br>
+Create a config file by copying <b>awstats.model.conf</b> file into a new file named <b>awstats.myvirtualhostname.conf</b>.
+You can use the value of your choice instead of "myvirtualhostname". This new file must be stored in<br>
+- For Unix/Linux users: /etc/awstats or /usr/local/etc/awstats or /etc or same directory than awstats.pl (so cgi-bin).<br>
+- For Windows and other OS: Same directory than awstats.pl (so cgi-bin).<br>
 <br>
-* Step 1-6<br>
+
+<font style="color: #111155"><b>* Step 1-6</b>:</font><br>
+(if you use a package provided with a Linux distribution, your config file
+might have been already edited and stored in /etc/awstats)<br><br>
 Edit this new config file with your own setup :<br>
 - Change <a href="awstats_config.html#LogFile">LogFile</a> value with full path of your web server log file (You
 can also use a relative path from your awstats.pl directory).<br>
@@ -89,7 +103,8 @@ web server log files, "M" for mail log files, "F" for ftp log files, "O" otherwi
 - Check if <a href="awstats_config.html#LogFormat">LogFormat</a> has the value "1" (it means "NCSA apache combined/ELF/XLF log format").<br>
 - Change <a href="awstats_config.html#DirIcons">DirIcons</a> parameter to reflect relative path of icon directory.<br>
 - Edit <a href="awstats_config.html#SiteDomain">SiteDomain</a> parameter with the main domain name or the intranet 
-web server name used to reach the web site to analyze (Example: www.mydomain.com).<br>
+web server name used to reach the web site to analyze (Example: www.mydomain.com). If you have several
+possible name for same site, add list in <a href="awstats_config.html#HostAlias">HostAlias</a> parameter.<br>
 - You can change other parameters if you want.<br>
 <br>
 Step 1 (Install and Setup) is finished. You can jump to the <a href="#BUILD_UPDATE">Build/Update Statistics</a> section.<br>
@@ -97,9 +112,10 @@ Step 1 (Install and Setup) is finished. You can jump to the <a href="#BUILD_UPDA
 <br>
 <br>
 <br>
-<b>B) With IIS server</b><br>
+<a name="INSTALLIIS"><b>B) With IIS server</b></a><br>
+<br>
+<font style="color: #111155"><b>* Step 1-1</b>:</font><br>
 <br>
-* Step 1-1<br>
 Configure IIS to log in <b>"Extended W3C log format"</b> (You can still use
 your own log format but setup is easier if made like suggested). So, for
 this, start the IIS Snap-in, select the web site and look at its
@@ -123,20 +139,28 @@ To be sure the log format change is effective, you must stop IIS, remove all old
 your homepage. This is an example of records you should get then in the new log file:<br>
 <i>2000-07-19 14:14:14 62.161.78.73 - GET / 200 1234 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+5.01;+Windows+NT+5.0) http://www.from.com/from.htm</i><br>
 <br>
-* Step 1-2<br>
-Copy the contents of the uncompressed cgi-bin folder from your hard drive to your server's cgi-bin
+
+<font style="color: #111155"><b>* Step 1-2</b>:</font><br>
+<br>
+Copy the contents of the provided cgi-bin folder from your hard drive to your server's cgi-bin
 directory (this includes <b>awstats.pl</b>, <b>awstats.model.conf</b>, and the <b>lang</b>, <b>lib</b> and <b>plugins</b> sub-directories).<br>
 <br>   
-* Step 1-3<br>
+
+<font style="color: #111155"><b>* Step 1-3</b>:</font><br>
+(if your IIS and Perl are setup correctly, this step is not required)<br><br>
 Move AWStats <b>icon sub-directories</b> and its content into a directory readable by your
 web server, for example C:\yourwwwroot\icon.<br>
 <br>
-* Step 1-4<br>
-Copy <b>awstats.model.conf</b> file into a new file named <b>awstats.myvirtualhostname.conf</b>.
-This new file must be stored in<br>
-- same directory than awstats.pl (so cgi-bin)<br>
+
+<font style="color: #111155"><b>* Step 1-4</b>:</font><br>
+<br>
+Create a config file by copying <b>awstats.model.conf</b> file into a new file named <b>awstats.myvirtualhostname.conf</b>.
+You can use the value of your choice instead of "myvirtualhostname". This new file must be stored in<br>
+- Same directory than awstats.pl (so cgi-bin)<br>
+<br>
+
+<font style="color: #111155"><b>* Step 1-5</b>:</font><br>
 <br>
-* Step 1-5<br>
 Edit this new config file with your own setup :<br>
 - Change <a href="awstats_config.html#LogFile">LogFile</a> value with full path of your web server log file (You
 can also use a relative path from your awstats.pl directory).<br>
@@ -146,6 +170,7 @@ web server log files, "M" for mail log files, "F" for ftp log files, "O" otherwi
 - Change <a href="awstats_config.html#DirIcons">DirIcons</a> parameter to reflect relative path of icon directory.<br>
 - Edit <a href="awstats_config.html#SiteDomain">SiteDomain</a> parameter with the main domain name or the intranet
 web server name used to reach the web site to analyze (Example: www.mydomain.com).<br>
+- Set <a href="awstats_config.html#AllowToUpdateStatsFromBrowser">AllowToUpdateStatsFromBrowser</a> parameter to 1 if you don't have command line access and have only cgi access.<br>
 - You can change other parameters if you want.<br>
 <br>
 Step 1 (Install and Setup) is finished. You can jump to the <a href="#BUILD_UPDATE">Build/Update Statistics</a> section.<br>
@@ -156,7 +181,8 @@ Step 1 (Install and Setup) is finished. You can jump to the <a href="#BUILD_UPDA
 <b>C) With other web servers</b><br>
 <br>
 Setup process is similar to setup for Apache or IIS.<br>
-Use <a href="awstats_config.html#LogFormat">LogFormat</a> to value "3" if you have WebStar native log format.<br>
+Use <a href="awstats_config.html#LogFormat">LogFormat</a> to value "3" if you have WebStar native log format, use
+a personalized <a href="awstats_config.html#LogFormat">LogFormat</a> if your log format is other.<br>
 <br>
 
 
@@ -165,24 +191,34 @@ Use <a href="awstats_config.html#LogFormat">LogFormat</a> to value "3" if you ha
 <a name="BUILD_UPDATE"><H2 style="font: 22px arial,helvetica,sanserif color: #606060"><u>Step 2 : Build/Update Statistics</u></H2></a>
 
 <br>
-* Step 2-1<br>
-The first analyze/update of statistics can be made the first time manually from the command line (the first time,
-process may be long) :<br>
+<font style="color: #111155"><b>* Step 2-1</b>:</font><br>
+<br>
+The first analyze/update of statistics should be made the first time manually from the command line since first time,
+process may be long and it's easier to solve problems (if you don't have Command Line access, just go to Step 2-2). The
+AWStats update command line is:<br>
 <b><i>awstats.pl -config=myvirtualhostname -update</i></b><br>
 <br>
 AWStats will read the config file awstats.myvirtualhostname.conf (or if not found, awstats.conf)
 and create/update its database with all summary information issued from analyzed log file.<br>
 AWStats database files are saved in directory defined by <a href="awstats_config.html#DirData">DirData</a> parameter in config file.<br>
-When update is finished, you should get a result like this:<br>
-<i>Lines in file: 225730<br>
-Found 5 dropped records,<br>
-Found 124 corrupted records,<br>
-Found 0 old records,<br>
-Found 225601 new records.<br>
+When update is finished, you should get on screen a result like this:<br>
+<br><i>
+Update for config "/etc/awstats/awstats.myvirtualhostname.conf"<br>\r
+With data in log file "/pathtoyourlog/yourlog.log"...<br>\r
+Phase 1 : First bypass old records, searching new record...<br>\r
+Searching new records from beginning of log file...<br>\r
+Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...<br>\r
+Jumped lines in file: 0<br>\r
+Parsed lines in file: 225730<br>\r
+&nbsp;Found 122 dropped records,<br>\r
+&nbsp;Found 87 corrupted records,<br>\r
+&nbsp;Found 0 old records,<br>\r
+&nbsp;Found 225521 new qualifed records.<br>
 </i><br>
 <b>Dropped records</b> are records discarded because they were not user HTTP request or requests were not qualified
 by AWStats filters (See <a href="awstats_config.html#SkipHosts">SkipHosts</a>, <a href="awstats_config.html#SkipUserAgents">SkipUserAgents</a>,
-<a href="awstats_config.html#SkipFiles">SkipFiles</a>, and <a href="awstats_config.html#OnlyFiles">OnlyFiles</a> parameters).
+<a href="awstats_config.html#SkipFiles">SkipFiles</a>, <a href="awstats_config.html#OnlyHosts">OnlyHosts</a>,
+<a href="awstats_config.html#OnlyUserAgents">OnlyUserAgents</a> and <a href="awstats_config.html#OnlyFiles">OnlyFiles</a> parameters).
 If you want to see which lines were dropped, you can add the <b>-showdropped</b> option on command line.<br>
 <b>Corrupted records</b> are records that does not match log format defined by "LogFormat" parameter in AWStats config/domain file.
 With all webservers you can experience a little bit corrupted records (<5%) even when everythings work correctly.
@@ -192,8 +228,9 @@ correct, it may be the log format setup in your web server that is wrong. Don't
 your <a href="awstats_config.html#OnlyFiles">LogFormat</a> parameter in AWStats config/domain file MUST match
 the log file format you analyze.<br>
 If you want to see which lines are corrupted, you can add the <b>-showcorrupted</b> option on command line.<br>
-<b>Old records</b> are simply records that were already processed by a previous update process. So it's not necessary to
-purge your log file after each update process even if it's highly recommended to do it as often as possible.<br>
+<b>Old records</b> are simply records that were already processed by a previous update process.
+You understood that it's not necessary to purge your log file after each update process even
+if it's highly recommended to do it as often as possible.<br>
 <b>New records</b> are records in your log file that were successfully used to build/update statistics.<br>
 <br>
 Note : A log analysis process is slow (one second for each 4500 lines of your
@@ -202,13 +239,15 @@ address in your logfile if <a href="awstats_config.html#DNSLookup">DNSLookup</a>
 See <a href="awstats_benchmark.html">Benchmark page</a> for more accurate information.<br>
 <br>
 
-* Step 2-2<br>
-Even if AWStats allows "real-time" statistics with its "update from browser feature" (See next
-section <a href="#READ">Read Statistics</a>), you should run an update process from a scheduler (command is same than
-first process) frequently.<br>
+<font style="color: #111155"><b>* Step 2-2</b>:</font><br>
+<br>
+AWStats statistics can be updated web, to provide real-time statistics, by clicking
+the "Update now" link on web page (See next section <a href="#READ">Read Statistics</a> dynamically).<br>
+However, it is HIGHLY recommanded to run an update process from a scheduler frequently (command
+is same than update of first process).<br>
 <br>
 You have two choice:<br>
-- Include the update in your <b>logrotate</b> process. See <a href="awstats_faq.html#ROTATE">FAQ-COM120</a> for this.<br>
+- Include the update command in your <b>logrotate</b> process. See <a href="awstats_faq.html#ROTATE">FAQ-COM120</a> for this.<br>
 - Or add instructions in your <b>crontab</b> (Unix/Linux) or your <b>task scheduler</b> (for
 Windows), to launch frequently this Awstats update process. See <a href="awstats_faq.html#CRONTAB">FAQ-COM130</a> for this.<br><br>
 See AWStats <a href="awstats_benchmark.html">Benchmark page</a> for recommanded update/logrotate frequency.<br>
@@ -221,7 +260,8 @@ See AWStats <a href="awstats_benchmark.html">Benchmark page</a> for recommanded
 To see results of analyze, you have several solutions depending on your <a href="awstats_security.html">security policy</a>.<br>
 <br>
 
-* First solution is to build the main reports, in a static HTML page, from the command line, like this :<br>
+* First solution is to build the main reports, in a static HTML page, from the command line,
+like this (jump to second solution if you have ONLY CGI access):<br>
 <b><i>perl awstats.pl -config=myvirtualhostname -output -staticlinks > awstats.myvirtualhostname.html</i></b><br>
 <br>
 You can also use all other output options (each of them give you another report).
@@ -247,7 +287,7 @@ This is how to use all other possible output options(1) :<br>
 <i><b>perl awstats.pl -config=myvirtualhostname -output=errors404 -staticlinks > awstats.myvirtualhostname.errors404.html</b></i><br>
 <br>
 Note (1): If you prefer, you can use <a href="awstats_tools.html#awstats_buildstaticpages">awstats_buildstaticpages</a> tool to
-build all those pages in one command.<br>
+build all those pages in one command or to generate PDF files.<br>
 <br>
 Note (2): You can also add a <i>filter</i> on the following output reports:<b>urldetail, urlentry, urlexit, allhosts, refererpages</b>.<br>
 <i>filter</i> can be a regexp on the full key you want awstats to present information about and you must use it after the output
@@ -260,7 +300,7 @@ Note (3): If you want to build a report for a particular month, add options <i><
 To build a report for full year (warning: This may use a lot of memory and CPU), add options <i><b>-month=all -year=YYYY</b></i>.<br>
 
 <br><br>
-* Another solution is to view dynamically your statistics from a browser. For this use URL:<br>
+* Another solution is to view dynamically your statistics from a browser. For this, use URL:<br>
 <b><i>http://www.myserver.mydomain/cgi-bin/awstats.pl?config=myvirtualhostname</i></b><br>
 where <i>myvirtualhostname</i> is used to know which config file to use (AWStats will use awstats.<i>myvirtualhostname</i>.conf file).<br>
 <br>
index 79e22179590bcb5df2ec347ccb06b652eb862265..13a7b552b95e526c924528f64acb4f2b080fa002 100644 (file)
@@ -969,15 +969,15 @@ sub GetSessionRange {
 #------------------------------------------------------------------------------
 sub Read_Config {
        # Check config file in common possible directories :
-       # Windows :                     "$DIR" (same dir than awstats.pl)
-       # Mandrake and Debian package : "/etc/awstats"
-       # FHS standard, Suse package :  "/etc/opt/awstats"
-       # Other possible directories :  "/etc", "/usr/local/etc/awstats"
+       # Windows :                                             "$DIR" (same dir than awstats.pl)
+       # Standard, Mandrake and Debian package :       "/etc/awstats"
+       # Other possible directories :                          "/usr/local/etc/awstats", "/etc"
+       # FHS standard, Suse package :                          "/etc/opt/awstats"
        my $configdir=shift;
        my @PossibleConfigDir=();
 
        if ($configdir) { @PossibleConfigDir=("$configdir"); }
-       else { @PossibleConfigDir=("$DIR","/etc/awstats","/etc/opt/awstats","/etc","/usr/local/etc/awstats"); }
+       else { @PossibleConfigDir=("$DIR","/etc/awstats","/usr/local/etc/awstats","/etc","/etc/opt/awstats"); }
 
        # Open config file
        $FileConfig=$FileSuffix='';
@@ -5095,11 +5095,11 @@ if ((! $ENV{'GATEWAY_INTERFACE'}) && (! $SiteConfig)) {
        print "  First, $PROG tries to read $PROG.virtualhostname.conf as the config file.\n";
        print "  If not found, $PROG tries to read $PROG.conf\n";
        print "  Note 1: Config files ($PROG.virtualhostname.conf or $PROG.conf) must be\n";
-       print "  in /etc/awstats, /etc/opt/awstats, /etc or same directory than awstats.pl\n";
-       print "  file.\n";
+       print "   in /etc/awstats, /usr/local/etc/awstats, /etc or same directory than\n";
+       print "   awstats.pl file.\n";
        print "  Note 2: If AWSTATS_FORCE_CONFIG environment variable is defined, AWStats will\n";
-       print "  use it as the \"config\" value, whatever is the value on command line or URL.\n";
-       print "  See AWStats documentation for all setup instrutions.\n";
+       print "   use it as the \"config\" value, whatever is the value on command line or URL.\n";
+       print "   See AWStats documentation for all setup instrutions.\n";
        print "\n";
        print "Options to update statistics:\n";
        print "  -update        to update statistics (default)\n";