Squid installation and configuration (centos6.5)

Source: Internet
Author: User
Tags define local

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%&gt;a%ui%un [%tl] "%rm%ru http/%rv"%Hs%<st "%{referer}>h" "%{user-agent}&gt;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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.