系统版本:CentOS 6.7
1.安装依赖包
yum -y install git gcc gcc-c++ autoconf automake libtool pkgconfig pcre-devel tcl-devel expat-devel openssl-devel xz-devel boost-devel
yum -y install perl-ExtUtils-MakeMaker
yum -y install libcap libcap-devel hwloc hwloc-devel
yum -y install libunwind libunwind-devel
更新yum源安装
yum install -y epel-release
yum -y install curl curl-devel
yum -y install ncurses ncurses-devel
2.下载源码包并安装
wget http://archive.apache.org/dist/trafficserver/trafficserver-6.2.0.tar.bz2
tar -jxvf trafficserver-6.2.0.tar.bz2
cd trafficserver-6.2.0
./configure –prefix=/usr/local/ats –enable-example-plugins –enable-experimental-plugins
autoreconf -i
make -j 4
make install
3.下面是相应配置
[records.config]
CONFIG proxy.config.http.server_ports STRING 8080
CONFIG proxy.config.http2.enabled INT 0
CONFIG proxy.config.http.insert_response_via_str INT 2
CONFIG proxy.config.log.custom_logs_enabled INT 1
CONFIG proxy.config.log.xml_config_file STRING logs_xml.config
CONFIG proxy.config.diags.show_location INT 1
CONFIG proxy.config.http.parent_proxy_routing_enable INT 1
CONFIG proxy.config.http.no_dns_just_forward_to_parent INT 1
CONFIG proxy.config.body_factory.template_sets_dir STRING etc/trafficserver/body_factory
CONFIG proxy.config.cache.control.filename STRING cache.config
#no ssl and cpu affinity
CONFIG proxy.config.ssl.number.threads INT 0
CONFIG proxy.config.exec_thread.affinity INT 0
[remap.config]
regex_map http://(.*) http://$1
[logs_xml.config]
% % %<{X-Forwarded-For}cqh> %
/% % % % % %/%
i> % \”%<{Referer}cqh>\” \”%<{User-Agent}cqh>\” %
> %”/>
[storage.config]
var/trafficserver 4G
[root@node-5-153 trafficserver]# /usr/local/ats/bin/trafficserver restart
[root@node-5-153 trafficserver]# tail -f /usr/local/ats/var/log/trafficserver/access.log
10.0.5.153 1543982432.135 0 10.0.5.152 TCP_MEM_HIT/200 13 GET http://www.safeidc.cn/ HTTP/1.0 NONE/0 text/html “-” “Wget/1.12 (linux-gnu)” www.safeidc.cn 0