Chinaunix首页 | 论坛 | 博客
  • 博客访问: 50686
  • 博文数量: 61
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 360
  • 用 户 组: 普通用户
  • 注册时间: 2015-01-05 15:04
文章分类
文章存档

2015年(61)

我的朋友

分类: LINUX

2015-01-23 09:45:37

在CentOS下安装Varnish Cache

RedHat/CentOS 系统环境下 varnish 的依赖关系

如果您是 RedHat/CentOS 系统想安装 varnish,您需要安装以下软件包:

automake

autoconf

libtool

ncurses-devel

libxslt

groff

pcre-devel

pkgconfig 

以下是在配置好 yum 包管理器的情况下运行

yum install -y automake autoconf libtool ncurses-devel libxslt groff pcre-devel pkgconfig

[root@node18 ~]# yum install -y automake autoconf libtool ncurses-devel libxslt groff pcre-devel pkgconfig

Loaded plugins: fastestmirror

Loading mirror speeds from d hostfile

 * base: mirrors.grandcloud.cn

 * extras: mirrors.grandcloud.cn

 * updates: mirrors.grandcloud.cn

Setting up Install Process

Package automake-1.9.6-2.3.el5.noarch already installed and latest version

Package autoconf-2.59-12.noarch already installed and latest version

Package libtool-1.5.22-7.el5_4.i386 already installed and latest version

Package ncurses-devel-5.5-24.20060715.i386 already installed and latest version

Package libxslt-1.1.17-4.el5_8.3.i386 already installed and latest version

Package groff-1.18.1.1-13.el5.i386 already installed and latest version

Package pcre-devel-6.6-6.el5_6.1.i386 already installed and latest version

Package 1:pkgconfig-0.21-2.el5.i386 already installed and latest version

Nothing to do

[root@node18 ~]# 

下载varnish源代码并编译安装

mkdir varnish_setup

cd varnish_setup/

wget

tar zxf varnish-2.1.5.tar.gz

cd varnish-2.1.5

./autogen.sh

./configure --prefix=/usr

make

