apache traffic server安装小试

PHPABC Apache 1,179 次浏览 , 没有评论

一、升级库
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
yum -y install expat expat-devel glibc-devel glibc tcl tcl-devel patch make gcc gcc-c++ libtool libtool-libs autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

wget http://autosetup1.googlecode.com/files/pcre-8.01.tar.gz
tar -zxvf pcre-8.01.tar.gz
cd pcre-8.01
./configure
make && make install
cd ..
wget http://autosetup1.googlecode.com/files/libiconv-1.13.tar.gz
tar zxvf libiconv-1.13.tar.gz
cd libiconv-1.13/
./configure –prefix=/usr/local
make
make install
cd ..
echo “/usr/local/lib” >> /etc/ld.so.conf
ldconfig

二、安装及配置traffic server
1、安装
groupadd trafficserver
useradd -g trafficserver trafficserver
wget http://apache.freelamp.com//trafficserver/trafficserver-2.1.3-unstable.tar.bz2
tar -jxvf trafficserver-2.1.3-unstable.tar.bz2
cd trafficserver-2.1.3-unstable
autoreconf -i
./configure –prefix=/usr/local/trafficserver –enable-webui –with-user=trafficserver –with-group=trafficserver
make
make install

2、配置
配置比较简单,只要修改三个文件就OK!
vi /usr/local/trafficserver/etc/trafficserver/records.config
CONFIG proxy.config.proxy_name STRING linuxtone.org //将机器名改成你想要的名字就OK
CONFIG proxy.config.admin.web_interface_port INT 8081 //web端口
CONFIG proxy.config.admin.admin_user STRING admin //web用户
CONFIG proxy.config.admin.admin_password STRING 21232F297A57A5A743894A0 //密码!默认为admin
CONFIG proxy.config.http.server_port INT 80 //默认为8080,,我们改成80

vi /usr/local/trafficserver/etc/trafficserver/remap.config
map http://192.168.1.253 http://bbs.linuxtone.org
用户地址 源地址

vi /usr/local/trafficserver/etc/trafficserver/storage.config
主要修改存储位置及大小!只是简单测试,没有修改

3、启动服务
/usr/local/trafficserver/bin/trafficserver start //开启
/usr/local/trafficserver/bin/trafficserver stop //停止

4、测试
C:\Users\Administrator>curl -I http://192.168.1.253
HTTP/1.1 200 OK
Server: ATS/2.1.3-unstable
Date: Mon, 08 Nov 2010 06:11:27 GMT
Content-Type: text/html; charset=utf-8
Vary: Accept-Encoding
Set-Cookie: ppRN_2132_lastvisit=1289193087; expires=Wed, 08-Dec-2010 06:11:27 GM
T; path=/
Set-Cookie: ppRN_2132_sid=5Oat3O; expires=Tue, 09-Nov-2010 06:11:27 GMT; path=/
Set-Cookie: ppRN_2132_lastact=1289196687%09index.php%09; expires=Tue, 09-Nov-201
0 06:11:27 GMT; path=/
Set-Cookie: ppRN_2132_onlineusernum=2672; expires=Mon, 08-Nov-2010 06:16:27 GMT;
path=/
Set-Cookie: ppRN_2132_sid=5Oat3O; expires=Tue, 09-Nov-2010 06:11:27 GMT; path=/
Age: 0
Connection: keep-alive
Via: HTTP/1.1 linuxtone.org (ApacheTrafficServer/2.1.3-unstable [cMsSf ])

只是做了一个简单的反向代理,,TS的功能MS很强大,继续研究中…..

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

Go