B / Y / U / S
HOME À¥ È£½ºÆà µµ¸ÞÀÎ ¸Å´º¾ó °í°´Áö¿ø ¼³Á¤Á¤º¸ °èÁ¤½Åû 2024-12-23 Monday 
À¥ È£½ºÆÃ
# °øÁö »çÇ×
# ÀÚÁÖ ¹¯´Â Áú¹®
# Áú¹®°ú ´äº¯
# °¡ÀÔ ¹®ÀÇ
Ä¿¹Â´ÏƼ
# ÀÚÀ¯°Ô½ÃÆÇ
# ¸®´ª½ºÆÁ
# ¾ÆÀÌÅ¥ Å×½ºÆ®
# ³»È¨ ¼Ò°³
# °Ö·¯¸®
# ÀÚ·á½Ç

  ¸®´ª½ºÆÁ  Go Unix Power Tools Online Book Go Bash Guide
Read No. 95 article 2002-02-03 02:37:30
NickName   Ç®ºñ´©
Subject   squid·Î À¥¼­¹ö °¡¼Ó(?)
±Û¾´ÀÌ : EcusE (2001³â 12¿ù 12ÀÏ ¿ÀÈÄ 06:03) ÀÐÀº¼ö: 14 
 squid´Â ÇÁ·Ï½Ã¼­¹ö·Î À̹®¼­¿¡¼­´Â ±âº» À¥¼­¹öÀÇ º¸Á¶¿ªÇÒ¿¡´ëÇØ ±â¼ú(?)ÇÏ°í 
ÀÖ½À´Ï´Ù. 


ÀÛ¼ºÀÚ:Çö âȣ(climbk2 at hitel.net) 
URL:http://www.emperorofjapan.com 

#»ç¿ë¸ñÀû 
squidÀ» accelerator mode·Î »ç¿ëÇÏ´Â ÀÌÀ¯´Â À¥¼­¹öÀÇ ºÎÇÏÀ» ´ú¾îÁÖ±â 
À§ÇÔÀÌ´Ù.ÀÚÁÖ Á¢±ÙµÇ´Â À¥¼­¹öÀÇ ³»¿ëÀ» squidÀÇ Ä³½¬¿¡ ÀúÀå½ÃÄÑ Å¬¶óÀÌ 
¾ðÆ®·ÎºÎÅÍ ¿äûÀÌ ÀÖÀ»½Ã À¥¼­¹ö¿¡ ¿äûÇÏÁö ¾Ê°í ij½¬¿¡¼­ ¹Ù·Î º¸³» ÁÜÀ¸·Î 
½á ¼­¹öÀÇ ÀÌ¿ë·üÀ» ³ôÀÏ ¼ö ÀÖ°Ô µÇ´Â°ÍÀÌ´Ù.Ŭ¶óÀ̾ðÆ®·Î ºÎÅÍ ¿À´Â ¿äûÁß 
ij½¬¿¡ ÀúÀåµÉ ¼ö ¾ø´Â cgi°°Àº ³»¿ë¸¸ À¥¼­¹ö·Î Á÷Á¢ Àü´Þ½ÃÄÑÁÙ »Ó ³ª¸ÓÁö 
ij½¬·Î ÀúÀåÇصΠ¹«¹æÇÑ htmlÀ̳ª gif,jpg°°Àº ³»¿ëÀº ij½¬¿¡¼­ ¹Ù·Î Ŭ¶óÀÌ 
¾ðÆ®·Î ÀÀ´äÀ» ÇØÁÜÀ¸·Î¼­ ¼ÓµµÀ» Áõ°¡½ÃÄÑ ÁÖ´Â ¿ªÇÒÀ» ÇÑ´Ù. 
squid´Â Ŭ¶óÀ̾ðÆ®¿Í À¥¼­¹öÀÇ Áß°£ÀÚ ¿ªÇÒÀ» ¼öÇàÇÑ´Ù°í »ý°¢Çϸé ÀÌÇØÇϱâ 
°¡ ¼ö¿ùÇÒ °ÍÀÌ´Ù.Ŭ¶óÀ̾ðÆ®ÀÇ ¿äûÀ» squid°¡ ¹Þ¾Æ¼­ squidÀÇ cache¿¡ º¸°üµÇ 
¾î ÀÖ´Â ³»¿ëÀº À¥¼­¹ö¿¡ ¿äûÇÏÁö ¾Ê°í squid ÀÚ½ÅÀÌ ¹Ù·Î ó¸®ÇÔÀ¸·Î½á À¥¼­¹ö 
ÀÇ ºÎÇÏÀ» ÁÙÀ̸鼭 Ŭ¶óÀ̾ðÆ®ÀÇ ¿äû¿¡ Á» ´õ »¡¸® ÀÀ´äÇÒ ¼ö ÀÖ°Ô µÇ´Â °ÍÀÌ´Ù. 

