首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >HTTP加速器varnish安装小记(1)

HTTP加速器varnish安装小记(1)

作者头像
张戈
发布2018-03-26 11:39:37
1.9K0
发布2018-03-26 11:39:37
举报
文章被收录于专栏:张戈的专栏张戈的专栏

上午共享的那个varnish 安装手册,个人看了下,有点不知所云,好吧~看来还是先安装玩玩!

苦逼公司服务器没法连外网,不能用什么 wget 或 yum 命令直接下载安装,每每看到别人博客贴出的在线安装代码时,总有一股羡慕嫉妒“恨”冒了出来。。。好吧,既然没法上外网,那只能麻烦点通过下载源码来编译安装了!

Varnish 3.0.4 下载地址: http://repo.varnish-cache.org/source/varnish-3.0.4.tar.gz

开始安装:

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

发现到第三步时,报如下错误:

checking for PCRE... no   
  
configure: error: Package requirements (libpcre) were not met:   
  
No package 'libpcre' found   
  
Consider adjusting the PKG_CONFIG_PATH environment variable if you   
installed software in a non-standard prefix.   
Alternatively, you may set the environment variables PCRE_CFLAGS   
and PCRE_LIBS to avoid the need to call pkg-config.   
See the pkg-config man page for more details.

经验告诉我,看到 pcre 字眼,就立即想到了是不是要安装支持正则表达式的 pcre 8??于是又找到 pcre8 开始安装:

unzip pcre-8.30.zip   
cd pcre-8.30     
./configure && make && make install

完了之后,继续安装 varnish,依然报同样的错!在参数中加入--with-pcre-config=/path/ 重试,依然。。。

看来不是 pcre 8 的问题了,在百思不得其解时,我打开了 RedHat 的软件包,搜了一下 pcre 关键字,结果发现还有个名为 pcre-devel-6.6-2.el5_1.7.x86_64.rpm 的软件包,好吧,就尝试安装一下看看:

[root@TEST-HOST ~]# rpm -ivh pcre-devel-6.6-2.el5_1.7.x86_64.rpm    
warning: pcre-devel-6.6-2.el5_1.7.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186  
Preparing...                ########################################### [100%]   
   1:pcre-devel             ########################################### [100%]

安装完成后,继续编译 varnish,发现没报错了!我勒个去,还真是少了这个软件包的支持,编译的安装方式就是麻烦,要是 rpm 包的话,直接就会报缺少依赖包的错误了,也不会走那么多弯路!不过也好,至少又涨了一点经验值。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2014年03月13日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档