ATS6.2安裝部署筆記
阿新 • • 發佈:2018-12-11
轉:http://www.safecdn.cn/cdn/2018/12/ats6-2-install/63.html
系統版本: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
#生成traffic_line和traffic_top
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 # 禁用HTTP2
CONFIG proxy.config.http.insert_response_via_str INT 2 #配置如何處理VIA響應到源伺服器
CONFIG proxy.config.log.custom_logs_enabled INT 1 #開啟自定義日誌指令
CONFIG proxy.config.log.squid_log_enabled INT 0 #關閉squid日誌
CONFIG proxy.config.log.squid_log_is_ascii INT 1 #按照ASCII碼輸出日誌
CONFIG proxy.config.log.xml_config_file STRING logs_xml.config CONFIG proxy.config.diags.show_location INT 1#記錄診斷訊息的原始碼位置 開啟主配置檔案 record.config 增加如下配置:不使用dns解析 CONFIG proxy.config.http.parent_proxy_routing_enable INT 1 CONFIG proxy.config.http.no_dns_just_forward_to_parent INT 1 [remap.config] regex_map http://(.*) http://$1 [logs_xml.config] <LogFormat> <Name = “access”/> <Format = “%<chi> %<cqtq> %<ttms> %<{X-Forwarded-For}cqh> %<crc>/%<pssc> %<pscl> %<cqhm> %<cquuc> %<cqhv> %<phr>/%<pqsi> %<psct> \”%<{Referer}cqh>\” \”%<{User-Agent}cqh>\” %<shn> %<sscl>”/> </LogFormat> <LogObject> <Format = “access”/> <Filename = “access”/> </LogObject> [storage.config] var/trafficserver 4G [ [email protected] trafficserver]# /usr/local/ats/bin/trafficserver restart
[[email protected] 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.a.com/ HTTP/1.0 NONE/0 text/html “-” “Wget/1.12 (linux-gnu)” www.a.com 0
CONFIG proxy.config.log.squid_log_is_ascii INT 1 #按照ASCII碼輸出日誌
CONFIG proxy.config.log.xml_config_file STRING logs_xml.config CONFIG proxy.config.diags.show_location INT 1#記錄診斷訊息的原始碼位置 開啟主配置檔案 record.config 增加如下配置:不使用dns解析 CONFIG proxy.config.http.parent_proxy_routing_enable INT 1 CONFIG proxy.config.http.no_dns_just_forward_to_parent INT 1 [remap.config] regex_map http://(.*) http://$1 [logs_xml.config] <LogFormat> <Name = “access”/> <Format = “%<chi> %<cqtq> %<ttms> %<{X-Forwarded-For}cqh> %<crc>/%<pssc> %<pscl> %<cqhm> %<cquuc> %<cqhv> %<phr>/%<pqsi> %<psct> \”%<{Referer}cqh>\” \”%<{User-Agent}cqh>\” %<shn> %<sscl>”/> </LogFormat> <LogObject> <Format = “access”/> <Filename = “access”/> </LogObject> [storage.config] var/trafficserver 4G [