# find /home/jsmith/awstats/ -type f -name *.pl | xargs chmod 0755 # find /home/jsmith/awstats/ -type f | xargs chmod 0644 The following lines do all this: # find /home/jsmith/awstats/ -type d | xargs chmod 0755 Because the Perl scripts (*.pl files) need to be executable, we set their mode to 0755. So, we set the mode to 0755 for directories and 0644 for all files. The last part of the installation process is to set the appropriate permissions to the AWstats directories and files.
We also need to copy some images, which are used in the HTML or PDF traffic reports, to the traffic directory: # cp -R /home/jsmith/awstats/wwwroot/icon/ /home/jsmith/public_html/traffic/ This means that it will not be possible to use as a CGI script to generate reports dynamically (directly from our statistical data), but this behaviour can easily be changed. Only the traffic reports will be accessible through a web browser. Using this installation scheme, we avoid exposing the awstats scripts to the internet.
Assuming that our DocumentRoot is /home/jsmith/public_html/, we create a new directory in there: # mkdir /home/jsmith/public_html/traffic The directory which will hold the traffic reports can be located inside our web site’s root directory, so that they are accessible from a web browser. So, we create the first one inside the awstats installation directory: # mkdir /home/jsmith/awstats/statdata
We will need to create two more directories, one for the awstats statistical data and one for the traffic reports (static HTML pages). You may want to rename this to just awstats: # mv awstats-X.X awstats This is where all scripts and other supplemental files are installed. So, download the latest awstats version from the Project Page and extract it: # tar -xzvf awstats-X.X.tar.gz -C /home/jsmith/Ī new directory ( awstats-X.X) is created in our Home. We will install the AWstats package in our Home directory. Custom installation in our Home directory For this article we will use an apache log file in the " combined" format. This is not necessary though.Īctually, only the last one is a necessity, as awstats can be configured to generate statistics even from heavily customized log formats. This means that the log files contain the visitors’ hostnames instead of their IP addresses in the HOST field.