Thursday, September 29, 2011

How To Install And Run Webalizer From Source Code And How To Configure Apache For Webalizer

Hello Everybody,
Today, I will explain, briefly, how to install and run Webalizer and how to configure apache for webalizer at the same machine box. First download the source code from following address: http://www.webalizer.org/download.html (Download .tgz file). Then go to the location of this file (.tgz)and run following commands:

1. yum install gcc libpng libpng-devel gd gd-devel zlib zlib-devel
2. tar xvzf webalizer-2.23-05-src.tgz
3. cd webalizer-2.23-05
4. ./configure --prefix=/webalizer ------> Here you can specify the destination of installation. You change to somewhere else.
5. make
6. make install
7. cp /webalizer/etc/webalizer.conf.sample /webalizer/etc/webalizer.conf ----> Change to your path if you already changed it.
8. vi /webalizer/etc/webalizer.conf ------>  Uncomment and change the following lines(don't forget to change the path to your path):
    LogFile        /apa2/logs/access_log
    OutputDir      /apa2/usage
    HistoryName     /webalizer/webalizer.hist
    Incremental     yes
    IncrementalName /webalizer/webalizer.current
    Quiet           yes
    FoldSeqErr      yes
    HideURL         *.gif
    HideURL         *.GIF
    HideURL         *.jpg
    HideURL         *.JPG
    HideURL         *.png

    HideURL         *.PNG
    HideURL         *.ra


9. mkdir /apa2/usage   ------> change the /apa2 to the location of your Server root.
10. vi /apa2/conf/httpd.conf ------> change the path to the location of your httpd.conf
11. Add the following lines to your httpd.conf ------> change the /apa2 to the location of your Server root.

    <IfModule mod_alias.c>

      Alias /usage/ "/apa2/usage/"
          <Directory "/apa2/usage">
          Options None
          AllowOverride None
          Order deny,allow
          Deny from all
          Allow from 127.0.0.1
          </Directory>

    </IfModule>


12. Restart apache:  ------> change the /apa2 to the location of your Server root.
    
    /apa2/bin/apachectl restart

13. To run Webalizer manually, to generate reports, use the following command:

    /webalizer/bin/webalizer   ------> Change /webalizer/ to the location of your Webalizer. For example, if you installed Webalizer in /abc, just change it to /abc/bin/webalizer

Now, whenever you want to get the new report, you should do the step 13 manually. To run this command automatically, use cron job.

14. To see the result, open the browser and enter the following url:

     http://127.0.0.1/usage/

Now, you should see the result on the browser. For any question, please leave a comment. I will try to answer as soon as possible.

Regards,
Khosro Taraghi

No comments:

Post a Comment