1 Check if squid software is installed
# Rpm-qa|grep Squid
2 If it is not installed, install it using the Yum method
# yum-y Install Squid
3 Setting up boot from
# chkconfig--level squid on//automatic squid service on 3 and 5 levels
4, configuration
Squid's main configuration file is/etc/squid/squid.conf, all squid settings are configured in this file, let us explain the configuration options for this file.
Http_port 3128//Set IP and port number for listening
CACHE_MEM//extra memory for squid, squid memory is always X *
10+15+ "Cache_mem", where x is the capacity used by the cache of squid (in gigabytes),
For example, the following cache size is 100M, or 0.1GB, the memory is always occupied as
0.1*10+15+64=80m, the recommended size is 1/3-1/2 or more of physical memory.
Maximum_object_size 4 MB//Set squid disk cache Max file, files over 4M not saved to hard disk
Minimum_object_size 0 KB//Set Squid disk cache minimum file
Maximum_object_size_in_memory 4096 KB//Set squid memory cache Max file, files over 4M not saved to memory
Cache_dir UFS/VAR/SPOOL/SQUID 100 16 256//define the cache storage path for squid, the cache directory capacity (unit m), a
Number of cache directories, level two cache directory
Logformat combined%>a%ui%un [%tl] "%rm%ru http/%rv"%Hs%<st "%{referer}>h" "%{user-agent}>h"%Ss: %sh//log File Log format
Access_log/var/log/squid/access.log combined//log file storage path and log format
Cache_log/var/log/squid/cache.log//Set cache log
Logfile_rotate//log Round 60 days
Cache_swap_high//cache directory usage is greater than 95%, start cleaning up the old cache
Cache_swap_low//cache directory Cleanup to 90% stops.
ACL localnet src 192.168.1.0/24//define local network segment
Http_access Allow LocalNet//allows local network segments to be used
Http_access deny all//Reject All
Visible_hostname Squid.david.dev//host Name
cache_mgr [email protected]//admin mailbox
Squid installation and configuration (centos6.5)