Koozali.org: home of the SME Server

squid and bannerfilter redirector

Shane

squid and bannerfilter redirector
« on: June 25, 2002, 01:40:15 PM »
Squid appears to not find bannerfilter-1.05. I created and put bannerfilter-1.05 into /usr/share/bannerfilter-1.05 with 0755 permissions on all files and squid and root as owner and group.
I can run bannerfilter ok from the command line as "perl /usr/share/bannerfilter-1.05/redirector.pl" whilst logged in as root. Cold this be a permissions or wrong directory level, or something to do with esmith security?
I'd prefer to keep these additional programs in the directory of my choice.
I have had it running previously, when I put bannerfilter into a different directory, but i cant remember where.

And yes, i did get caugt once by opening the perl script in ms notepad and it rewrote all the ctl m's. But i fixed it up with joe, and consequently the script now runs.


regards,
Shane M Dwyer

Jon Blakely

Re: squid and bannerfilter redirector
« Reply #1 on: June 25, 2002, 03:40:46 PM »
Shane,

As per the install instructions, you have

5) Add a line to squid.conf:
redirect_program /path/to/redirector.pl

6) Restart Squid, and make sure everything works. You should be able to go to http://bannerfilter.internal/test.html and get a Web page; if so, installation was successful.


Jon

Shane

Re: squid and bannerfilter redirector
« Reply #2 on: June 25, 2002, 05:16:28 PM »
Thanks Jon,
I seemed to have followed the instructions ok.
I did have it running when bannerfilter was loaded in a different directory, but squid doesn't like it when i put bannerfilter where I want to

 Squid "cache.log" entries as follows:-

helperOpenServers: Starting 5 'redirector.pl' processes
2002/06/25 22:13:21| ipcCreate: PARENT: hello read test failed
2002/06/25 22:13:21| --> read returned 31
2002/06/25 22:13:21| --> got 'hi%20there%0a2002/06/25%2022:13:21%7c%20i'
2002/06/25 22:13:21| WARNING: Cannot run '/usr/share/bannerfilter-1.05/redirector.pl' process.

regards,
Shane M Dwyer

Jon Blakely

Re: squid and bannerfilter redirector
« Reply #3 on: June 26, 2002, 05:41:58 AM »
Shane,

I decided to install this myself last night and got it working. Heres what I did:

create Ibay called bannerfilter. Keep settings as default.

# mkdir /usr/local/squid

copy bannerfilter-1.05.tar.gz to /usr/local/squid and unpack.
copy contents of /www directory to ibay bannerfilter/html
modify redirector.pl line
$WWW='http://127.0.0.1/bannerfilter/'; to read
$WWW='http://my_server/bannerfilter/';

create squid template fragment
# pico /etc/e-smith/templates/etc/squid/squid.conf/90re-direct

with the following in it

redirect_program /usr/local/squid/redirector.pl

save and expand template
# /sbin/e-smith/expand-template /etc/squid/squid.conf

restart squid
# /etc/rc.d/init.d/squid restart

and you should be done. Test as per install instructions.

Jon

Mike Dhani

Re: squid and bannerfilter redirector
« Reply #4 on: May 10, 2003, 12:48:49 PM »
I just try your instructions for bannerfilter installation.
How I know this is work? Where is the log file for it?
Thanks

Jens

Re: squid and bannerfilter redirector
« Reply #5 on: August 15, 2003, 12:32:30 AM »
I installed Bannerfilter today using the instructions in the tarball with some modifications.
1) I but the www stuff under my primary site in a dir called 'bannerfilter'. 'chown -R www:www /home/e-smith/files/primary/html/bannerfilter' plus 'chmod -R 444  /home/e-smith/files/primary/html/bannerfilter'
2) Put the rest in a dir called '/home/e-smith/files/bannerfilter' to have it backed up by backup to desktop.
3) Modified update.sh to use wget.
4) Copied the conf file to /etc and edited it to point at the right directory. Also added a line near the bottom: 'LOG = /var/log/bannerlog'
5) 'touch /var/log/bannerlog' and 'chmod 666 /var/log/bannerlog'
6) Added a single line to /etc/squid/squid.conf: 'redirect_program /home/e-smith/files/redirector.pl'
7) Restarted squid. (/etc/rc.d/init.d/squid restart )
8) Tested by going to a known bannersite. It worked - and the log showed what had been blocked and why.
9) Wrote a template like John's.
10) Wrote a simple script for weekly update using update.sh and put it in /etc/cron.weekly.

I think that's it. Several ways of going about it really. :-) (If I knew how to create RPMs I would give it a shot. Fairly simple package).

/Jens