1
Web Proxy Filtering and Caching / Re: [SOLVED] Squidguard
« on: May 07, 2022, 05:20:33 pm »Would you mind sharing your squidguard conf so others get an idea what would be possible to solve?
Sure thing

First, you must ssh into your device and, after this, you must have squidguard installed (I already posted previously how to do it) and you should install a text editor (like nano: pkg install nano)
My "squidGuard.conf" is something like (located inside "/usr/local/etc/squid/")(it was basically what I had on pfSense):
Code: [Select]
logdir /var/log/squid
dbhome /usr/local/etc/squid/db
dest block {
expressionlist expressions
}
acl {
default {
pass !block any
redirect http://localhost/sgerror.php
}
}After modifying "squidGuard.conf" to your liking, you have to add your lists (in my case, I had 1 list: "expressions", inside "/usr/local/etc/squid/db" / my rules are regex based, that's why I used "expressionlist").
Now you have to generate squidguard's database, using:
Code: [Select]
squidGuard -C allNext, you must change your database(s) ownership, using:
Code: [Select]
chown -R squid:squid /usr/local/etc/squid/dbAfter all the previous steps, you have to add squidguard support inside squid. For this, I created a "squid.conf.local" (located inside "/usr/local/etc/squid/"), to avoid losing squidguard support, every time I make a change in "Web Proxy" GUI. Inside the file add:
Code: [Select]
url_rewrite_program /usr/local/bin/squidGuard -c /usr/local/etc/squid/squidGuard.confFinally, you have to reconfigure/restart squid, to activate the configuration:
Code: [Select]
/usr/local/sbin/squid -k reconfigureCode: [Select]
/usr/local/etc/rc.d/squid restart (I'm not sure if this is required, but I do it anyways)And that's it, I think I didn't forget anything and I hope it helps.
If someone has a suggestion or sees something wrong, please, don't be shy and step forward. I would really appreciate it

PS:
I would like to apologize for any vocabulary/grammatical mistakes. I'm not an English native speaker.


