---
title: "Varnish安装"
author: "boyssheng"
date: "2012-05-10T13:43:43Z"
tags: []
categories: ["互联网"]
slug: "varnish"
draft: false
lastmod: "2012-05-10T13:43:43Z"
id: 1521330
url: "https://boyssheng.iteye.com/blog/1521330"
---

```java
Varnish安装

一、安装Varnish
操作系统：linux RedHad5
1、获取Varnish软件
	Varnish的官方站点为http://varnish-cache.org， 这里面有varnish的最新说明文档，以及版本升级记录，目前，varnish的 最新版本是Varnish 3.0.1，下载完成后的包名为varnish-3.0.1.tar.gz，此处我们就以此版本为例，进行安装配置。
2、获取并安装pcre
	主页地址：http://www.pcre.org/
	下载pcre-8.20.tar.bz2
	解压缩： tar xjpf pcre-7.8.tar.bz2
	配置：./configure --prefix=/usr/local/pcre/
	编译： make
	安装： make install
3、安装Varnish
tar -zxvf varnish-3.0.1.tar.gz
cd varnish-3.0.1
export PKG_CONFIG_PATH=/usr/local/pcre/lib/pkgconfig 
./configure --prefix=/usr/local/varnish
make
make install
其中，“PKG_CONFIG_PATH”是指定varnish查找pcre库的路径，如果pcre安装在了其它路径下，在这里指定相应的路径即 可，Varnish默认查找的pcre库路径为/usr/local/lib/ pkgconfig


```