Linux技术区

Linux服务篇之 Varnish第一篇

2017-09-08  本文已影响252人  数据革命

Linux服务篇之 Varnish第一篇

简介

Varnish安装与测试

[root@vsrnish ~]# yum  repolist
Loaded plugins: fastestmirror
Repository 'base' is missing name in configuration, using id
Repository 'epel' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
repo id                                                                                      repo name                                                                                 status
base                                                                                         base                                                                                       9,363
epel                                                                                         epel                                                                                      11,349
repolist: 20,712
[root@vsrnish ~]# hostnamectl set-hostname  varnish
[root@vsrnish ~]# yum install ntpdate   -y
[root@vsrnish ~]# ntpdate 172.16.0.1
 8 Sep 16:41:22 ntpdate[3455]: step time server 172.16.0.1 offset -28747.398358 sec
[root@vsrnish ~]# yum install varnish -y
[root@httpd ~]# yum install httpd  php -y
[root@httpd ~]# vim /var/www/html/test.html
<h1> Test Page @BE httpd </h1>
[root@httpd ~]# vim /var/www/html/info.php
<?php
        phpinfo();
?>
[root@httpd ~]# systemctl start httpd.service
[root@httpd ~]# ss -nutl
Netid State      Recv-Q Send-Q                                               Local Address:Port                                                              Peer Address:Port              
udp   UNCONN     0      0                                                                *:29475                                                                        *:*                  
udp   UNCONN     0      0                                                        127.0.0.1:323                                                                          *:*                  
udp   UNCONN     0      0                                                                *:68                                                                           *:*                  
udp   UNCONN     0      0                                                               :::65264                                                                       :::*                  
udp   UNCONN     0      0                                                              ::1:323                                                                         :::*                  
tcp   LISTEN     0      128                                                              *:22                                                                           *:*                  
tcp   LISTEN     0      100                                                      127.0.0.1:25                                                                           *:*                  
tcp   LISTEN     0      128                                                             :::80                                                                          :::*                  
tcp   LISTEN     0      128                                                             :::22                                                                          :::*                  
tcp   LISTEN     0      100                                                            ::1:25                                                                          :::*      
[root@httpd ~]# ip a
http://172.16.251.146/test.html
http://172.16.251.146/info.php
vim  /etc/varnish/default.vcl
backend default {
    .host = "172.16.251.146";
    .port = "80";
}
[root@vsrnish ~]# systemctl start  varnish.service
[root@vsrnish ~]# ss -nutl
Netid State      Recv-Q Send-Q                                               Local Address:Port                                                              Peer Address:Port              
udp   UNCONN     0      0                                                                *:68                                                                           *:*                  
udp   UNCONN     0      0                                                                *:48242                                                                        *:*                  
udp   UNCONN     0      0                                                               :::13191                                                                       :::*                  
tcp   LISTEN     0      128                                                              *:80                                                                           *:*                  
tcp   LISTEN     0      128                                                              *:22                                                                           *:*                  
tcp   LISTEN     0      100                                                      127.0.0.1:25                                                                           *:*                  
tcp   LISTEN     0      10                                                       127.0.0.1:6082                                                                         *:*                  
tcp   LISTEN     0      128                                                             :::80                                                                          :::*                  
tcp   LISTEN     0      128                                                             :::22                                                                          :::*                  
tcp   LISTEN     0      100                                                            ::1:25                                                                          :::*      
http://172.16.251.136/test.html
http://172.16.251.136/info.php
上一篇 下一篇

猜你喜欢

热点阅读