Home | 简体中文 | 繁体中文 | 杂文 | 打赏(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎专栏 | Search | About

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

目录

53.1. Varnish Install
53.2. varnish utility
53.2.1. status
53.2.2. varnishadm
53.2.2.1. 清除缓存
53.2.3. varnishtop
53.2.4. varnishhist
53.2.5. varnishsizes
53.3. log file
53.4. Varnish Configuration Language - VCL
53.4.1. unset / set
53.5. example

53.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