Skip to content

Building ATS FCGI from Source

Otto van der Schaaf edited this page May 14, 2018 · 5 revisions

Most people will be fine using the binary distribution of Traffic server-7.1.1 to build ats_mod_fcgi the standard way but if that isn't working for you or you want to make changes that require changing the Traffic server core, then you need to build Traffic server-7.1.1 from source.


Build Traffic server-7.1.1 :

  • $ git clone git@github.com:apache/trafficserver.git
  • $ cd trafficserver
  • $ git checkout 7.1.x
  • $ autoreconf -if
  • $ ./configure --prefix=$PWD/opt/ts-7.1/ --enable-debug --enable-experimental-plugins -enable-example-plugins
  • $ make -j4
  • $ sudo make install

Compile and Link FCGI plugin:

ATS_SRC="/home/oschaaf/trafficserver"
ATS_EXEC="/usr/local"

cd ~
git clone git@github.com:We-Amp/AtsFastcgi.git
cd AtsFastcgi/src
make ATS_SRC="$ATS_SRC" ATS_EXEC="$ATS_EXEC"
sudo make ATS_SRC="$ATS_SRC" ATS_EXEC="$ATS_EXEC" install

Configure ATS

  • $ cd opt/ts-7.1.1/etc/trafficserver/
  • $ sudo vi records.config

Enable these options

  • CONFIG proxy.config.http.cache.http INT 1
  • CONFIG proxy.config.reverse_proxy.enabled INT 1
  • CONFIG proxy.config.url_remap.remap_required INT 1
  • CONFIG proxy.config.url_remap.pristine_host_hdr INT 1
  • CONFIG proxy.config.http.server_ports STRING 80 80:ipv6

Configure trafficserver with the origin server


Configure FCGI Plugin

  • $ sudo vi plugin.config

  • ats_mod_fcgi.so etc/trafficserver/ats_mod_fcgi.config

  • $ sudo vi ats_mod_fcgi.config

Enable these options

  • CONFIG proxy.config.http.fcgi.enabled INT 1
  • CONFIG proxy.config.http.fcgi.host.hostname STRING localhost
  • CONFIG proxy.config.http.fcgi.host.server_ip STRING 127.0.0.1
  • CONFIG proxy.config.http.fcgi.host.server_port STRING 60000
  • CONFIG proxy.config.http.fcgi.host.include STRING fastcgi.config
  • CONFIG proxy.config.http.fcgi.host.root_directory STRING /

Configure and Start PHP Server

  • $ cd AtsFastcgi/InterceptCPPAPI/
  • $ ./bin/php-fastcgi.sh start

Start the Traffic server

  • $ cd trafficserver/opt/ts-7.1.1/
  • $ ./bin/trafficserver start