When I try install MySAR (MySQL Squid Access Report 2.1.4) on my FreeBSD 9 server I have got many problems. Now I want to write installation process and solutions of those problems in this article.
Get mysar port
Create Apache virtual host
Options Indexes FollowSymLinks
Allow from all
ServerAdmin [email protected]
CustomLog /var/log/mysar.domain.com-access_log combined
192.168.0.1 is Your server IP address
Install and Configure MySAR MySQL database
Create and edit config.ini file
Open mysar.domain.com and install MySAR MySQL database
cp /usr/local/mysar/etc/config.ini.example /usr/local/mysar/etc/config.ini
Open and edit Crontab
# mysar not only runs every minute but it also expects to be run every minute.
# If you wish to change this, you need to adjust not only the cron entries below but also the $maxRunTime inside bin/mysar-importer.php
* * * * * root /usr/local/mysar/bin/mysar-resolver.php > /usr/local/mysar/log/mysar-resolver.log 2>&1
0 0 * * * root /usr/local/mysar/bin/mysar-maintenance.php > /usr/local/mysar/log/mysar-maintenance.log 2>&1
## PHP - Slow but tested. The defult choice, for now.
* * * * * root /usr/local/mysar/bin/mysar-importer.php > /usr/local/mysar/log/mysar-importer.log 2>&1
## Binary. Fast but untested. Needs compile. Check README.
#* * * * * root /usr/local/bin/mysar > /usr/local/mysar/log/mysar-importer.log 2>&1
[box type=”warning”]If You are using stansard MySAR scripts, be informed, that here is a wrong paths in /usr/local/mysar/etc/* files. If needed change /usr/local/mysarbin/mysarbin to /usr/local/mysarbin/mysar/bin and /usr/local/mysarwww to /usr/local/mysar/www[/box]
Also in my computer I have changed first lines of php files located in /usr/local/mysar/bin to #!/usr/local/bin/php
Optional: Disable administrator menu