Initial Experience of setting up Squid cache server in Ubuntu

Source: Internet
Author: User

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

 

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.