在Ubuntu 16.04.1 LTS上安装ATS 6.2.1 LTS实录

来源:互联网 发布:mysql触发器更新时间 编辑:程序博客网 时间:2024/05/21 19:26

这篇文档基本上与前一篇CentOS 6.8上面的相同,因为我所有的开发环境都是在Ubuntu上面的

http://blog.csdn.net/tao_627/article/details/56842905

下面我只是简单记录步骤和截图。

1.安装依赖包

由于官网文档没有Ubuntu 16.x的安装指导,下面是我的摸索,总体上ATS 4.x, 5.x版本区别不太大

sudo apt-get install autoconf automake libtool g++ make pkg-config libssl-dev tcl-dev libexpat1-dev libpcre3-dev libmodule-install-perl
sudo apt-get install libcap-dev libcap2 hwloc libhwloc-dev libhwloc5 libunwind8 libunwind8-dev
sudo apt-get install bison flex tcl8.6-dev zlib1g-dev
sudo apt-get install libluajit-5.1-dev libncurses5-dev libcurl4-openssl-dev
2.编译安装

这回安装的顶层目录是/opt/ats2, ATS运行的用户和组都是nogroup,同样设置debug模式

./configure --prefix=/opt/ats2 --with-user=nogroup --with-group=nogroup --enable-debug --enable-example-plugins --enable-experimental-plugins
make -j 4
sudo make install -j 4
安装完成后,会在/opt/ats2/bin下面看到生成了traffic_top

注意,按照官网上的文档,如果要生成traffic_top需要安装下面的两个库,上面已经经过测试验证
sudo apt-get installlibncurses5-dev libcurl4-openssl-dev
3.配置

[records.config]CONFIG proxy.config.http.server_ports STRING 18980CONFIG proxy.config.http2.enabled INT 0CONFIG proxy.config.http.insert_response_via_str INT 2CONFIG proxy.config.log.custom_logs_enabled INT 1CONFIG proxy.config.log.xml_config_file STRING logs_xml.configCONFIG proxy.config.diags.show_location INT 1#no ssl and cpu affinityCONFIG proxy.config.ssl.number.threads INT 0CONFIG proxy.config.exec_thread.affinity INT 0  [remap.config]regex_map http://(.*) http://$1[logs_xml.config]<LogFormat>  <Name = "ats_access_log"/>  <Format = "%<cqtd>/%<cqtt> %<cqhm> \"%<cquuc>\" %<pssc> %<ttms> %<cqhl> %<psql> %<crc> \"%<chi>\" %<pqsn> \"%<{Referer}cqh>\" \"%<psct>\" \"%<{User-agent}cqh>\" %<csssc> %<pqsi>"/></LogFormat><LogObject>  <Format = "ats_access_log"/>  <Filename = "access"/>  <Protocols = "http"/>  <RollingEnabled = "3"/>  <RollingIntervalSec = "7200"/>  <RollingSizeMb = "2048"/></LogObject>[storage.config]var/trafficserver 10G

4.运行并验证

cd /opt/ats2/bin
./trafficserver start
ps auxf | grep traffic


请求一个普通url来检查ats是否允许正常
curl -vx 127.0.0.1:18980 -o /dev/null 'http://news.sohu.com/'


执行traffic_top查看允许情况
./traffic_top


使用traffic_line来查看对应的配置变量
./traffic_line -r proxy.config.diags.show_location



0 0