Linux:
Ubuntu-maverick-10.10-amd64-server
* Ubuntu is used to install software conveniently and quickly.
Detach squid
Sudo apt-get purge remove squid
Install squid
Sudo aptitude install squid
Cd/etc/squid
Sudo mv squid. conf squid_bak.conf
Sudo vi squid. conf
Google tests a website. Code segment:
Http_port 80 vhost
Cache_dir ufs/var/squid_cache 256 16 256
Acl all src 0.0.0.0/0.0.0.0
Http_access allow all
# Cache_access_log/var/log/squid/access. log
# Cache_log/var/log/squid/cache. log
Cache_peer 67.18.180.141 parent 80 0 no-query originserver weight = 1 name = hc_peer
Cache_peer_domain hc_peer www.linuxidc.com
Cache_peer_access hc_peer allow all
Refresh_pattern-I. css $1440 50% 129600 ignore-reload
Refresh_pattern-I. xml $1440 50% 129600 ignore-reload
Refresh_pattern-I. html $1440 90% 129600 reload-into-ims
Refresh_pattern-I. shtml $1440 90% reload-into-ims
Refresh_pattern-I. htm $1440 90% reload-into-ims
Refresh_pattern-I. jpg $1440 90% 129600 reload-into-ims
Refresh_pattern-I. png $1440 90% 129600 reload-into-ims
Refresh_pattern-I. gif $1440 90% 129600 ignore-reload
Refresh_pattern-I. bmp $1440 90% 129600 reload-into-ims
Refresh_pattern-I. js $1440 90% 129600 ignore-reload
ESC-": wq
At that time, I encountered a problem where the sudo command was not used. As a result, the modified items could not be saved and I did not know how to exit. Later I learned how to use shift + q, and then input: q! Strong retreat.
Restart squid:
Sudo/usr/sbin/squid-k parse
Sudo/usr/sbin/squid-k reconfigure
* Each time you modify squid. conf, you must restart squid to make it take effect.
/Usr/sbin/squid-z
/Usr/sbin/squid start
View Network Connections:
Netstat-
View port 80 usage:
Sudo lsof-I: 80