Before you start
Before you get started with Traffic Server you may have to decide which version you want to use. Traffic Server uses the same "semantic versioning" to denote "stability" as Apache apr and httpd do:
A version is made of a version-triplet: MAJOR.MINOR.PATCH
The most important thing that you need to know is that an even MINOR marks
a production stable release (such as 3.0.3 and 3.2.5), while an odd
MINOR number marks a targeted at developers.
Sometimes we speak of trunk, master, or when talking about actual releases, we will say "-unstable", or "-dev". All of these are interchangable: trunk or master or sometimes TIP or HEAD, refer to the latest code in a Version Control System. While "-dev" (or the unfortunately named "-unstable") qualifies that a certain release "3.3.1-dev" is has not had seen enough testing to be seen as production ready.
If your distribution does not come with a prepackaged Traffic Server, please go to downloads to choose the version that you consider most appropriate for yourself. If you want to really be on the bleeding edge you can clone our git repository.
Please note that while we do have a GitHub Mirror that you can also use to submit pull requests, it may not be entirely up-to-date.
Building Traffic Server
In order to build Traffic Server from source you will need the following (development) packages:
- pkgconfig
- libtool
- gcc (>= 4.3 or clang > 3.0)
- make (GNU Make!)
- openssl
- tcl
- expat
- pcre
- pcre
- libcap
- flex (for TPROXY)
- hwloc
- lua
if you're building from a git clone, you'll also need
- git
- autoconf
- automake
We will show-case a build from git:
git clone https://git-wip-us.apache.org/repos/asf/trafficserver.git
Next, we cd trafficserver and run:
autoreconf -if
This will generate a configure file from configure.ac, so now we can run that:
./configure --prefix=/opt/ats
Note well, that by default Traffic Server uses the user nobody, as well as user's
primary group as Traffic Server user. If you want to change that, you can override it here:
./configure --prefix=/opt/ats --with-user=tserver
If dependencies are not in standard paths (/usr/local or /usr), you need to pass options
to configure to account for that:
./configure --prefix=/opt/ats --with-user=tserver --with-lua=/opt/csw
Most configure path-options accept a format of "INCLUDE_PATH:LIBRARY_PATH":
./configure --prefix=/opt/ats --with-user=tserver --with-lua=/opt/csw \
--with-pcre=/opt/csw/include:/opt/csw/lib/amd64
We can run make to build the project. We highly recommend to run make check
to verify the build's general sanity:
make make check
We can finally run make install to install (you may have to switch to root to do this):
sudo make install
We also recommend to run a regression test. Please note that this will only work
successfully with the default layout:
cd /opt/ats sudo bin/traffic_server -R 1
After you have installed Traffic Server on your system, you can do any of the following:
Start Traffic Server
To start Traffic Server manually, issue the trafficserver command, passing
in the attribute start. This command starts all the processes that work together
to process Traffic Server requests as well as manage, control, and monitor
the health of the Traffic Server system.
To run the trafficserver start command, e.g.:
bin/trafficserver start
At this point your server is up and running in the default configuration of a reverse proxy.
Start Traffic Line
Traffic Line provides a quick way of viewing Traffic Server statistics and configuring the Traffic Server system via command-line interface. To execute individual commands or script multiple commands, refer to Traffic Line Commands.
Traffic Line commands take the following form:
bin/traffic_line -command argument
For a list of traffic_line commands, enter:
bin/traffic_line -h
Please note that traffic_line, while a fine tool for an administrator, is
a poor choice for automation, especially that of monitoring. See our chapter on
Monitoring Traffic for how to get that righter.
Stop Traffic Server
To stop Traffic Server, always use the trafficserver command, passing in
the attribute stop. This command stops all the Traffic Server processes (traffic_manager,
traffic_server, and traffic_cop). Do not manually stop processes, as this
can lead to unpredictable results.
bin/trafficserver stop

