CentOs 5下安装Varnish3.0

1.  varnish官网  https://www.varnish-cache.org/

2.  获得源码    wget  http://repo.varnish-cache.org/source/varnish-3.0.0-beta2.tar.gz

3. 

tar zxvf varnish-3.0.0-beta2.tar.gz
cd varnish-3.0.0-beta2
./configure --prefix=/usr/local/varnish
make && make install

会报  No package 'libpcre' found   错误,  执行   yum install pcre-devel  解决。


4. 修改 /usr/local/varnish/etc/varnish/default.vcl


 backend default {
     .host = "10.146.87.240"; //缓存没有找到,然后转向的服务器
     .port = "80";
 }

5. 启动

/usr/local/varnish/sbin/varnishd -f /usr/local/varnish/etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000

默认监听的是 80端口



你可能感兴趣的:(centos,服务器)