Install and Configure Awstats in CWP

How to install and Configure awstats on Centos Web Panel

1) Download and install Awstats 7.3

cd /usr/local/src
tar zxvf awstats-7.3.tar.gz
mv awstats-7.3 /usr/local/apache/htdocs
cd /usr/local/apache/htdocs/awstats-7.3/tools
Do you want to continue setup from this NON standard directory [yN] --> y
Do you want me to setup Apache to write 'combined' log files [y/N] ? --> y
Do you want me to build a new AWStats config/profile file (required if first install) [y/N] --> y
Your web site, virtual server or profile name: -->
Directory path to store config file(s) (Enter for default): --> press enter

2) Change Permission of awstats-7.3

cd /usr/local/apache/htdocs
chown -R nobody:nobody awstats-7.3

3) Create directory to store awstats data file. (username is username of the account)

mkdir -p /home/username/awstats
chown username:username /home/username/awstats

4) Change data directory and log file path.

cd /etc/awstats 

Find DirData="/var/lib/awstats" and replace this with DirData="/home/username/awstats"

Find LogFile="/var/log/httpd/mylog.log" and replace it with LogFile="/usr/local/apache/logs/access_log"

5) Remove access_log and restart apache

rm -rf /usr/local/apache/logs/access_log
server httpd restart

6) Manually update logs or add it in cron job

perl /usr/local/apache/htdocs/awstats-7.3/wwwroot/cgi-bin/ -update

7) Check if Awstats is working.


Note: Many more modification is possible according to your need. This is just normal awstats installation for centos web panel.
  • 16 Users Found This Useful
Was this answer helpful?