• Centos 7 上 源码安装和配置 ATS 9.1.2


    1、安装依赖包:

    yum -y install Git gcc gcc-c++ autoconf automake libtool pkgconfig pcre-devel tcl-devel expat-devel openssl-devel xz-devel boost-devel curl curl-devel ncurses  ncurses-devel
    yum -y install perl-ExtUtils-MakeMaker
    yum -y install libcap libcap-devel hwloc hwloc-devel
    yum -y install libunwind libunwind-devel

    2、下载源码软件包并安装

    #定义ATS的运行目录
    mkdir /usr/local/ats
    
    #使用ats 用户运行ATS,方便后期管理,用户家目录也指定到 ATS运行目录下
    id ats &>/dev/null || /usr/sbin/useradd -u 176 -r ats -s /sbin/nologin -d /usr/local/ats/
    
    #下载源码包
    wget https://dlcdn.apache.org/trafficserver/trafficserver-9.1.2.tar.bz2
    
    #编译安装(使用debug模式运行,便于发现和调试问题。开启debug模式)
    yum -y install bzip2   #解压时需要用到
    tar jxvf trafficserver-9.1.2.tar.bz2
    cd trafficserver-9.1.2
    #在使用 ./configure 处理时会报错,需要C++17的支持
    yum install centos-release-scl
    yum-config-manager --enable rhel-server-rhscl-7-rpms
    yum install devtoolset-7
    scl enable devtoolset-7 bash  #切换C++版本后运行 ./configure
    ./configure --prefix=/usr/local/ats --with-user=ats --with-group=ats --enable-debug --enable-example-plugins --enable-experimental-plugins   
    make
    make install

    3、配置:具体配置请查看官网说明:

    https://docs.trafficserver.apache.org/en/9.1.x/getting-started/index.en.html#configuration

     根据官网总结一下基础配置: 配置文件都在:/usr/local/ats/etc/trafficserver 下

      I、启用反向代理

        # vim records.config 

    CONFIG proxy.config.http.cache.http INT 1               #启用代理HTTP请求的缓存
    CONFIG proxy.config.reverse_proxy.enabled INT 1   #启用反向代理的支持
    CONFIG proxy.config.url_remap.remap_required INT 1    
    CONFIG proxy.config.url_remap.pristine_host_hdr INT 1    #保持客户端请求的完整头部信息。
    CONFIG proxy.config.http.server_ports STRING 8080 8080:ipv6     #根据业务情况设置代理端口   

      II、配置映射  # https://docs.trafficserver.apache.org/en/9.1.x/admin-guide/files/remap.config.en.html#std-configfile-remap.config

        # vim remap.config

    map http://www.acme.com/ http://localhost:8080/
    map https://static.acme.com/ https://origin-static.acme.com/
    使用regex_前缀表示该行具有正则表达式 (regex)。 regex_map http:///^www(0[0-0][0-5]).acme.com/ http://localhost:8080/

      III、如果代理https ,还需要配置证书

        # vim ssl_multicert.config

    dest_ip=* ssl_cert_name=/path/to/secret/privatekey/acme.rsa

      IV、调整缓存参数

        # vim storage.config

          /cache/trafficserver 500G     #缓存目录自定义,可以使用新硬盘

      V、缓存存储、清理缓存

        # https://docs.trafficserver.apache.org/en/9.1.x/admin-guide/storage/index.en.html

      VI、日志配置

        # https://docs.trafficserver.apache.org/en/9.1.x/admin-guide/logging/understanding.en.html

    4、启动服务

    cd /usr/local/ats/bin/
    ./trafficserver start

    5、验证

    # ./traffic_top      #查看ATS 运行状况

  • 相关阅读:
    字符编码 进制转换
    Android工具HierarchyViewer 代码导读(1) 功能实现演示
    jQuery中的bind(), live(), on(), delegate()
    [转]ActionScript3.0中XML处理方法
    Pane和Panel的区别
    [转]在命令行中编译运行Java Applet
    [转]关于五险一金,你知道多少?
    [转]ActionScript3.0对象深复制
    [转]用Flashbug调试Flash
    [转]用EditPlus搭建简易的Java开发环境
  • 原文地址:https://www.cnblogs.com/weijie0717/p/16203836.html
Copyright © 2020-2023  润新知