1、解决依赖

yum -y install autoconf automake jemalloc-devel libedit-devel libtool ncurses-devel pcre-devel pkgconfig python-docutils python-sphinx

2、下载源码包

wget https://repo.varnish-cache.org/source/varnish-5.1.2.tar.gz

3、解压文件

tar zxvf varnish-5.1.2.tar.gz

4、配置、编译

./autogen.sh
./configure
make && make install

5、启动服务

varnishd -a :6081 -T localhost:6082 -b localhost:8080
%23%23%23%201%E3%80%81%E8%A7%A3%E5%86%B3%E4%BE%9D%E8%B5%96%0A%60%60%60%0Ayum%20-y%20install%20autoconf%20automake%20jemalloc-devel%20libedit-devel%20libtool%20ncurses-devel%20pcre-devel%20pkgconfig%20python-docutils%20python-sphinx%0A%60%60%60%0A%0A%23%23%23%202%E3%80%81%E4%B8%8B%E8%BD%BD%E6%BA%90%E7%A0%81%E5%8C%85%0A%60%60%60%0Awget%20https%3A%2F%2Frepo.varnish-cache.org%2Fsource%2Fvarnish-5.1.2.tar.gz%0A%60%60%60%0A%0A%23%23%23%203%E3%80%81%E8%A7%A3%E5%8E%8B%E6%96%87%E4%BB%B6%0A%0A%60%60%60%0Atar%20zxvf%20varnish-5.1.2.tar.gz%0A%60%60%60%0A%0A%23%23%23%204%E3%80%81%E9%85%8D%E7%BD%AE%E3%80%81%E7%BC%96%E8%AF%91%0A%60%60%60%0A.%2Fautogen.sh%0A.%2Fconfigure%0Amake%20%26%26%20make%20install%0A%60%60%60%0A%0A%23%23%23%205%E3%80%81%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1%0A%60%60%60%0Avarnishd%20-a%20%3A6081%20-T%20localhost%3A6082%20-b%20localhost%3A8080%0A%60%60%60