实验环境:

slave-147:   192.168.75.147

slave-148:    192.168.75.148

两台机器均已关闭selinux,关闭iptables。

varnish部署在slave-147上,开始准备软件包:

下载安装epel-release

http://mirrors.ustc.edu.cn/epel/6Server/x86_64/epel-release-6-8.noarch.rpm

安装varnish的依赖jemalloc

yum install –y jemalloc jemallo-devel

安装varnish依赖

yum install pygpgme yum-utils

创建varnish.repo文件,参考网址:https://packagecloud.io/varnishcache/varnish40

https://packagecloud.io/varnishcache/varnish60/install#manual-rpm

[varnishcache_varnish40]

name=varnishcache_varnish40

baseurl=https://packagecloud.io/varnishcache/varnish40/el/6/$basearch

repo_gpgcheck=1

gpgcheck=0

enabled=1

gpgkey=https://packagecloud.io/varnishcache/varnish40/gpgkey

sslverify=1

sslcacert=/etc/pki/tls/certs/ca-bundle.crt

metadata_expire=300

[varnishcache_varnish40-source]

name=varnishcache_varnish40-source

baseurl=https://packagecloud.io/varnishcache/varnish40/el/6/SRPMS

repo_gpgcheck=1

gpgcheck=0

enabled=1

gpgkey=https://packagecloud.io/varnishcache/varnish40/gpgkey

sslverify=1

sslcacert=/etc/pki/tls/certs/ca-bundle.crt

metadata_expire=300

然后使用

yum -q makecache -y --disablerepo='*' --enablerepo='varnishcache_varnish40'

最后使用yum install –y varnish安装即可。

在slave-148上安装httpd或者nginx,创建测试页面。

[root@slave-148 ~]# echo "Web 148 ###########################192.168.75.148" > /var/www/html/index.html

[root@slave-148 ~]# curl slave-148

Web 148 ###########################192.168.75.148

这里使用slave-147作为客户端进行访问访问测试

[root@slave-147 ~]# curl -i 192.168.75.148

HTTP/1.1 200 OK

Date: Tue, 27 Mar 2018 12:02:15 GMT

Server: Apache/2.2.15 (Red Hat)

Last-Modified: Tue, 27 Mar 2018 11:34:31 GMT

ETag: "c3860-32-568634629d76a"

Accept-Ranges: bytes

Content-Length: 50                              #因为这里是测试环境,是第二次测试,理论上应该跟下面的值不一样的

Connection: close

Content-Type: text/html; charset=UTF-8

Web 148 ###########################192.168.75.148

[root@slave-147 ~]# curl -i 192.168.75.147

HTTP/1.1 200 OK

Date: Tue, 27 Mar 2018 12:02:30 GMT

Server: Apache/2.2.15 (Red Hat)

Last-Modified: Tue, 27 Mar 2018 11:34:31 GMT

ETag: "c3860-32-568634629d76a"

Content-Length: 50

Content-Type: text/html; charset=UTF-8

X-Varnish: 2

Age: 0

Via: 1.1 varnish-v4

X-Cache: MISS from xueji cache

Connection: keep-alive

Accept-Ranges: bytes

Web 148 ###########################192.168.75.148

这里仅作为实验练习笔记,多有失误请多包涵。

