Home | 簡體中文 | 繁體中文 | 雜文 | 知乎專欄 | Github | OSChina 博客 | 雲社區 | 雲棲社區 | Facebook | Linkedin | 視頻教程 | 打賞(Donations) | About
知乎專欄多維度架構 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者”

第 121 章 varnish - a state-of-the-art, high-performance HTTP accelerator

目錄

121.1. Varnish Install
121.2. varnish utility
121.2.1. status
121.2.2. varnishadm
121.2.2.1. 清除緩存
121.2.3. varnishtop
121.2.4. varnishhist
121.2.5. varnishsizes
121.3. log file
121.4. Varnish Configuration Language - VCL
121.4.1. unset / set
121.5. example

121.1. Varnish Install

http://varnish.projects.linpro.no/

  1. install

    				
    $ sudo apt-get install varnish
    				
    				
  2. /etc/default/varnish

    		    	
    $ sudo vim /etc/default/varnish
    DAEMON_OPTS="-a :80 \
                 -T localhost:6082 \
                 -f /etc/varnish/default.vcl \
                 -s file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,1G"
    		    	
    		    	
  3. /etc/varnish/default.vcl

    			    
    $ sudo vim /etc/varnish/default.vcl
    
    backend default {
    	.host = "127.0.0.1";
    	.port = "8080";
    }
    			    
    			    
  4. reload

    				
    $ sudo /etc/init.d/varnish force-reload
     * Stopping HTTP accelerator				[ OK ]
     * Starting HTTP accelerator