Make sure you make all changes as user “root”.

Install Webalizer

apt-get install webalizer

First change the default webalizer config.

nano /etc/webalizer/webalizer.conf

Incremental processing allows multiple partial log files to be used instead of one huge one. And OpenPanel creates multiple files by default, so lets set “incremental” to yes.

#Incremental     no
Incremental     yes

OpenPanel created apache log files per virtual host, so we don’t have to do that by ourselves. The access log files are located at “/var/log/apache2/openpanel/logs”.

To generate stats from an apache access log file, you’ll have to execute the following command:

/usr/bin/webalizer -c /etc/webalizer/webalizer.conf -n -s -r -q -T -o /var/www/webalizer/ /var/log/apache2/openpanel/logs/

I created a shell script to automatically create stats for all virtual hosts. Put it for example at “/opt/”



cd ${logDir}
for file in *.log
  if [ -f ${file} ]; then
    virtualHost=`basename ${file} .log`

    # Only create stats from log files that belong to virtual hosts
    if [ -d ${vhostDir}/${virtualHost} ]; then

      # Create stats directory for the virtual host if it doesn't exist yet
      if [ ! -d ${webalizerStatsDir}/${virtualHost} ]; then
        mkdir ${webalizerStatsDir}/${virtualHost}

      # Create stats
      /usr/bin/webalizer -c ${webalizerConf} -n ${virtualHost} \
      -s ${virtualHost} -r ${virtualHost} -q -T -o ${webalizerStatsDir}/${virtualHost} \

Create a cronjob for it with:

crontab -e

And add the following file to generate stats every 5 minutes:

*/5 * * * * /opt/

If you want to view the stats in your browser go to “http://myserveripaddress/webalizer/”. But you probably also want access with “”. To make this happen, extend your virtual host file with:

nano /etc/apache2/openpanel.d/

And add:

Alias /webalizer /var/www/webalizer/

Restart the Apache web server

service apache2 restart

And you’re done! Everything should be working smoothly now.

Password protection

Optionally, you can also add password protection to the Webalizer directory. This way your stats will not be publicly available for everyone. Add the following commands to add the protection.

nano /var/www/webalizer/.htaccess

And add:

AuthGroupFile /dev/null
AuthName "Password Protected Area"
AuthType Basic
AuthUserFile /var/www/webalizer/.htpasswd
require valid-user

Create .htpasswd:

touch /var/www/webalizer/.htpasswd

And add a user (for example “admin”), you’ll be prompted to define a password.

htpasswd /var/www/webalizer/.htpasswd admin

Restart Apache web server

service apache2 restart

All your virtual host stats are password protected now with the user/pass defined above.