Varnish安装

Varnish安装记录

 

1. 执行以下脚本


#!/bin/bash

yum install -y gcc gcc-c++ make wget automake autoconf libtool ncurses-devel libxslt groff pcre-devel pkgconfig  libedit libedit-devel


wget https://repo.varnish-cache.org/source/varnish-3.0.6.tar.gz
tar zxvf varnish-3.0.6.tar.gz
cd varnish-3.0.6
./configure --prefix=/usr/local/varnish
make && make install

groupadd varnish
useradd -d /var/lib/varnish -g varnish -s /sbin/nologin varnish

mkdir /etc/varnish/

cp redhat/varnish.initrc /etc/init.d/varnish
cp redhat/varnish.sysconfig /etc/sysconfig/varnish
cp redhat/varnish_reload_vcl /usr/local/varnish/varnish_reload_vcl

ln -s /usr/local/varnish/etc/varnish/default.vcl /etc/varnish/default.vcl
ln -s /usr/local/varnish/sbin/varnishd /usr/sbin/varnishd
ln -s /usr/local/varnish/varnish_reload_vcl /usr/bin/varnish_reload_vcl
ln -s /usr/local/varnish/bin/varnishadm /usr/bin/varnishadm

chmod +x /etc/init.d/varnish

uuidgen> /etc/varnish/secret

chmod 0600 /etc/varnish/secret


2. 修改/etc/varnish/default.conf

3. 启动Varnish