Varnish cache,或稱Varnish,是一套高效能的反向網站快取伺服器(reverse proxy server)。
其他的類似產品還有Nginx 或是 Squid 可供選擇

官方網站
https://www.varnish-cache.org/

安裝步驟
# vi /etc/yum.repos.d/varnish.repo

[varnish]
name=Varnish for Enterprise Linux 6
baseurl=https://repo.varnish-cache.org/redhat/varnish-4.0/el6/
enabled=1
gpgkey=https://repo.varnish-cache.org/GPG-key.txt
gpgcheck=1

存檔離開

# yum -y install varnish
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.cs.nctu.edu.tw
 * epel: mirror01.idc.hinet.net
 * extras: centos.cs.nctu.edu.tw
 * updates: centos.cs.nctu.edu.tw
Resolving Dependencies
--> Running transaction check
---> Package varnish.x86_64 0:4.0.4-1.el6 will be installed
--> Processing Dependency: jemalloc for package: varnish-4.0.4-1.el6.x86_64
--> Processing Dependency: gcc for package: varnish-4.0.4-1.el6.x86_64
--> Processing Dependency: libjemalloc.so.1()(64bit) for package: varnish-4.0.4-1.el6.x86_64
--> Running transaction check
---> Package gcc.x86_64 0:4.4.7-18.el6 will be installed
--> Processing Dependency: cpp = 4.4.7-18.el6 for package: gcc-4.4.7-18.el6.x86_64
--> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-18.el6.x86_64
---> Package jemalloc.x86_64 0:3.6.0-1.el6 will be installed
--> Running transaction check
---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed
--> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
--> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
---> Package cpp.x86_64 0:4.4.7-18.el6 will be installed
--> Processing Dependency: libmpfr.so.1()(64bit) for package: cpp-4.4.7-18.el6.x86_64
--> Running transaction check
---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed
---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package           Arch           Version                 Repository       Size
================================================================================
Installing:
 varnish           x86_64         4.0.4-1.el6             varnish         1.5 M
Installing for dependencies:
 cloog-ppl         x86_64         0.15.7-1.2.el6          base             93 k
 cpp               x86_64         4.4.7-18.el6            base            3.7 M
 gcc               x86_64         4.4.7-18.el6            base             10 M
 jemalloc          x86_64         3.6.0-1.el6             epel            100 k
 mpfr              x86_64         2.4.1-6.el6             base            157 k
 ppl               x86_64         0.10.2-11.el6           base            1.3 M

Transaction Summary
================================================================================
Install       7 Package(s)

Total download size: 17 M
Installed size: 39 M
Downloading Packages:
(1/7): cloog-ppl-0.15.7-1.2.el6.x86_64.rpm               |  93 kB     00:00
(2/7): cpp-4.4.7-18.el6.x86_64.rpm                       | 3.7 MB     00:00
(3/7): gcc-4.4.7-18.el6.x86_64.rpm                       |  10 MB     00:00
(4/7): jemalloc-3.6.0-1.el6.x86_64.rpm                   | 100 kB     00:00
(5/7): mpfr-2.4.1-6.el6.x86_64.rpm                       | 157 kB     00:00
(6/7): ppl-0.10.2-11.el6.x86_64.rpm                      | 1.3 MB     00:00
(7/7): varnish-4.0.4-1.el6.x86_64.rpm                    | 1.5 MB     00:04
--------------------------------------------------------------------------------
Total                                           2.1 MB/s |  17 MB     00:08
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : ppl-0.10.2-11.el6.x86_64                                     1/7
  Installing : cloog-ppl-0.15.7-1.2.el6.x86_64                              2/7
  Installing : mpfr-2.4.1-6.el6.x86_64                                      3/7
  Installing : cpp-4.4.7-18.el6.x86_64                                      4/7
  Installing : gcc-4.4.7-18.el6.x86_64                                      5/7
  Installing : jemalloc-3.6.0-1.el6.x86_64                                  6/7
  Installing : varnish-4.0.4-1.el6.x86_64                                   7/7
  Verifying  : cpp-4.4.7-18.el6.x86_64                                      1/7
  Verifying  : varnish-4.0.4-1.el6.x86_64                                   2/7
  Verifying  : jemalloc-3.6.0-1.el6.x86_64                                  3/7
  Verifying  : mpfr-2.4.1-6.el6.x86_64                                      4/7
  Verifying  : gcc-4.4.7-18.el6.x86_64                                      5/7
  Verifying  : ppl-0.10.2-11.el6.x86_64                                     6/7
  Verifying  : cloog-ppl-0.15.7-1.2.el6.x86_64                              7/7

Installed:
  varnish.x86_64 0:4.0.4-1.el6

Dependency Installed:
  cloog-ppl.x86_64 0:0.15.7-1.2.el6        cpp.x86_64 0:4.4.7-18.el6
  gcc.x86_64 0:4.4.7-18.el6                jemalloc.x86_64 0:3.6.0-1.el6
  mpfr.x86_64 0:2.4.1-6.el6                ppl.x86_64 0:0.10.2-11.el6

Complete!
 



安裝好的varnish 預設路徑
/etc/varnish/default.vcl

undefined
關鍵技術:CDN內容傳遞網路

Content Delivery Network
作者: 梁潔, 陳戈, 莊一嶸  
出版社:佳魁資訊  
出版日期:2017/03/28
語言:繁體中文
定價:480元

arrow
arrow
    文章標籤
    centos redhat yum varnish
    全站熱搜

    helloworld 發表在 痞客邦 留言(0) 人氣()