当前位置:首页 > 开发 > 操作系统 > 正文

搭建 CentOS 6 服务器(14) - squid、Varnish

发表于: 2015-04-13   作者:rensanning   来源:转载   浏览:
摘要: (一)squid 安装 # yum install httpd-tools -y # htpasswd -c -b /etc/squid/passwords squiduser 123456 # yum install squid -y 设置 # cp /etc/squid/squid.conf /etc/squid/squid.conf.bak # vi /etc/
(一)squid

安装
# yum install httpd-tools -y
# htpasswd -c -b /etc/squid/passwords squiduser 123456
# yum install squid -y


设置
# cp /etc/squid/squid.conf /etc/squid/squid.conf.bak
# vi /etc/squid/squid.conf
    auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/passwords
    auth_param basic realm proxy
    acl authenticated proxy_auth REQUIRED
    http_access allow authenticated
    forwarded_for delete
    http_port 0.0.0.0:3128


启动服务
# /etc/init.d/squid start


(二)Varnish

安装
# rpm --nosignature -i https://repo.varnish-cache.org/redhat/varnish-4.0.el6.rpm
# yum install -y varnish
# varnishd -V


设置
# vi /etc/sysconfig/varnish
    VARNISH_LISTEN_PORT=6081
# vi /etc/varnish/default.vcl
    backend default {
        .host = "127.0.0.1";
        .port = "81";
    }
# varnishd -C -f /etc/varnish/default.vcl


启动服务
# service varnish start
# service varnishncsa start
# service varnishlog start


确认
# varnishadm backend.list

搭建 CentOS 6 服务器(14) - squid、Varnish

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号