Rootop 服务器运维与web架构

redhat5下编译安装varnish3.0.3

| 暂无评论

我这也刚入门,从最基本的开始,具体更详细的配置参数可参考网上的其它资料。
在此,最新版的为varnish3.0.5,但是在编译的时候各种错,3.0.4也是一样,也没找到解决办法,降级为3.0.3测试。
系统版本:redhat5.5×64
ip:192.168.1.179

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

官网文档:https://www.varnish-cache.org/docs/3.0/installation/install.html#build-dependencies-on-red-hat-centos

安装编译环境:

[root@rhel varnish-3.0.3]# yum install -y gcc gcc-c++ pcre pcre-devel
[root@rhel varnish-3.0.3]# ./configure --prefix=/usr/local/varnish
[root@rhel varnish-3.0.3]#make
[root@rhel varnish-3.0.3]#make install

编辑配置文件:
[root@rhel varnish-3.0.3]# vi /usr/local/varnish/etc/varnish/default.vcl
 
 取消前面注释,并修改为实际服务器ip(web端口8080)。这里以web服务器和varnish在同一台机器为例。
 
 backend default {
     .host = “192.168.1.179”;
     .port = “8080”;
 }

 保存退出
 
 启动varnish
 [root@rhel varnish-3.0.3]# /usr/local/varnish/sbin/varnishd -a 192.168.1.179:80 -f /usr/local/varnish/etc/varnish/default.vcl
 -a 指定监听地址和端口  不要用127.0.0.1
 -f 指定配置文件
 更多的参数可以通过/usr/local/varnish/sbin/varnishd 查看

原创文章,转载请注明。本文链接地址: https://www.rootop.org/pages/1957.html

作者:Venus

服务器运维与性能优化

发表回复