柳橙汁儿

国内IDC租用,海外IDC租用,CN2,DDOS清洗,大带宽

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
系统版本: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.下载源码包并安装
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
 
[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.a.com/ HTTP/1.0 NONE/0 text/html “-” “Wget/1.12 (linux-gnu)” www.a.com 0
posted on 2018-12-11 13:59  柳橙汁儿  阅读(250)  评论(0编辑  收藏  举报