Varnish快速安装及测试的更多相关文章

  1. 谷歌Cartographer学习(1)-快速安装测试(转载)

    转载自谷歌Cartographer学习(1)-快速安装测试 代码放到个人github上,https://github.com/hitcm/ 如下,需要安装3个软件包,ceres solver.cart ...

  2. 转载 - Vultr VPS注册开通且一键快速安装PPTP VPN和电脑连接使用

    本文转载来自:https://www.vultrclub.com/139.html 从2014年Vultr VPS进入市场之后,作为有背景.实力的搅局者,是的最近两年VPS.服务器的用户成本降低.配置 ...

  3. 决战大数据之三-Apache ZooKeeper Standalone及复制模式安装及测试

    决战大数据之三-Apache ZooKeeper Standalone及复制模式安装及测试 [TOC] Apache ZooKeeper 单机模式安装 创建hadoop用户&赋予sudo权限, ...

  4. CentOS 6.4 快速安装Nginx笔记

    CentOS 6.4 快速安装Nginx笔记 本系列文章由ex_net(张建波)编写,转载请注明出处. http://blog.csdn.net/ex_net/article/details/9860 ...

  5. CentOS 5.5 快速安装MariaDB-5.5.35

    被网上各种教程坑的不轻T,T,5.5下不升级yum的情况下想快速安装还真有点费劲 至于源码编译安装坑貌似更多 而且在小内存的VPS上编译实在费力 下载地址 http://yum.mariadb.org ...

  6. centos coreseek 快速安装

    CoreSeek快速安装: 安装前,建议查看:源码包说明README:4.0/4.1版可参考3.2版本安装,步骤相同:如遇到问题,请看详细安装说明. ##下载coreseek:coreseek 3.2 ...

  7. 在Python3.5下安装和测试Scrapy爬网站

    1. 引言 Scrapy框架结构清晰,基于twisted的异步架构可以充分利用计算机资源,是爬虫做大的必备基础.本文将讲解如何快速安装此框架并使用起来. 2. 安装Twisted 2.1 同安装Lxm ...

  8. mosquitto在Linux环境下的部署/安装/使用/测试

    mosquitto在Linux环境下的部署 看了有三四天的的源码,(当然没怎么好好看了),突然发现对mosquitto的源码有了一点点感觉,于是在第五天决定在Linux环境下部署mosquitto. ...

  9. percona-xtrabackup快速安装及其简单使用

    percona-xtrabackup快速安装及其简单使用 cd /opt/环境:centos6.x yum -y install perl-DBIyum -y install perl-DBD-MyS ...

随机推荐

  1. 0 lrwxrwxrwx. 1 root root 13 Nov 20 12:44 scala -> scala-2.12.4

    符号链接的文件属性相同,真正的权限属性由符号链接所指向的实际文件决定.

  2. Ruby map、each、select、inject、collect 、detect reference

    参考 https://ruby-china.org/topics/26718 map:(collect是map的别名函数) 对数组中每个元素进行表达式操作,原始数组不会被改变,返回执行表达式结果的新数 ...

  3. fork函数的使用【学习笔记】

    #include "apue.h" ; char buf[] = "a write to stdout\r\n"; int main(void) { int v ...

  4. asp.net下的cookieName

    https://stackoverflow.com/questions/1017144/rename-asp-net-sessionid Add to your web.config:- <sy ...

  5. android之View坐标系(view获取自身坐标的方法和点击事件中坐标的获取)

    在做一个view背景特效的时候被坐标的各个获取方法搞晕了,几篇抄来抄去的博客也没弄很清楚. 现在把整个总结一下. 其实只要把下面这张图看明白就没问题了. 涉及到的方法一共有下面几个: view获取自身 ...

  6. Oracle:impdb导入

    最近有现场给我一份用expdp导出dmp文件,我用imp导入时,报错.因为导出dmp的数据库是11g,导入的数据库也是11g, 但客户端安装的是10g,不能用imp导入:所以只能试着用impdp导入: ...

  7. SPOJ:Ada and Orange Tree (LCA+Bitset)

    Ada the Ladybug lives near an orange tree. Instead of reading books, she investigates the oranges. T ...

  8. struts2添加需要的jar包

    转自:https://blog.csdn.net/fance611261/article/details/6790737 以前总是在myeclipse中添加jar包的,由于现在转向了eclipse,原 ...

  9. B. Color the Fence

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  10. Linux系统安装完的调整和安全

    精简开机系统自启动 •五个企业环境中开机自启动的服务; sshd:远程连接linux服务器必须开启 rsyslog:日志相关软件 network:网络服务 crond:系统和用户配置的计划任务周期性进 ...