Step 1 : Install and Setup with configure.pl
A) With Apache or compatible server (on Unix/Linux, Windows, MacOS...)
* Step 1-1:
(if you use a package provided with a Linux distribution or Windows installer, action done in step 1-1 might have already be done, if you don't know you, do it again)
After downloading and extracting the AWStats package, you should run the configure.pl script to do several setup actions. You will find it in the AWStats tools directory (If using the windows installer, the script is automatically launched
perl configure.pl
This is what the script do/ask (you can do all those steps manually instead of running configure.pl if you prefer
A) configure.pl try to find your Apache web server config file (ask path if not found) and check inside your server log format configuration. If you use a common log, configure.pl will suggest to change it to have NCSA combined/XLF/ELF log format (you can use your own log format but this predefined logformat is often the best choice and make setup easier).
If you answer yes, configure.pl will modify your httpd.conf to change all the following directives:
CustomLog /yourlogpath/yourlogfile common
into
CustomLog /yourlogpath/yourlogfile combined
See your Apache manual for more information on this directive.
To be sure the log format change is effective, later you can stop Apache, remove all old log files, restart Apache and go to your homepage. This is an example of records you should get then in your new log file:
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)"
B) Then, configure.pl will add, if not already present, the following directives to your Apache config file (note that the "/usr/local/awstats/wwwroot" path might differ according to your distribution or OS:
#
# Directives to add to your Apache conf file to allow use of AWStats as a CGI.
# Note that path "/usr/local/awstats/" must reflect your AWStats install path.
#
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
C) configure.pl restart Apache to apply the changes made in A and B (if changes were made).
D) configure.pl will ask you a name for a config profile file. Enter here the name of your web server or any analysis profile name, for example myvirtualhostname.
So configure.pl will copy the file awstats.model.conf file into a new file named awstats.myvirtualhostname.conf. You can use the value of your choice instead of "myvirtualhostname". This new file is stored into:
- For Linux/BSD/Unix users: /etc/awstats.
- For Mac OS X, Windows and other OS: Same directory than awstats.pl (so cgi-bin).
E) configure.pl ends.
* Step 1-2:
Once a config file has been automatically created (by configure.pl, by you package installer or just by a manual copy of awstats.model.conf), it's important to edit it manually and change the "MAIN PARAMETERS" to match all your needs:
This is for example the parameters you should check seriously :
- Check/Change LogFile value with full path of your web server log file (You can also use a relative path from your awstats.pl directory).
- Check/Change LogType value with "W" for analyzing web server log files, "S" for a streaming server log file, "M" for mail log files, "F" for ftp log files.
- Check if LogFormat has the value "1" (it means "NCSA apache combined/ELF/XLF log format") or use a personalized log format if you don't use combined log format.
- Edit SiteDomain parameter with the main domain name or the intranet 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 HostAlias parameter.
- You can also change other parameters if you want.
Step 1 (Install and Setup) is finished. You can jump to the Build/Update Statistics section.