¶ÇÇÑ Æ¯Á¤ ÁÖ¼Ò·Î ºÎÅÍÀÇ Á¢¼ÓÀ» Â÷´ÜÇϰųª,ƯÁ¤ ÁÖ¼Ò·Î ÇâÇÏ´Â Á¢¼Ó¸¸ Çã¿ëÇÒ 
¼ö ÀÖÀ¸¸ç ƯÁ¤ Æ÷Æ®·ÎºÎÅÍ ¿À´Â Á¢¼ÓÀ» Â÷´ÜÇÏ´Â ¿ªÇÒ À» ÇÑ´Ù. 

# squidÀÇ ¼³Ä¡ 
squid´Â ¸®´ª½º ¹èÆ÷ÆÇ ½Ãµð¾È¿¡ rpmÆ÷¸ËÀ¸·Î Á¸ÀçÇÔÀ¸·Î °£´ÜÈ÷ ¼³Ä¡ÇÒ ¼ö ÀÖ´Ù. 

rpm -ivh squid-2.3.STABLE4-10.rpm 

¼³Ä¡°¡ ¿Ï·áµÇ¸é ÀÚµ¿ÀûÀ¸·Î /etc/squid,/var/spool/squid,/var/log/squid°¡ 
»ý¼ºµÈ´Ù./etc/squid µð·ºÅ丮°¡ squid¼³Á¤ µð·ºÅ丮ÀÓÀ» ÀØÁö ¸»±â¹Ù¶õ´Ù. 

# squid.conf ¼³Á¤ 
¸ÕÀú ¼³Á¤Çϱ⿡ ¾Õ¼­ ¾ÆÆÄÄ¡ À¥¼­¹ö°¡ ÀÌ¿ëÇÏ´Â 80Æ÷Æ®À» 81Æ÷Æ®·Î ¿Å°ÜÁØ´Ù. 
httpd.conf À¥¼­¹ö ¼³Á¤ ÆÄÀϼ­ "Port 80" À» "Port 81"·Î °íÃÄÁØ´Ù. 

¾Õ¿¡¼­ ¾ð±ÞÇßµíÀÌ squid°¡ À¥¼­¹ö¿Í Ŭ¶óÀ̾ðÅ©°£ÀÇ Áß°£ÀÚ ¿ªÇÒÀ» ÇÑ´Ù°í Çß 
À½À¸·Î Ŭ¶óÀ̾ðÆ®ÀÇ Á¢¼Ó¿äûÀ» squid°¡ Æ÷Æ® 80¹øÀ¸·Î º¯ÇÔ¾øÀÌ ¹Þ¾Æ¼­ ´ÜÁö 
ÀÌ ¿äû¿¡¼­ squid°¡ ÀÚ½ÅÀÇ Ä³½¬¿¡ º¸°üµÈ ³»¿ëÀ» Ŭ¶óÀ̾ðÆ®°¡ ¿äûÇß¸é ¹Ù 
·Î Àü´ÞÇØÁÖ°í,ÀÚ½ÅÀÇ Ä³½¬¿¡ º¸°üµÈ ³»¿ëÀÌ ¾Æ´Ñ ³»¿ëÀº À¥¼­¹ö¿¡ ¿äûÇؼ­ 
Ŭ¶óÀ̾ðÆ®¿¡ ÀüÇØÁØ´Ù. 

ÀÌÁ¦ squidÀ¥ ÇÁ·Ï½Ã ¼­¹öÀÇ ¼³Á¤ÆÄÀÏÀÎ squid.conf ÆÄÀÏÀ» ¼öÁ¤Çؼ­ squid °¡ 
¿¢¼¿·¹ÀÌÅÍ ¸ðµå·Î ÀÛµ¿½ÃÅ°´Â °úÁ¤À» ¼³¸íÇÑ´Ù. 
/etc/squid/squid.conf.default ÆÄÀÏÀ» /etc/squid/squid.conf·Î º¹»çÇؼ­ ÀÌÀ» 
¼öÁ¤ 
Çؼ­ »ç¿ëÇÑ´Ù. 

´ÙÀ½ ºÎºÐÀ» ¼öÁ¤ÇØÁÖ¸é µÈ´Ù. 

*squid.conf ¼³¸í ½ÃÀÛ* 
--------------------------------------------------------------- 
#squid.conf 
# squid°¡ »ç¿ëÇÏ´Â Æ÷Æ®(http_accelerate mode) 
http_port 80 

# squidÀ» accelerate mode·Î »ç¿ëÇÔÀ¸·Î icp»ç¿ë¾ÈÇÔ,'0' means 'not using'. 
icp_port 0 

