The introduction of squid allows you to find a lot of stuff on the Internet. We recommend a good document:
Http://home.arcor.de/mailerstar/jeff/squid/index.html
Install squid according to the above steps. In fact, the most important thing about squid is to configure and understand the concept.
Squid is an important tool for reverse proxy. The reverse proxy and forward proxy can be understood as follows:
1. Forward Proxy: the proxy with roots and roots. The client sends a request to proxy A, which forwards the request directly to proxy B. This requires proper client configuration.
2. Reverse Proxy: a bit like a dynamic include tag. The client sends a request to proxy A, which sends a request to target B and returns the result to the client.
Squid, as the response proxy, generally understands the concept of two ports. One is the listening port, that is, http_port is 3128 by default. Another is the proxy port. For example, port 21 of FTP 8080.
These ports can be understood as follows: when a user sends a request to port 3128. Squid, the user will find port 8080 in the proxy for reverse proxy.
Squid's simple command application:
1 squid-K parse it is recommended to modify the configuration file squid. conf. Run and run.
2. Squid-Z initializes the cache directory.
3. Squid-D1 execution level 1. Run on the foreground
4. Execute squid-s in the background. PS aux | grep squid can be used to view two squid processes.
5. Squid-K reconfigure: After modifying the configuration file, you can repeat it like this. If the cache directory is modified, execute squid-Z again.
6. Squid-K restart kill shutdown to restart. Kill the process. Close the Request command.
Appendix: A simple squid configuration. In the window.
Visible_hostname pony.asia
# Recommended minimum Configuration:
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 to_localhost DST 127.0.0.0/8
ACL ssl_ports port 443
ACL safe_ports port 80 # HTTP
ACL safe_ports port 8080 # Tomcat
ACL safe_ports port 21 # ftp
ACL safe_ports port 443 # https
ACL safe_ports port 70 # Gopher
ACL safe_ports port 210 # wais
ACL safe_ports port 1025-65535 # unregistered ports
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
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
# Http_port 3128
Http_port 80 accel vhost vport
Cache_peer 127.0.0.1 parent 8080 0 no-query originserver
Cache_mem 8 MB
Maximum_object_size_in_memory 8 KB
Memory_replacement_policy LRU
Cache_replacement_policy LRU
Cache_dir ufs c:/squid/cache 100 16 256
Store_dir_select_algorithm least-Load
Max_open_disk_fds 0
Minimum_object_size 0 KB
Maximum_object_size 4096 KB
Access_log C:/squid/logs/access. Log squid
Cache_log C:/squid/logs/cache. Log
Cache_store_log C:/squid/logs/store. Log
Mime_table C:/squid/etc/mime. conf
Pid_filename C:/squid/logs/squid. PID
Coredump_dir C:/squid/var/Cache