Typical configurations of squid. conf

Source: Internet
Author: User
Tags squid proxy
The typical configuration of squid. conf is 2010-02-1212:241. The configuration # vietcsquidsquid. conf # http_port Command tells squid on which port to listen for HTTP requests. The default port is 3128. In addition to the following format, it can also be http_port192.168.63.50: 3128http_port3128ic

Squid. squid. typical configuration of conf (Common proxy) 2010-02-12. configuration # vi/etc/squid. the conf # http_port Command tells the port on which the squid listens for HTTP requests. The default port is 3128. In addition to the following format, it can also be http_port 192.168.63.50: 3128 http_port 3128 ic

Squid. confTypicalConfiguration

Squid. confTypicalConfiguration(Normal proxy.Configuration
# Vi/etc/squid. conf

# The http_port Command tells the port on which the squid listens for HTTP requests. The default port is 3128. In addition to the following format, it can also be http_port 192.168.63.50: 3128.
Http_port 3128
Icp_port 3130

# Set the cache directory. You can set multiple cache directories. Syntax: <目录所在>
Cache_dir ufs/var/spool/squid 1000 64 1024

# The following is the Directory and file name for storing log files!
Cache_access_log/var/log/squid/access. log
Cache_log/var/log/squid/cache. log
Cache_store_log/var/log/squid/store. log
Pid_filename/var/run/squid. pid

# Disable the authentication mechanism. In some versions, squid is automatically added to the proxy authentication mechanism, which is not required in general cases. Therefore, locate the lines including auth_param and add comments to them.
# Auth_param basic children 5
# Auth_param basic realm Squid proxy-caching web server
# Auth_param basic credentialsttl 2 hours

# Set squid users, user groups, and administrator accounts
Cache_inclutive_user squid
Cache_paitive_group squid
Cache_mgr youraccount@your.e.mail

# Memory-relatedConfiguration: Because my system memory is small, I only give 8 MB! If your physical memory is large, such as 512 MB, you can increase it to 64 or 128 MB.
Cache_mem 128 MB

# Disk capacity-relatedConfiguration(Note: The following 90 and 95 are percentages.) If your cache_dir disk is large, you can change 4096 to 32768 KB.
Cache_swap_low 90
Cache_swap_high 95
Maximum_object_size 4096 KB

# Memory-based Data StorageConfiguration
Maximum_object_size_in_memory 8 KB

# Define the acl (Access Control List). Syntax: acl <ConfigurationContent>
# For user-defined part

Acl All src 0/0
Acl Manager proto cache_object
Acl Localhost src 127.0.0.1/32
Acl Safe_ports port 80 21 443 563 70 210 280 488 591 777-1025
Acl SSL_ports 443 563
Acl CONNECT method CONNECT
Acl MyNetwork src 192.168.0.0/16

# Use the previously defined acl to define access control rules
Http_access allow Manager Localhost
Http_access deny Manager
Http_access deny! Safe_ports
Http_access deny CONNECT! SSL_ports
Http_access allow MyNetwork
Http_access deny All

# Define the relationship with other proxy servers. Syntax: <主机名称> <类别> <其它参数>
Cache_peer 192.168.60.6 parent 4480 7 no-query default

# Set the relationship with other proxy servers:
# <上层 proxy>
# Cache_peer_access 192.168.60.6 allow aclxxx
# Cache_peer_access 192.168.60.6 deny! Aclxxx

Coredump_dir/var/spool/squid

2. Activate squid
1). You should verify the squid before enabling it.ConfigurationWhether the file is correct. Run the following command:

# Squid-k parse

If you cannot see the output,ConfigurationThe file is valid. You can continue with the subsequent steps. However, ifConfigurationFile Inclusion error. squid will tell you:

2) initialize the cache directory, that is, create the storage format of the cache directory.

Run the command before starting the squid service for the first time (before running squid for the first time, or whenever you add a new cache_dir, you must initialize the cache directory .)

# Squid-z

The cache directory initialization may take some time, depending on the size and quantity of the cache directory, as well as the disk drive speed. If you want to observe this process, use the-X option:

# Squid-zX

3) Start the squid service

# Service squid start

If squid is installed in the/usr/local/squid directory

#/Usr/local/squid/sbin/squid-sD

4). Stop squid

The safest way to stop squid is to use the squid-k shutdown command:

# Squid-k shutdown

5). HeavyConfigurationRunning squid Process

After you understand

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.