34
<br><br><H1 style="font: 26px arial,helvetica,sanserif">Install, Setup and Use AWStats</H1>
34
<br><br><H1 style="font: 26px arial,helvetica,sans-serif">Install, Setup and Use AWStats</H1>
36
36
AWStats common use is made in 3 steps:<br>
38
<li>Step 1 : <a href="#INSTALL">The install and setup</a><br>
39
<li>Step 2 : <a href="#BUILD_UPDATE">The build/update of statistics</a><br>
40
<li>Step 3 : <a href="#READ">The reading of results</a><br>
38
<li>Step 0 : <a href="#INSTALL">The install and setup</a><br>
39
<li>Step 1 : <a href="#BUILD_UPDATE">The build/update of statistics</a><br>
40
<li>Step 2 : <a href="#READ">The reading of results</a><br>
46
46
Before starting, check that your Perl version is at least 5.005_03 (or higher) by running the <i>perl -v</i> command.
47
If not, you can install a recent Perl interpreter from <a href="http://www.activestate.com/ActivePerl/">ActivePerl</a> (<font color=#221188>Win32</font>) or <a href="http://www.perl.com/pub/language/info/software.html">Perl.com</a> (<font color=#221188>Unix/Linux/Other</font>).<br>
47
If not, you can install a recent Perl interpreter from <a href="http://www.activestate.com/ActivePerl/">ActivePerl</a> (<font color=#221188>Win32</font>) or <a href="http://www.perl.com/pub/language/info/software.html">Perl.com</a> (<font color=#221188>Unix/Linux/Other</font>).<br>
49
<br><a name="INSTALL"><H2 style="font: 22px arial,helvetica,sanserif color: #606060"><u>Step 1 : Install and Setup with configure.pl</u></H2></a>
49
<br><a name="INSTALL"><H2 style="font: 22px arial,helvetica,sans-serif color: #606060"><u>Step 0 : Install and Setup with awstats_configure.pl</u></H2></a>
51
51
<a name="INSTALLAPACHE"><b>A) With Apache or compatible server (on Unix/Linux, Windows, MacOS...)</b></a><br>
53
<font style="color: #111155"><b>* Step 1-1</b>:</font><br>
54
(if you use a package provided with a Linux distribution or Windows installer, this might be
55
already done, however it is recommanded to do it)<br>
53
<font style="color: #111155"><b>* Step 0-1</b>:</font><br>
54
(if you use a package provided with a Linux distribution or Windows installer, action done in step 0-1
55
might have already be done, if you don't know you, do it again)<br>
57
After downloading and running the AWStats package, you must run the configure.pl script.
58
You will find it in the <b>tools</b> directory (If using the windows installer, the script is
57
After downloading and extracting the AWStats package, you should run the awstats_configure.pl script to do
58
several setup actions.
59
You will find it in the AWStats <b>tools</b> directory (If using the windows installer, the script is
59
60
automatically launched):<br>
60
<b><i>perl configure.pl</i></b><br>
62
<u>This is what the script do for you (you can do all of this manually if you prefer):</u><br>
65
A) configure.pl check your apache web server log format configuration.
66
If you use a <b>common</b> log, configure will
61
<b><i>perl awstats_configure.pl</i></b><br>
65
<u>This is what the script do/ask (you can do all those steps manually instead of running awstats_configure.pl if you prefer):</u><br>
68
A) awstats_configure.pl try to find your Apache web server config file (ask path if not found) and check
69
inside your server log format configuration.
70
If you use a <b>common</b> log, awstats_configure.pl will
67
71
suggest to change it to have <b>NCSA combined/XLF/ELF</b> log format (you can use your own log
68
72
format but this predefined logformat is often the best choice and make setup easier).<br>
69
If you answer yes, configure will modify your <b>httpd.conf</b> to change all the
70
following directives (See your apache manual for more information):<br>
73
If you answer yes, awstats_configure.pl will modify your <b>httpd.conf</b> to change all the
74
following directives:<br>
71
75
<i>CustomLog /yourlogpath/yourlogfile common</i><br>
73
77
<i>CustomLog /yourlogpath/yourlogfile combined</i><br>
79
See your Apache manual for more information on this directive.<br>
75
80
To be sure the log format change is effective, later you can stop Apache, remove all old
76
81
log files, restart Apache and go to your homepage. This is an example of records you
77
82
should get then in your new log file:<br>
78
83
<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>
81
B) configure.pl will add, if not already done, the following directives to your Apache config file
86
B) Then, awstats_configure.pl will add, if not already present, the following directives to your Apache config file
82
87
(note that the "/usr/local/awstats/wwwroot" path might differ according to your distribution or OS:<br>
85
<br># Directives to add to your Apache conf file to allow use of AWStats as a CGI.
86
<br># Note that path "/usr/local/awstats/" must reflect your AWStats install path.
88
<br>Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
89
<br>Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
90
<br>Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
91
<br>ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
93
<br># This is to permit URL access to scripts/files in AWStats directory.
95
<br><Directory "/usr/local/awstats/wwwroot">
97
<br> AllowOverride None
100
<br></Directory>
90
<br># Directives to add to your Apache conf file to allow use of AWStats as a CGI.
91
<br># Note that path "/usr/local/awstats/" must reflect your AWStats install path.
93
<br>Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
94
<br>Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
95
<br>Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
96
<br>ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
98
<br># This is to permit URL access to scripts/files in AWStats directory.
100
<br><Directory "/usr/local/awstats/wwwroot">
102
<br> AllowOverride None
103
<br> Order allow,deny
105
<br></Directory>
105
C) configure.pl restart Apache to apply the changes made in A and B.<br>
110
C) awstats_configure.pl restart Apache to apply the changes made in A and B (if changes were made).<br>
108
D) configure.pl will ask you a name for a config profile. Enter here the name of your
113
D) awstats_configure.pl will ask you a name for a config profile file. Enter here the name of your
109
114
web server or any analysis profile name, for example <b>myvirtualhostname</b>.<br>
110
So configure.pl will copy the file <b>awstats.model.conf</b> file into a new file
115
So awstats_configure.pl will copy the file <b>awstats.model.conf</b> file into a new file
111
116
named <b>awstats.myvirtualhostname.conf</b>.
112
You can use the value of your choice instead of "myvirtualhostname". This new file must
114
- For Unix/Linux users: /etc/awstats.<br>
115
- For Windows and other OS: Same directory than awstats.pl (so cgi-bin).<br>
118
E) configure.pl ends.<br>
122
<font style="color: #111155"><b>* Step 1-2</b>:</font><br>
123
Once a config file has been automatically created (by configure.pl or you package
124
installer), it's important to edit it manually and change the "MAIN PARAMETERS"
117
You can use the value of your choice instead of "myvirtualhostname". This new file is stored into:<br>
118
- For Linux/BSD/Unix users: /etc/awstats.<br>
119
- For Mac OS X, Windows and other OS: Same directory than awstats.pl (so cgi-bin).<br>
122
E) awstats_configure.pl ends.<br>
126
<font style="color: #111155"><b>* Step 0-2</b>:</font><br>
127
Once a config file has been automatically created (by awstats_configure.pl, by your package
128
installer or just by a manual copy of awstats.model.conf), it's important to edit it manually and change the "MAIN PARAMETERS"
125
129
to match all your needs:<br>
127
131
This is for example the parameters you should check seriously :<br>
128
- Check/Change <a href="awstats_config.html#LogFile">LogFile</a> value with full path of your web server log file (You
129
can also use a relative path from your awstats.pl directory).<br>
132
- Check/Change <a href="awstats_config.html#LogFile">LogFile</a> value with full path of your server log file (You
133
can also use a relative path from your awstats.pl directory, but full path avoid errors).<br>
130
134
- Check/Change <a href="awstats_config.html#LogType">LogType</a> value with "W" for analyzing
131
135
web server log files, "S" for a streaming server log file, "M" for mail log files, "F" for ftp log files.<br>
132
136
- Check if <a href="awstats_config.html#LogFormat">LogFormat</a> has the value "1" (it means "NCSA apache combined/ELF/XLF log format")
133
137
or use a personalized log format if you don't use combined log format.<br>
134
- Check/Change <a href="awstats_config.html#DirIcons">DirIcons</a> parameter to reflect relative URL of awstats icon directory.<br>
135
138
- Edit <a href="awstats_config.html#SiteDomain">SiteDomain</a> parameter with the main domain name or the intranet
136
139
web server name used to reach the web site to analyze (Example: www.mydomain.com). If you have several
137
140
possible name for same site, add list in <a href="awstats_config.html#HostAlias">HostAlias</a> parameter.<br>
138
- You can change other parameters if you want.<br>
141
<font style="color: #111155"><b>* Step 1-3</b>:</font><br>
142
(if Perl interpreter is correctly setup, this step is not required)<br><br>
143
If necessary, edit the first (top-most) line of awstats.pl file that is<br>
144
<i>#!/usr/bin/perl</i><br>
145
to reflect the path were your Perl interpreter is installed. Default value works for most of Unix OS, but it also might be<br>
146
<i>#!/usr/local/bin/perl</i><br>
147
With Apache for Windows and ActivePerl interpreter, it might be<br>
148
<i>#!c:/program files/activeperl/bin/perl</i><br>
151
Step 1 (Install and Setup) is finished. You can jump to the <a href="#BUILD_UPDATE">Build/Update Statistics</a> section.<br>
141
- You can also change other parameters if you want.<br>
144
Step 0 (Install and Setup) is finished. You can jump to the <a href="#BUILD_UPDATE">Build/Update Statistics</a> section.<br>
156
149
<a name="INSTALLIIS"><b>B) With IIS server</b></a><br>
158
<font style="color: #111155"><b>* Step 1-1</b>:</font><br>
151
<font style="color: #111155"><b>* Step 0-1</b>:</font><br>
160
153
Configure IIS to log in <b>"Extended W3C log format"</b> (You can still use
161
154
your own log format but setup is easier if made like suggested). So, for
182
175
<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>
185
<font style="color: #111155"><b>* Step 1-2</b>:</font><br>
178
<font style="color: #111155"><b>* Step 0-2</b>:</font><br>
187
180
Copy the contents of the provided cgi-bin folder from your hard drive to your server's cgi-bin
188
181
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>
191
<font style="color: #111155"><b>* Step 1-3</b>:</font><br>
184
<font style="color: #111155"><b>* Step 0-3</b>:</font><br>
193
186
Move AWStats <b>icon sub-directories</b> and its content into a directory readable by your
194
187
web server, for example C:\yourwwwroot\icon.<br>
197
<font style="color: #111155"><b>* Step 1-4</b>:</font><br>
190
<font style="color: #111155"><b>* Step 0-4</b>:</font><br>
199
192
Create a config file by copying <b>awstats.model.conf</b> file into a new file named <b>awstats.myvirtualhostname.conf</b>.
200
193
You can use the value of your choice instead of "myvirtualhostname". This new file must be stored in<br>
201
194
- Same directory than awstats.pl (so cgi-bin)<br>
204
<font style="color: #111155"><b>* Step 1-5</b>:</font><br>
197
<font style="color: #111155"><b>* Step 0-5</b>:</font><br>
206
199
Edit this new config file with your own setup :<br>
207
200
- Change <a href="awstats_config.html#LogFile">LogFile</a> value with full path of your web server log file (You
208
201
can also use a relative path from your awstats.pl directory).<br>
209
202
- Change <a href="awstats_config.html#LogType">LogType</a> value with "W" for analyzing
210
203
web server log files, "S" for a streaming server log file, "M" for mail log files, "F" for ftp log files, "O" otherwise.<br>
211
- Change <a href="awstats_config.html#LogFormat">LogFormat</a> to a value with same field's name defined in step 1-1:<br><i>
204
- Change <a href="awstats_config.html#LogFormat">LogFormat</a> to a value with same field's name defined in step 0-1:<br><i>
212
205
LogFormat="date time c-ip cs-username cs-method cs-uri-stem cs-uri-query sc-status sc-bytes cs-version cs(User-Agent) cs(Referer)"</i><br>
213
206
- Change <a href="awstats_config.html#DirIcons">DirIcons</a> parameter to reflect relative path of icon directory.<br>
214
207
- Edit <a href="awstats_config.html#SiteDomain">SiteDomain</a> parameter with the main domain name or the intranet