1. Install squid # rpmivhsquid -*. rpm2. Back up squid configuration file squid. conf # cpetcsquidsquid. confhome3. Delete the default squid configuration file # cdetcsquid # rmfsquid. conf4, create a squid configuration file # cdetcsquid # touchetcsquidsquid. conf5,
1. Install squid # rpm ivh squid -*. rpm 2. Back up the squid configuration file squid. conf # cp/etc/squid. conf/home 3. Delete the default squid configuration file # cd/etc/squid # rm f squid. conf 4. Create the squid configuration file # cd/etc/squid # touch/etc/squid. conf 5,
1. Install squid
# Rpm-ivh squid-*. rpm
2, Backup squidConfigurationFile squid. conf
# Cp/etc/squid. conf/home
3, Delete default squidConfigurationFile
# Cd/etc/squid
# Rm-f squid. conf
4, Create squidConfigurationFile
# Cd/etc/squid
# Touch/etc/squid. conf
5, Edit the new squidConfigurationFile
# Cd/etc/squid
# Vi squid. conf
InConfigurationFile:
Http_port ip: Port # Set the ip address and port number of the squid listener
Cache_mem 128 MB # Set the memory cache size
Cache_dir ufs/var/spool/squid 4096 16 256 # Set hard disk cache size 4096 to hard disk space 16 to the number of first-level directories 256 to the number of second-level Directories
Cache_inclutive_user squid # Set a valid account using the cache
Cache_effective_group squid # Set a valid group using the cache
Dns_nameservers 202.106.0.20 # Set the dns server
Cache_access_log/var/log/squid/access. log # Set access logs
Cache_log/var/log/squid/cache. log # Set cache logs
Cache_store_log/var/log/squid/store. log # Set the webpage storage log
Visible_hostname ip # Set the squid host address
Cache_mgr webmaster@localhost.com # Set administrator mail
Acl all src 0.0.0.0/0.0.0.0 # Set the access control list
Http_access allow all # Set http access permissions
Error_directory/usr/share/squid/errors/Simplify_chinese # Set the error message to Chinese
6, Initialize squid
# Cd/usr/sbin
# Squid-z
7, Start squid service
# Service squid start
8, Add auto start
# Ntsysv
9, View hit rate
# Cd/usr/sbin
#./Squidclient-p listening port-h host address mgr: info
10, ConfigurationReverse Proxy
# Cd/etc/squid
# Vi squid. conf
InConfigurationAdd the following content to the file:
Cache_peer {target server ip} parent {target server port} 0 no-query originserver weight = 1 name = {alias} # create an alias for the target server
Cache_peer_domain {alias} {target server domain name or ip} # map aliases to servers
Cache_peer_access {alias} allow all # Set Access Permissions
Use iptablesConfigurationPort redirection: redirects the service port of the target server to the squid port.
Note: The squid reverse proxy requires dns support and cannot be parsed through the host file.
AboveConfigurationThe method is only applicable to squid2.6 or a later version.
For more information, please contact the author!