# Àǹ̾øÀ½ 
acl QUERY urlpath_regex cgi-bin \? 
no_cache deny QUERY 

# squid°¡ »ç¿ëÇÏ´Â ÃÖ¼Ò ¸Þ¸ð¸®,½ÇÁ¦ ¸Þ¸ð¸®ÀÇ 1/3Å©±â·Î ÇØÁÜ 
#³» °æ¿ì 512MÀ» »ç¿ë 
cache_mem 160 MB 

# cache_dir , type, directory, Mbyte ,ùµð·ºÅ丮¼ýÀÚ, ±×ÇÏÀ§µð·ºÅ丮¼ýÀÚ 
#ùµð·ºÅ丮 ¼ýÀÚ¶õ /var/spool/squid/ µð·º¿¡ »ý¼ºµÉ ¼ö ÀÖ´Â µð·ºÅ丮 ¼öÀ» 
¸»ÇÑ´Ù. 
#±× ÇÏÀ§ µð·ºÅ丮 ¼ýÀÚ¶õ /var/spool/squid/example/ µð·º¿¡ »ý¼ºµÉ ¼ö ÀÖ´Â 
µð·ºÅ丮 ¼öÀ» ¸»ÇÑ´Ù. 
#¾Æ·¡ÀÇ Àǹ̴ ,directory = /var/spool/squid,Mbyte = 100M,ùµð·ºÅ丮 = 
16°³,ÇÏÀ§µð·ºÅ丮 = 256 °³ 
cache_dir ufs /var/spool/squid 100 16 256 

# cache replacement policy,based on frequency 
replacement_policy GDSF 

# Access Control List(acl) 
# acl aclname acltype string <<-- ¼ø¼­ ÇÊÈ÷ ÁöÄÑÁÖ¾î¾ßÇÑ´Ù. 
# aclname :ÀڱⰡ ÆíÇÑ´ë·Î Áö¾îÁÖ¸é µÈ´Ù.(°¡·É hateaddress,blockshit...) 
# acltype :src dst srcdomain dstdomain url_pattern urlpath_pattern time port 
proto method browser user :case sensitive 
#Áï ´ë¼Ò¹®ÀÚÀ» ÁÖÀÇÇؾßÇÑ´Ù. 
# i.e) acl localnet src 192.168.1.0/255.255.255.0 
# acl myself myip 211.211.211.211/255.255.255.255 
# acl block srcdomain .sarang.net <-srang.netÀ» ÁÖ¼Ò·ÎÇÏ´Â Á¢¼Ó½Ãµµ 
# acl blockport port 1-1023 
# acl Safe_ports port 23 
# 0.0.0.0/0.0.0.0 ¸ðµç °÷À¸·Î ºÎÅÍ ½ÃµµµÇ´Â Á¢¼Ó 
acl all src 0.0.0.0/0.0.0.0 

# allow or deny :À§ ºÎºÐ¿¡ ÀÛ¼ºÇÑ acl Áß aclnameÀ» ÀÌ¿ëÇؼ­ Á¢¼Ó Â÷´Ü,Çã¿ëÀ» 
ÀÛ¼ºÇÑ´Ù. 
# http_access deny blockport <-blockport¶õ °¡Áø À̸§ °¡Áø acl Â÷´Ü 
# http_access deny !Safe_ports <-Safe_ports°¡ ¾Æ´Ñ°ÍÀº Â÷´Ü 
#(i.e) http_access deny block <--À§ ºÎºÐ acl listÀÇ ¿¹¹®Áß sarang.netÀ» 
ÁÖ¼Ò·Î ÇÏ´Â Á¢¼Ó½ÃµµÀ» Â÷´ÜÇÑ´Ù. 
http_access allow all 

# squid °ü¸®ÀÚ 
cache_mgr emperorofjapan11 at emperorofjapan.com 

# cache°¡ squid¶õ uid/gid·Î ÀÛµ¿,º¸¾ÈÀ» À§ÇØ 
cache_effective_user squid 
cache_effective_group squid 

# squid°¡ ÀÛµ¿Çϴ ȣ½ºÆ® 
httpd_accel_host 211.20x.x1.1x6 <--squid°¡ ÀÛµ¿µÇ´Â È£½ºÆ® ip³ª È£½ºÆ® À̸§À» 
Àû¾îÁØ´Ù. 

# ¾ÆÆÄÄ¡°¡ ÀÛµ¿ÇÏ°í ÀÖ´Â Æ÷Æ® 
httpd_accel_port 81 <--¾ÆÆÄÄ¡°¡ µ¹¾Æ°¡´Â Æ÷Æ® 

