2017.04.26 / 21:48
1) À¥ °¡¼Ó±â ±¸ÃàÇϱâ - Varnish
tomcater
Ãßõ ¼ö 92
ÃÖ±Ù »ç³» ¼ºñ½º À¥ÀÌ Á¡Á¡ ´À·ÁÁö°íÀÖ´Ù. ±×·¡¼ À¥ °¡¼Ó±â¸¦ »ý°¢Çß´Ù.
¼³Ä¡°¡ ½±°í, ¼³Á¤µµ ½±´Ù.
1) ´Ù¿î·Îµå(CenOS 5.x)
https://www.varnish-cache.org/releases
¼¹ö ¹öÀü¿¡ ¸Â´Â rpmÀ» ´Ù¿î¹Þ´Â´Ù.
# wget https://repo.varnish-cache.org/redhat/varnish-3.0.el5.rpm
2) ÆÐÅ°Áö ¼³Ä¡
# rpm --nosignature -i varnish-3.0.el5.rpm
# yum install varnish
* ¾Æ·¡ÀÇ ¿¡·¯°¡ ¹ß»ýÇϸé Á¶Ä¡ÇÑ´Ù.
varnish-3.0.7-1.el5.centos.i386 from varnish-3.0 has depsolving problems
--> Missing Dependency: libedit.so.0 is needed by package varnish-3.0.7-1.el5.centos.i386 (varnish-3.0)
Error: Missing Dependency: libedit.so.0 is needed by package varnish-3.0.7-1.el5.centos.i386 (varnish-3.0)
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# yum install varnish (´Ù½Ã ¼³Ä¡)
3) ȯ°æ ¼³Á¤
3-1. ½Ã½ºÅÛ ±¸¼º(±¸¼º1·Î ¼³¸í)
±¸¼º1) Apache(80) --> (8070)Varnish(8080) --> Tomcat(8080)
±¸¼º2) Apache(80) --> (8070)Varnish(8080) --> Tomcat(8080)
3-2. ¿¬µ¿¼³Á¤(Front-End)
# vi /etc/sysconfig/varnish
VARNISH_LISTEN_PORT=8070 => Apache ¿¬µ¿Æ÷Æ®
VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
3-3. ¿¬µ¿¼³Á¤(Back-End)
# vi /etc/varnish/default.vcl
backend default {
.host = "127.0.0.1";
.port = "8080"; => Tomcat ¿¬µ¿Æ÷Æ®
}
4) ÀÚµ¿½ÇÇà µî·Ï
# chkconfig --level 345 varnish on
5) ¼ºñ½º ½ÇÇà
# /etc/init.d/varnish start
* µµ¿òÀÚ·á : https://www.varnish-cache.org/docs
* /etc/varnish/default.vclÀ» ÅëÇÏ¿© ´Ù¾çÇÑ µ¥ÀÌÅÍ Ã³¸® ¼³Á¤ÀÌ °¡´ÉÇÏ´Ù.