You are on page 1of 4

install traffic server

1 6 , 133 0 1

1. tar jxf trafficserver-2.0.1.tar.bz2 2. ./configure --prefix=/usr/local/ts error: checking for existence of /usr/lib/tclConfig.sh... loading checking for XML_SetUserData in -lexpat... no configure: error: in `/fgn/soft/trafficserver-2.0.1': configure: error: check for devel? See `config.log' for more details. solution:

libexpat failed. Have you installed expat-

kernel_test_01:/lib64 # ldconfig -p | grep libexpat libexpat.so.1 (libc6,x86-64) => /lib64/libexpat.so.1 libexpat.so.1 (libc6) => /lib/libexpat.so.1 libexpat.so (libc6) => /usr/lib/libexpat.so cd /lib64 ln -s libexpat.so.1 libexpat.so 3 ./configure --prefix=/usr/local/ts error: configure: error: check for sqlite3-devel? See `config.log' for more details. solution: kernel_test_01:/fgn/soft/trafficserver-2.0.1 # cd /usr/lib64/ kernel_test_01:/usr/lib64 # ln -s libsqlite3.so.0 libsqlite3.so kernel_test_01:/fgn/soft/trafficserver-2.0.1 # ldconfig -p | grep sqlite3 libsqlite3.so.0 (libc6,x86-64) => /usr/lib64/libsqlite3.so.0 libsqlite3.so (libc6,x86-64) => /usr/lib64/libsqlite3.so 4 ./configure --prefix=/usr/local/ts sucess

sqlite3

failed. Have you installed

Apache Traffic server from Yahoo! Inc. is really powerful, extensible web server which is proved to serve 75K reqs/sec on commodity hardware. In this post, you'll learn how to download and run the Traffic server on your desktop, notebook.

1. Download TrafficServer 2.0.1 (latest as of 30-Sep-2010) http://trafficserver.apache.org/downloads.html 2. Install the following packages

$ sudo yum install autoconf automake \ libtool gcc-c++ glibc-devel \ openssl-devel tcl-devel \ expat-devel sqlite-devel \ pcre-devel -y

3. Extract the trafficserver and build it

$ tar jxf trafficserver-2.0.1.tar.bz2 $ cd trafficserver-2.0.1 $ ./configure $ gmake $ sudo gmake install

Now, all the required files would be installed in "/usr/local" instead of Fedora's default /usr. Lets configure Traffic server to act as ReverseProxy for apache 5. set servername of your proxy (so that it will come up in the HTTP headers)

$ sudo vim /usr/local/etc/trafficserver/records.config

# Change line 22 (it might vary) to put your hostname like shown below 22 #CONFIG proxy.config.proxy_name STRING 22 CONFIG proxy.config.proxy_name STRING fallenangel

6. Make the Traffic server listen on port 80 by default

[nareshv@fallenangel ~]$ sudo vim /usr/local/etc/trafficserver/records.config # Change 8080 port to 80 like shown below 105 #CONFIG proxy.config.http.server_port INT 8080 105 CONFIG proxy.config.http.server_port INT 80

7. Make Traffic server act as reverse proxy for apache You can add as many rules as you want. The configuration file is well defined

[nareshv@fallenangel ~]$ sudo vim /usr/local/etc/trafficserver/remap.config 124 125 map http://localhost:80/ http://localhost:8080/ 126 map http://fallenangel:80/ http://localhost:8080/

8. configure apache to listen on port 8080

[nareshv@fallenangel ~]$ sudo vim /etc/httpd/conf/httpd.conf # Change it from default port 80 to 8080 #Listen 80 Listen 8080

9. Restart apache

[nareshv@fallenangel ~]$ sudo /etc/init.d/httpd restart

10. Restart traffic server

[nareshv@fallenangel ~]$ sudo /usr/local/bin/trafficserver restart Stopping traffic_cop: [ OK ] Stopping traffic_manager: [ OK ] Stopping traffic_server: [ OK ] Starting Apache Traffic Server: [ OK ]

11. Make simple request to your TrafficServer to test if everything is ok

$ curl -v http://localhost/ * About to connect() to localhost port 80 (#0) * Trying ::1... Connection refused * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 80 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.20.1 (x86_64-redhat-linux-gnu) libcurl/7.20.1 NSS/3.12.6.2 zlib/1.2.3 libidn/1.16 libssh2/1.2.4 > Host: localhost > Accept: */* > < HTTP/1.1 404 Not Found < Date: Thu, 30 Sep 2010 09:47:53 GMT < Server: ATS/2.0.1 < Content-Type: text/html; charset=iso-8859-1 < Age: 0 < Transfer-Encoding: chunked < Connection: keep-alive < Via: HTTP/1.1 fallenangel (ApacheTrafficServer/2.0.1 [cMs f ])
<

You might also like