VPS参考测评推荐
专注分享VPS主机优惠信息
衡天云优惠活动
华纳云优惠活动
荫云优惠活动

安装varnish服务器的简单教程

主机参考:VPS测评参考推荐/专注分享VPS服务器优惠信息!若您是商家可以在本站进行投稿,查看详情!此外我们还提供软文收录、PayPal代付、广告赞助等服务,查看详情!
我们发布的部分优惠活动文章可能存在时效性,购买时建议在本站搜索商家名称可查看相关文章充分了解该商家!若非中文页面可使用Edge浏览器同步翻译!PayPal代付/收录合作

Varnish一款性能开源反向代理服务器http加速器。与传统的Squid相比,Varnish具有性能更高、速度更快、管理方便等诸多优点。但具体怎么安装呢?下面由小编给你们介绍安装varnish服务器的简单教程

第一步 安装3台nginx服务器

地址为192.168.1.35,192.168.1.36,192.168.1.37

安装varnish的服务器IP为192.168.1.33

第二步获取安装varnish所需要的包

编译 安装varnish6.0需要pcre库,pcre库为了兼容正则表达式

下载地址http://down.51cto.com/data/2315007

#tar xvf pcre-8.39.tar.gz

#cd pcre-8.39

# ./configure --prefix=/usr/local/pcre

#make make install

第三步 安装varnish

下载地址http://down.51cto.com/data/456650

# tar xvf varnish-2.1.2.tar.gz

# cd varnish-2.1.2

这一步是指定varnish查找pcre库的位置,根据你安装的位置自行决定

# export PKG_CONFIG_PATH=/usr/local/pcre/lib/pkgconfig

# ./configure --prefix=/usr/local/varnish --enable-dependency-tracking --enable-debugging-symbols --enable-developer-warnings

#make make install

#cp redhat/varnish.initrc /etc/init.d/varnish

# cp redhat/varnish.sysconfig /etc/sysconfig/varnish

第四步 修改配置文件

下载地址http://down.51cto.com/data/2315096

最简单的 vcl配置文件,下载后解压出来,放入配置文件夹,例如/usr/local/varnish/etc

根据自己服务器真实情况修改配置

第五步 启动varnished

/usr/local/varnish/sbin/varnishd -f /usr/local/varnish/etc/vcl.conf

第六步 测试是否缓存命中

访问http://192.168.1.33查看  请求响应头

是否包含

x-varnish: 1807036043 1807036035Age: 63Via: 1.1 varnishConnection: keep-aliveX-Cache: HIT from www.furyamber.com

如果已有,则已工作。

 

ps vcl.conf是最简单的配置,如果需要有新的功能需要自己研究

看完上文不知道你对安装varnish服务器教程了解多少?如果想了解更多,欢迎关注亿速云行业资讯频道


Varnish is a high performance and open source reverse proxy server and HTTP accelerator. Compared with the traditional squid, varnish has many advantages such as higher performance, faster speed and more convenient management. But how to install it? The following is a simple tutorial for you to install the varnish server.

Step 1: install 3 nginx servers

Address: 192.168.1.35192.168.1.36192.168.1.37

The server IP of varnish installation is 192.168.1.33

Step 2: get the package needed to install varnish

Compiling and installing varnish 6.0 requires the PCRE library, which is compatible with regular expressions

Download address: http://down.51cto.com/data/2315007

#tar xvf pcre-8.39.tar.gz

#cd pcre-8.39

# ./configure --prefix=/usr/local/pcre

#make make install

Step 3 install varnish

Download address: http://down.51cto.com/data/456650

# tar xvf varnish-2.1.2.tar.gz

# cd varnish-2.1.2

This step is to specify the location where varnish finds the PCRE library, which is determined by your installation location

# export PKG_CONFIG_PATH=/usr/local/pcre/lib/pkgconfig

# ./configure --prefix=/usr/local/varnish --enable-dependency-tracking --enable-debugging-symbols --enable-developer-warnings

#make make install

#cp redhat/varnish.initrc /etc/init.d/varnish

# cp redhat/varnish.sysconfig /etc/sysconfig/varnish

Step 4 modify the configuration file

Download address: http://down.51cto.com/data/2315096

The simplest VCL configuration file is extracted after downloading and put into the configuration folder, such as / usr / local / varnish / etc

Modify the configuration according to the actual situation of your server

Step 5 start varnished

/usr/local/varnish/sbin/varnishd -f /usr/local/varnish/etc/vcl.conf

Step 6 test cache hit

Visit http://192.168.1.33 to view the request response header

Does it contain

x-varnish: 1807036043 1807036035Age: 63Via: 1.1 varnishConnection: keep-aliveX-Cache: HIT from www.furyamber.com

If it already exists, it works.

 

PS vcl.conf is the simplest configuration. If you need to have new functions, you need to study it yourself

After reading the above, I don't know how much do you know about the tutorial of installing the varnish server? If you want to learn more, please pay attention to the billion speed cloud industry information channel

--------------------------------------------------------------
主机参考,收集国内VPSVPS测评主机测评云服务器虚拟主机独立服务器,国内外服务器高性价比建站主机相关优惠信息@zhujicankao.com
详细介绍和测评国外VPS主机,云服务器,国外服务器,国外主机的相关优惠信息,商家背景,网络带宽等等,也是目前国内最好的主机云服务器VPS参考测评资讯优惠信息分享平台

这几篇文章你可能也喜欢:

本文由主机参考刊发,转载请注明:安装varnish服务器的简单教程 https://zhujicankao.com/12635.html

【腾讯云】领8888元采购礼包,抢爆款云服务器 每月 9元起,个人开发者加享折上折!
打赏
转载请注明原文链接:主机参考 » 安装varnish服务器的简单教程
主机参考仅做资料收集,不对商家任何信息及交易做信用担保,购买前请注意风险,有交易纠纷请自行解决!请查阅:特别声明

相关推荐

评论 抢沙发

评论前必须登录!