MySAR

MySQL Squid Access Report is a reporting system for user web traffic activity, as logged from a squid proxy. MySAR consists of two parts: Command line utilities which import a squid log file in a MySQL database and maintain the database and a web interface for accessing the reports.

Prerequisites

Installation

cd /extra/source
wget http://softlayer-ams.dl.sourceforge.net/project/mysar/mysar/2.1.4/mysar-2.1.4.tar.gz
tar zxf mysar-2.1.4.tar.gz
mv mysar /usr/local/

Configure your Apache Web Server to point the /mysar/ directory to the local directory /usr/local/mysar/www/.

Alias /mysar "/usr/local/mysar/www"
<Directory "/usr/local/mysar/www">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>

Restart your webserver and then use your web browser to load http://<your server>/mysar. Follow the provided instructions for installing MySAR. You will need to create the config file, /usr/local/mysar/etc/config.ini, with the information provided. Once installation is done, remove the MySAR install directory:

rm -rf /usr/local/mysar/www/install

In the MySAR web interface Administration options (http:///mysar/index.php?a=administration), adjust the location the Squid access log:

/usr/local/squid/var/logs/access.log

Add the cron jobs that will automatically parse the Squid log files. On a CentOS machine with /etc/cron.d, this can be done by linking the included cron.d task which will run every minute:

chmod go-w /usr/local/mysar/etc/mysar.cron
ln -s /usr/local/mysar/etc/mysar.cron /etc/cron.d/mysar

The import scripts expect that the PHP binary will be located in /usr/bin, if it's not, link it there:

ln -s /usr/local/bin/php /usr/bin/php

Binary Log Importer

cd /usr/local/mysar/bin/mysar-binary-importer
./configure --with-mysql-lib=/usr/local/mysql/lib
make
make install

Recent Updates

  • 1 month 21 hours ago
    1.27.2 update
  • 1 month 1 week ago
    Drupal 10/11 config
  • 1 month 1 week ago
  • PHP
    1 month 1 week ago
    PHP 8.3.11 and AlmaLinux
  • 1 month 1 week ago
    New version of Pound