Squid configuration
*/etc/squid/squid.conf:
icp_port 0 htcp_port 0 hierarchy_stoplist cgi-bin ? cache_swap_low 90 cache_swap_high 95 maximum_object_size 4096 KB ipcache_size 1024 ipcache_low 90 ipcache_high 95 fqdncache_size 1024 cache_access_log /var/log/squid/access.log cache_dir ufs /var/cache/squid 240000 32 256 cache_log /var/log/squid/cache.log cache_mem 3000 MB cache_store_log /var/log/squid/store.log emulate_httpd_log off mime_table /etc/squid/mime.conf log_mime_hdrs off useragent_log none pid_filename /var/run/squid.pid log_fqdn off client_netmask 255.255.255.255 ftp_user Squid@ ftp_list_width 32 refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern . 0 20% 4320 acl all src 0.0.0.0/0.0.0.0 acl manager proto cache_object acl localhost src 127.0.0.1/255.255.255.255 acl SSL_ports port 443 563 acl Safe_ports port 80 21 443 563 70 210 1025-65535 acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT # allow cachemgr protocol for SqStat - Anfang: acl webserver src 172.16.68.170/255.255.255.255 http_access allow manager webserver # allow cachemgr protocol for SqStat - Ende http_access allow manager localhost http_access deny manager http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow all icp_access allow all miss_access allow all # wenn "TrendMicro ISVW6" -> "Squid" -> "Internet" # Vorteil: # evtl Viren-kontaminierter Squid-cache wird immer mit aktuellsten Pattern gescannt # http_port 8080 #--- TrendMicro InterScan Viruswall als Parent-Proxy Spezial-Config-Anfang: # wenn "Squid" -> "TrendMicro ISVW6" -> "Internet" # Vorteil: # genaues Monitoring wer, wann welche Seiten angeschaut hat http_port 8585 cache_peer 127.0.0.1 parent 8080 7 no-query default never_direct allow all server_persistent_connections off forwarded_for on log_mime_hdrs on #--- TrendMicro InterScan Viruswall als Parent-Proxy Spezial-Config-Ende
Squid dies as soon as the access.log file gets to 2GB, with the following error message:
FATAL: logfileWRite: /usr/local/squid/var/logs/access.log:(0) Success.
/etc/logrotate.d/squid:
/var/log/squid/cache.log { compress dateext maxage 365 rotate 99 size=10M notifempty missingok create 640 squid root postrotate /etc/init.d/squid reload endscript } /var/log/squid/access.log { compress dateext maxage 365 rotate 99 size +100M notifempty missingok create 640 squid root postrotate /etc/init.d/squid reload endscript } /var/log/squid/store.log { compress dateext maxage 365 rotate 99 size=10M notifempty missingok create 640 squid root postrotate /etc/init.d/squid reload endscript }
or: (???)
"/var/log/squid/access.log" {
rotate 5
mail [email protected: w...@my.org]
size=100k
sharedscripts
postrotate
/sbin/killall -HUP squid
endscript
}