3 Mar 2014

Centos: Squid + Report + Webmin gui


1) to install WEBMIN administration gui , you first have to manually ad the repository for YUM:



$ vi /etc/yum.repos.d/webmin.repo

----- add ----
[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1
----- add ----



2) then you have to download & install the webmin GPG public key:



$ wget http://www.webmin.com/jcameron-key.asc
$ rpm --import jcameron-key.asc



3) install webmin with yum:


$ yum install webmin



4) at this point you should have you GUI already running on port 10000:

       open url:  http://servername:10000


5) now you can install SQUID and SARG (squid analysis report generator):


$ rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
$ yum install squid sarg
$ find / -name sarg.conf 


6) UPDATE:

due to some needs, i ended up using the latest SARG version instead of the one supplied via YUM which is quite old and lacking of some nice features!

So these are the steps i followed:

1) unistalled sarg via YUM --> yum unistall sarg
2) download latest SARG --> wget http://sourceforge.net/projects/sarg/files/latest/download
3) extract it to /usr/src --> tar xvzf sarg.latest.tgz
4) install it --> basically you have to follow the isntruction in the README file
  • $ cd /usr/src/sarg-2.3.8
  • $ ./configure
  • $ make
  • $ sudo make install
remember to update your /etc/sarg/sarg.conf for your needs, especially for the folder where you want to save your reports.

NOTE for WEBMIN --> be sure to have the same config parameters in your sarg.cong and in your webming interface.


5) i installed my own version of cronjob to create a report every 15 minutes:

  • */15 9-19 * * * /usr/local/bin/sarg -d day-0 -f /etc/sarg/sarg.conf -n

6) last but not least, i also added an "hostalias" file to summarize the logs coming from the same domains:

--- add this line in the /etc/sarg/sarg.conf ---
hostalias /etc/sarg/hostalias

--- and add a new file named /etc/sarg/hostalias containing something like that ---
*.googlevideo.com www.googlevideo.com
*.googlevideo.com:443 www.googlevideo.com











No comments: