链接:https://pan.baidu.com/s/1HfbxzSQpYCyuwL2audiU6A
提取码:znwj
软件连接
成都创新互联公司专注于叶县网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供叶县营销型网站建设,叶县网站制作、叶县网页设计、叶县网站官网定制、小程序设计服务,打造叶县网络公司原创品牌,更为您提供叶县网站排名全网营销落地服务。
首先准备环境:
上传软解包和依赖包:
libedit-devel-3.0-12.20121213cvs.el7.x86_64.rpm
python-docutils-0.11-0.2.20130715svn7687.el7.noarch.rpm
varnish-5.2.1.tgz
Varnish服务器ip 192.168.80.102
web服务器 ip 192.168.80.103
安装服务:
systemctl stop firewalld
setenforce 0
mount /dev/cdrom /mnt
yum install lrz* -y //安装下载工具
(安装上一个软件可以从真机中拖入安装包)
yum install -y gcc gcc-c++ make //安装编译器和环境安装依赖关系包和所需要的插件:
yum install -y \
libtool \
ncourses-devel \
pcre-devel \
libedit-devel \
libxslt \
groff \
pkgconfig \
ncurses-devel \
python-*
.
rpm -ivh libedit-devel-3.0-12.20121213cvs.el7.x86_64.rpm
rpm -ivh python-docutils-0.11-0.2.20130715svn7687.el7.noarch.rpmtar xf varnish-5.2.1.tgz -C /opt
cd /opt/varnish-5.2.1/ //进入解压后的文件夹中定义需要的模块sh autogen.sh //检查系统环境
./configure \
--prefix=/usr/local/varnish \
--enable-debugging-symbols \
--enable-developer-warnings
.
make && make install
cd /usr/local/varnish/
ln -s /usr/local/varnish/sbin/varnishd /usr/sbin/
ln -s /usr/local/varnish/bin/* /usr/local/bin/cp /usr/local/varnish/share/doc/varnish/example.vcl /usr/local/varnish/default.vcl
//配置文件模板拷贝出来用修改配置文件
vi default.vcl.host = "192.168.80.103"; .port = "80";
grep -v "#" default.vcl |grep -v "^$" //过滤空白行和注释
.
启动服务:
varnishd -f /usr/local/varnish/default.vcl -a 0.0.0.0:80
//#指定监听的ip和端口启动varnishnetstat -anpt | grep varnishd
到此,Varnish服务器基本配置完成
systemctl stop firewalld
setenforce 0
yum install -y httpdvi /etc/httpd/conf/httpd.conf
#去掉注释符号
systemctl start httpd //启动服务cd /var/www/html/
Server 0
测试,在windows浏览器中输入http://192.168.80.102(varnish服务器的ip地址)