cd bin/varnishtest && ./varnishtest tests/*.vtc   # <== 这一步执行测试,很费时,可省略

cd ../..     # <=== 如果执行了测试,否则执行安装

make install

注意:本文的安装与默认安装不同

varnishd将被安装到 /usr/sbin/varnishd

配置文件 /usr/etc/varnish/default.vcl

下面是安装的详细记录:

[root@node18 ~]# mkdir varnish_setup

[root@node18 ~]# cd varnish_setup/

[root@node18 varnish_setup]# wget

--2012-11-20 10:23:32--  

正在解析主机 repo.varnish-cache.org... 194.31.39.155

Connecting to repo.varnish-cache.org|194.31.39.155|:80... 已连接。

已发出 HTTP 请求,正在等待回应... 200 OK

长度:1530856 (1.5M) [application/x-gzip]

Saving to: `varnish-2.1.5.tar.gz'

100%[======================================>] 1,530,856   51.2K/s   in 20s     

2012-11-20 10:23:53 (73.2 KB/s) - `varnish-2.1.5.tar.gz' saved [1530856/1530856]

[root@node18 varnish_setup]# 

[root@node18 varnish_setup]# tar zxf varnish-2.1.5.tar.gz 

[root@node18 varnish_setup]# cd varnish-2.1.5

[root@node18 varnish-2.1.5]# ls

aclocal.m4  config.guess  depcomp  install-sh   Makefile.in  varnishapi.pc.in

autogen.sh  config.h.in   doc      lib          man

bin         config.sub    etc      LICENSE      missing

ChangeLog   configure     include  ltmain.sh    README

compile     configure.ac  INSTALL  Makefile.am  

[root@node18 varnish-2.1.5]# 

[root@node18 varnish-2.1.5]# ./autogen.sh 

+ aclocal

+ libtoolize --copy --force

+ autoheader

+ automake --add-missing --copy --foreign

+ autoconf

[root@node18 varnish-2.1.5]# ./configure --prefix=/usr

checking build system type... i686-redhat-linux-

checking host system type... i686-redhat-linux-gnu

checking target system type... i686-redhat-linux-gnu

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes

checking for gawk... gawk

checking whether make sets $(MAKE)... yes

checking for gcc... gcc

checking for C compiler default output file name... a.out

checking whether the C compiler works... yes

...

configure: creating ./config.status

config.status: creating Makefile

config.status: creating bin/Makefile

config.status: creating bin/varnishadm/Makefile

config.status: creating bin/varnishd/Makefile

config.status: creating bin/varnishlog/Makefile

config.status: creating bin/varnishhist/Makefile

config.status: creating bin/varnishncsa/Makefile

config.status: creating bin/varnishreplay/Makefile

config.status: creating bin/varnishstat/Makefile

config.status: creating bin/varnishsizes/Makefile

config.status: creating bin/varnishtest/Makefile

config.status: creating bin/varnishtop/Makefile

config.status: creating doc/Makefile

config.status: creating doc/sphinx/Makefile

config.status: creating etc/Makefile

config.status: creating include/Makefile

config.status: creating lib/Makefile

config.status: creating lib/libvarnish/Makefile

config.status: creating lib/libvarnishapi/Makefile

config.status: creating lib/libvarnishcompat/Makefile

config.status: creating lib/libvcl/Makefile

config.status: creating lib/libjemalloc/Makefile

config.status: creating man/Makefile

config.status: creating redhat/Makefile

config.status: creating varnishapi.pc

config.status: creating config.h

config.status: executing depfiles commands

[root@node18 varnish-2.1.5]# make

make  all-recursive

make[1]: Entering directory `/root/varnish_setup/varnish-2.1.5'

Making all in include

make[2]: Entering directory `/root/varnish_setup/varnish-2.1.5/include'

make[2]: Nothing to be done for `all'.

make[2]: Leaving directory `/root/varnish_setup/varnish-2.1.5/include'

Making all in lib

make[2]: Entering directory `/root/varnish_setup/varnish-2.1.5/lib'

Making all in libvarnishcompat

make[3]: Entering directory `/root/varnish_setup/varnish-2.1.5/lib/libvarnishcompat'

if /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include    -g -O2 -MT daemon.lo -MD -MP -MF ".deps/daemon.Tpo" -c -o daemon.lo daemon.c; \

        then mv -f ".deps/daemon.Tpo" ".deps/daemon.Plo"; ee rm -f ".deps/daemon.Tpo"; exit 1; fi

 .libs

 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include -g -O2 -MT daemon.lo -MD -MP -MF .deps/daemon.Tpo -c daemon.c  -fPIC -DPIC -o .libs/daemon.o

...

mkdir .libs

gcc -g -O2 -o .libs/varnishsizes varnishsizes.o  ../../lib/libvarnish/.libs/libvarnish.so -lrt -sl ../../lib/libvarnishcompat/.libs/libvarnishcompat.so ../../lib/libvarnishapi/.libs/libvarnishapi.so -lpcre -lm -lcurses -lpthread 

creating varnishsizes

make[3]: Leaving directory `/root/varnish_/varnish-2.1.5/bin/varnishsizes'

make[3]: Entering directory `/root/varnish_setup/varnish-2.1.5/bin'

make[3]: Nothing to be done for `all-am'.

make[3]: Leaving directory `/root/varnish_setup/varnish-2.1.5/bin'

make[2]: Leaving directory `/root/varnish_setup/varnish-2.1.5/bin'

Making all in man

make[2]: Entering directory `/root/varnish_setup/varnish-2.1.5/man'

make[2]: Nothing to be done for `all'.

make[2]: Leaving directory `/root/varnish_setup/varnish-2.1.5/man'

Making all in etc

make[2]: Entering directory `/root/varnish_setup/varnish-2.1.5/etc'

make[2]: Nothing to be done for `all'.

make[2]: Leaving directory `/root/varnish_setup/varnish-2.1.5/etc'

Making all in doc

make[2]: Entering directory `/root/varnish_setup/varnish-2.1.5/doc'

Making

  • 本文来自:
阅读(370) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~