[squid-users] Mysar not working

From: Shaun <chinner999_at_gmail.com>
Date: Fri, 17 Jun 2011 09:18:04 -0600

Hi guys,
Seems like I have a permission problem. Details are as follows.
-Server is Ubuntu 10.10 (LAMP)

-Squid v3.1.6
- Squint V1.2.6 (working)

- Mysar v2.1.4 (not working) - modified log location to point to
/var/log/squid3 via web GUI

http://x.x.x.x/mysar
MySQL Squid Access Report 2.1.4

Current active users: 0
Current date and time is: 16-06-2011 07:39:12
Last processed record: 31-12-1969 17:00:00
Number of records processed at last import: 0
Last clean-up of the database was done at: 00-00-0000

wget http://sourceforge.net/projects/mysar/files/mysar/2.1.4/mysar-2.1.4.tar.gz
 Tar xvf mysar-2.1.4.tar.gz

sudo tar zxvf mysar-2.1.4.tar.gz -C /usr/local

sudo ln -s /usr/local/mysar/etc/mysar.apache /etc/apache2/conf.d/mysar
 sudo /etc/init.d/apache2 restart
  - Point your browser to the /mysar/ directory of your server and
follow the instructions, for example:
         http://x.x.x.x/mysar/
Followed web installation guide for "new install"
 cd /usr/local/mysar/etc
 sudo cp config.ini.example config.ini
sudo rm -rf /usr/local/mysar/www/install
sudo ln -s /usr/local/mysar/etc/mysar.cron /etc/cron.d/mysar

sudo restart cron

cat /var/log/syslog
Jun 16 07:29:35 Squid2 init: cron main process (3142) killed by TERM signal
Jun 16 07:29:35 Squid2 cron[3568]: (CRON) INFO (pidfile fd = 3)
Jun 16 07:29:35 Squid2 cron[3569]: (CRON) STARTUP (fork ok)
Jun 16 07:29:35 Squid2 cron[3569]: Error: bad day-of-week; while
reading /etc/crontab
Jun 16 07:29:35 Squid2 cron[3569]: (*system*) ERROR (Syntax error,
this crontab file will be ignored)
Jun 16 07:29:35 Squid2 cron[3569]: (*system*mysar) WRONG INODE INFO
(/etc/cron.d/mysar)
Jun 16 07:29:35 Squid2 cron[3569]: (CRON) INFO (Skipping @reboot jobs
-- not system startup)

cat mysar.cron
# 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 &gt;
/usr/local/mysar/log/mysar-resolver.log 2&gt;&amp;1
0 0 * * * root /usr/local/mysar/bin/mysar-maintenance.php
&gt; /usr/local/mysar/log/mysar-maintenance.log 2&gt;&amp;1

# IMPORTER
## PHP - Slow but tested. The defult choice, for now.
* * * * * root /usr/local/mysar/bin/mysar-importer.php &gt;
/usr/local/mysar/log/mysar-importer.log 2&gt;&amp;1

## Binary. Fast but untested. Needs compile. Check README.
#* * * * * root /usr/local/bin/mysar &gt;
/usr/local/mysar/log/mysar-importer.log 2&gt;&amp;1
oxadmin@...$ cat /usr/local/mysar/etc/mysar.cron
# 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 &gt;
/usr/local/mysar/log/mysar-resolver.log 2&gt;&amp;1
0 0 * * * root /usr/local/mysar/bin/mysar-maintenance.php
&gt; /usr/local/mysar/log/mysar-maintenance.log 2&gt;&amp;1

# IMPORTER
## PHP - Slow but tested. The defult choice, for now.
* * * * * root /usr/local/mysar/bin/mysar-importer.php &gt;
/usr/local/mysar/log/mysar-importer.log 2&gt;&amp;1

## Binary. Fast but untested. Needs compile. Check README.
#* * * * * root /usr/local/bin/mysar &gt;
/usr/local/mysar/log/mysar-importer.log 2&gt;&amp;1

Troubleshooting
Figured I would try to run the 2 commands that should run every minute
manually to see what the results are

sudo /usr/local/mysar/bin/mysar-resolver.php &gt;
/usr/local/mysar/log/mysar-resolver.log 2&gt;&amp;1
-bash: /usr/local/mysar/log/mysar-resolver.log: Permission denied

sudo /usr/local/mysar/bin/mysar-maintenance.php &gt;
/usr/local/mysar/log/mysar-maintenance.log 2&gt;&amp;1
-bash: /usr/local/mysar/log/mysar-maintenance.log: Permission denied

Here is the permission for the/usr/local/mysar/bin and
/usr/local/mysar/log directories
ls /usr/local/mysar/bin -hal
total 32K
drwxrwxr-x 3 root root 4.0K 2007-08-17 03:05 .
drwxr-xr-x 12 root root 4.0K 2007-08-17 03:05 ..
drwxrwxr-x 4 root root 4.0K 2007-08-17 03:05 mysar-binary-importer
-rwxrwxr-x 1 root root 11K 2007-08-17 03:05 mysar-importer.php
-rwxrwxr-x 1 root root 2.7K 2007-08-17 03:05 mysar-maintenance.php
-rwxrwxr-x 1 root root 2.6K 2007-08-17 03:05 mysar-resolver.php

ls /usr/local/mysar/log -hal
total 8.0K
drwxrwxr-x 2 root root 4.0K 2011-06-16 07:45 .
drwxr-xr-x 12 root root 4.0K 2007-08-17 03:05 ..
-rw-rw-r-- 1 root root 0 2007-08-17 03:05 .keep

I have not modified mysar-resolver.php mysar-maintenance.php.

Any thoughts?

Thanks.
Received on Fri Jun 17 2011 - 15:18:12 MDT

This archive was generated by hypermail 2.2.0 : Fri Jun 17 2011 - 12:00:02 MDT