1. If squid is not installed in the system, enter the command in the following order to complete the installation.
# Wget http://www.squid-cache.org/Versions/v3/3.0/squid-3.0.STABLE18.tar.gz // download the Squid Agent installation package
# Tar-zxvf squid-3.0.STABLE18.tar.gz // extract the Squid installation package
# Cd squid-3.0.STABLE18
#. /Configure -- prefix =/usr/local/squid -- sysconfdir =/usr/local/squid/etc -- bindir =/usr/local/squid/bin -- sbindir =/usr/local /squid/sbin -- mandir =/usr/local/squid/share/man -- enable-gnuregex -- enable-carp -- enable-async-io = 80 -- enable-removal-policies = heap, lru -- enable-icmp -- enable-delay-pools -- enable-useragent-log -- enable-referer-log -- enable-kill-parent-hack -- enable-snmp -- enable-arp- acl -- enable-htcp -- enable-cache-digests -- enable-default-err-language = Simplify_Chinese -- enable-err-extensions ages = "Simplify_Chinese" -- enable-poll -- enable-linux- netfilter -- disable-ident-lookups -- enable-underscores -- enable-auth = "basic" -- enable-basic-auth-helpers = "NCSA" -- enable-external-acl-helpers = "ip_user" -- enable-x-accelerator-vary // configure the Squid Agent installation path
# Make // compile
# Make install // install the Squid agent software
----------------------------------
2. After installation, the configuration file is in the/usr/local/squid/etc directory, delete the original squid. conf configuration file, create the squid. conf file, and only enter the following content:
Http_port 80 transparent
Http_access allow all
Note: The above is the configuration of squid2.6 and later versions. If it is a squid of a version earlier than 2.6, the configuration is as follows:
Http_port 80
Httpd_accel_host virtual
Httpd_accel_port 80
Httpd_accel_with_proxy on
Httpd_accel_uses_host_header on
----------------------------------
3. the squid in the/usr/local/squid/sbin directory is the running file.
Run squid-z to create a cache folder for the first time. The cache folder is created under/usr/local/squid/var. Therefore, run chmod 777/usr/local/squid/var to grant the folder permission before creating the cache.
Run squid-d 1 and enable squid.
To disable squid, run squid-k shutdown to disable it safely.
Note: If the newly installed squid is not configured as an environment variable, try to run./squid in the sbin directory to avoid running the existing squid on the server.
----------------------------------
4. Set a DNS server to resolve all domain names to the IP addresses of the servers to be proxy, such as using Bind and WinMyDns software. Set the DNS of the server where squid is located to this DNS server.
5. Resolve all domain names of the proxy server to the server where squid is located. Then, the server can be used as a transit server.
----------------------------------
Possible problems:
Sometimes an error occurs when Squid is run:
ClientNatLookup: NF getsockopt (SO_ORIGINAL_DST) failed: (92) Protocol not available
However, it does not seem to affect access