# icpÀ» »ç¿ëÇÏÁö ¾ÊÀ½À¸·Î ´ç¿¬È÷ 'off' 
log_icp_queries off 

# cachemgr À» À§ÇÑ password,¾Æ·¡ ºÎºÐ¿¡ ¼³¸íÀÌ ÀÖ´Ù. 
# cachemgr_passwd password all 
cachemgr_passwd password all 


# ·Î±× ÆÄÀÏÀÇ ½Å¼ÓÇÑ ÀÛ¼ºÀ» À§ÇØ 'on' 
buffered_logs on 


----------------- 
*squid ¼³¸í ¿Ï·á* 

#±âŸ »çÇ× 
# squid ±âº» ¼³Á¤ µð·ºÅ丮 /etc/squid 
# squid cache µð·ºÅ丮 /var/spool/squid 
# squid log µð·ºÅ丮 /var/log/squid 
# squid error ¼³Á¤ /etc/squid µð·ºÅ丮 ³»¿¡¼­ 
ln -s /usr/lib/squid/errors/Korean errors ÇÏ¸é ¿¡¸Ó¸Þ½ÃÁö°¡ Çѱ۷Π³ª¿È 
# squid accelerator mode´Â html,gifµî cacheÇÒ ¼ö ÀÖ´Â contentsÀ» squid 
# cache³»¿¡ ÀúÀå,ÇÏÁö¸¸ cgiµî°ú°°ÀÌ cacheÇÒ ¼ö ¾ø´Â contents´Â apache¼­¹ö¿¡ 
# Á÷Á¢ ¿äûÇÏ´Â ¿ªÈ°À» ÇÑ´Ù. 
# httpd_accel_host virtual <-virtual web hosting 
# httpd_accel_with_proxy on <-accelerator mode¿Í proxy¸ðµå ÇÔ²² »ç¿ë½Ã 

# howto cache manager (cachemgr.cgi) :ij½¬ ¸Å³ÊÁ® »ç¿ëÇϱâ 
cp /usr/lib/squid/cachemgr.cgi /usr/local/apache/cgi-bin/ 
http://hostname/cgi-bin/cachemgr.cgi <-¿þºê¶ó¿ìÀú·Î Á¢¼ÓÇؼ­ ¾Æ·¡ ºÎºÐÀ» 
ÀÛ¼ºÇϸé Á¢¼Ó¿Ï·á 
Cache Host: localhost 
Cache port: 80(accelerator mode),8080(proxy mode) 
Manager name:squid 
Password : password(squid.conf¿¡ Àû¾îÁØ Æнº¿öµå) 

Á¢¼ÓÀÌ ¿Ï·áµÇ¸é ij½¬ ¸Å³ÊÁ®À» »ç¿ëÇؼ­ ¼öÁ¤À» ÇØÁÙ¼ö ÀÖ´Ù. 


------------------------------------- 
#³»°¡ »ç¿ëÇÏ´Â °£·«ÇÑ squid.conf ¼³Á¤ÆÄÀÏ ¿¹Á¦ 
# ÇÊ¿äÇÑ ºÎºÐ¸¸ ¼öÁ¤Çؼ­ /etc/squid/squid.conf ·Î º¹»çÇؼ­ 
# »ç¿ëÇصµ µÈ´Ù. 

http_port 80 
icp_port 0 
acl QUERY urlpath_regex cgi-bin ? 
no_cache deny QUERY 
cache_mem 170 MB 
cache_dir ufs /var/spool/squid 100 16 256 
replacement_policy GDSF 
acl all src 0.0.0.0/0.0.0.0 
http_access allow all 
cache_mgr climbk2 at hitel.net 
cache_effective_user squid 
cache_effective_group squid 
httpd_accel_host 192.168.1.1 
httpd_accel_port 81 
log_icp_queries off 
cachemgr_passwd password all 
buffered_logs on 

------------------------------------------------------- 

#Squid ½ÇÇà/Á¤Áö 
/etc/init.d/squid start/stop/restart <--ÀÚ½ÅÀÇ ½Ã½ºÅÛ¿¡ µû¸£°ÚÁö¸¸ °ÅÀÇ 
ºñ½ÁÇÏ´Ù.
Regist Addr [ 192.168.0.2 ] ¸ñ·Ïº¸±â À­±Û ¾Æ·§±Û
Á¤±ÔÇ¥Çö½Ä [ »ó¼¼ °Ë»ö ]
Page Loading [ 0.03 Sec ] SQL Time [ 0 Sec ]

Copyleft 1999-2024 by JSBoard Open Project
Theme Designed by IDOO And follow GPL2

°³ÀÎÁ¤º¸ Ãë±Þ¹æħ ÀÌ¿ë ¾à°ü »çÀÌÆ® ¸Ê ¾îµå¹Î °ü¸®