[squid-users] Squid.conf in a DB Mysql

Alex Rousskov rousskov at measurement-factory.com
Sat Jul 9 22:08:00 UTC 2022


On 7/9/22 17:07, Marcelo wrote:

> Is it possible to use MySQL and PHP programming to put squid rules 
> outside of squid.conf?

Yes, for some definition of "put outside":

* One can use external ACL to make match/mismatch decisions (and supply 
metadata to Squid from) "outside" of the Squid process. Many Squid 
directives are controlled by ACLs, so one can control the corresponding 
Squid behavior from the "outside" by using external ACLs and/or 
annotations set by external ACLs. You can find examples of external ACL 
helpers/programs in src/acl/external/ directory. Your helper program can 
be written in most languages, but there are some (possibly stale) 
caveats at [1]. An external ACL is a _slow_ ACL; some Squid directives 
only support "fast" ACLs[2].

* One can generate squid.conf file (or portions of the configuration 
included into that file) from the information in a database (or from any 
other source of information), of course. You will need to reconfigure or 
restart (depending on what has changed and other factors) the Squid 
instance for Squid to notice such configuration changes.

[1] 
https://wiki.squid-cache.org/Features/AddonHelpers#What_language_are_helper_meant_to_be_written_in.3F

[2] http://wiki.squid-cache.org/SquidFaq/SquidAcl


HTH,

Alex.



> I heard about it using external acl, but can find any documentation or 
> good example of it.
> 
> I would like to “transfer” parameters as ACLs, HTTP_ACCESS, HTTP_PORT, 
> and TCP_OUTGOING_ADDRESS from squid.conf to a DB+PHP solution.
> 
> Marcelo
> 
> 
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users



More information about the squid-users mailing list