티스토리 뷰

LAYER 4 & 7

squid 3.X 설치 예제

초보의 CHOMAN 2015.06.12 11:00
# ./configure --prefix=/usr/local/squid -enable-gnuregex -enable-carp -enable-async-io=80 -enable-removal-policies=heap,lru -enable-icmp -enable-delay-pools -enable-useragent-log -enable-snmp -enable-arp-acl -enable-htcp -enable-underscores -enable-auth -enable-x-accelerator-vary -enable-cache-digests -enable-poll -enable-linux-tproxy -enable-linux-netfilter -with-pthreads -with-aio -with-filedescriptors=65536 -enable-default-err-language=ko-kr
# make 
# make install

squid.conf
visible_hostname img1.mojily.com
visible_hostname img2.mojily.com
http_port 8080 vhost vport
cache_mem 512 MB
maximum_object_size_in_memory 10240 KB
memory_replacement_policy lru
cache_dir ufs /usr/local/squid/var/cache 512 16 256
#max_open_disk_fds 0
minimum_object_size 0 KB
maximum_object_size 15 MB
※ VirtualHost 적용
cache_peer img1.mojily.com parent 80 0 no-query no-digest originserver name=img1
cache_peer img2.mojily.com parent 80 0 no-query no-digest originserver name=img2
cache_peer_domain img1 img1.mojily.com
cache_peer_domain img2 img2.mojily.com
#cache_peer_access img1 allow all
http_access allow all
cache_effective_user nobody
cache_effective_group nobody
logformat combined %>a %ui %un [%{%d/%b/%Y:%H:%M:%S +0000}tl] "%rm %ru HTTP/%rv" %<Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
access_log /usr/local/squid/var/logs/access.log combined
cache_log /usr/local/squid/var/logs/cache.log
cache_store_log /usr/local/squid//var/logs/store.log
#coredump_dir /usr/local/squid/var/cache
#refresh_pattern ^ftp: 60 20% 10080
#refresh_pattern ^gopher: 60 0% 1440
#refresh_pattern ^gopher: 60 0% 1440
#refresh_pattern . 0 20% 1440
refresh_pattern -i \.css$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.js$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.html$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.gif$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.swf$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.jpg$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.png$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.bmp$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.doc$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.ppt$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.xls$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.pdf$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.rar$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.zip$ 0 70% 86400 reload-into-ims
refresh_pattern -i \.txt$ 0 70% 86400 reload-into-ims
logfile_rotate 5
memory_pools on
memory_pools_limit 0
client_db off
#always_direct allow all
error_directory /usr/local/squid/share/errors/ko-kr
uri_whitespace deny
high_response_time_warning 1500
store_dir_select_algorithm least-load

 

http://www.mediawiki.org/wiki/Manual:Squid_caching

# 서버IP 및 웹서버 포트(8080) 
cache_peer xxx.xxx.xxx.xxx parent 8080 0

# squid 가 사용할 포트(80) 및 웹서버 포트(8080) 
http_port 80 accel defaultsite=xxxxxxxx.com:8080

'LAYER 4 & 7' 카테고리의 다른 글

Squid result codes  (0) 2015.06.12
squid 기본 개념 정리  (0) 2015.06.12
squid 3.X 설치 예제  (0) 2015.06.12
squid 프로세스 재시작 스크립트  (0) 2015.06.12
squid 설치 및 셋팅  (0) 2015.06.11
squid caching 이용하지 않기 only squid  (0) 2015.06.11
댓글
댓글쓰기 폼
공지사항
Total
662,876
Today
2
Yesterday
231
링크
«   2018/08   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
글 보관함