[squid-users] Squid4 multi-instance configuration

Peter Viskup skupko.sk at gmail.com
Tue Feb 20 13:53:27 UTC 2018


Feel free to use this systemd (based on postgresql) and logrotate
configuration for multi-instance configuration according wiki [1].
Might be useful for others.

The instance is "enabled" by presence of
/etc/squid/${service_name}.instance file.

There could be includes like these in squid.conf

pid_filename /var/run/squid/${service_name}.pid # required
include /etc/squid/conf.d/${service_name}-http_port.conf # at least
http_port needs to differ
include /etc/squid/conf.d/${service_name}-cache_dir.conf # cache_dir
needs to differ either
include /etc/squid/conf.d/${service_name}-log.conf # log targets needs
to differ either

Example of http_port configuration
~# cat conf.d/test-http_port.conf
http_port 8080 name=${service_name} # see the use of ${service_name}
macro in included files

And services are managed via systemd
~# systemctl start squid at prod.service
~# systemctl status squid at prod.service

[1] https://wiki.squid-cache.org/MultipleInstances

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: squid.logrotate
Type: application/octet-stream
Size: 394 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20180220/bc9f68e8/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: squid.service
Type: application/octet-stream
Size: 191 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20180220/bc9f68e8/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: squid at .service
Type: application/octet-stream
Size: 919 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20180220/bc9f68e8/attachment-0002.obj>


More information about the squid-users mailing list