Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@oschaaf
Last active May 22, 2018 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oschaaf/b4430f2536d897f099af626e2399b58c to your computer and use it in GitHub Desktop.
Save oschaaf/b4430f2536d897f099af626e2399b58c to your computer and use it in GitHub Desktop.
AtsFastCGI instal notes

Install

git clone https://github.com/We-Amp/AtsFastcgi.git
cd AtsFastCGI
git checkout threadLocalStorage
cd InterceptCPPAPI

ATS_SRC="/home/oschaaf/trafficserver"
ATS_EXEC="/usr/local"
make ATS_SRC="$ATS_SRC" ATS_EXEC="$ATS_EXEC"
sudo make ATS_SRC="$ATS_SRC" ATS_EXEC="$ATS_EXEC" install

CONFIG

Add to plugin.config:

# For possible settings, see below
ats_mod_fcgi.so /usr/local/etc/trafficserver/fcgi.config

Starting CGI

sudo apt-get install php-cgi
php-cgi -b 60000

Running ATS

sudo traffic_server -T .*cgi.*

Requesting a php page

curl 127.0.0.1/test.php

Config php:

Default directory where php looks for scripts is "/var/www/html/ Simple test page that dump php info:

oschaaf@ats-fastcgi:/var/www/html⟫ cat test.php

<?php
// Show all information, defaults to INFO_ALL
phpinfo();
// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);
?>

Settings

ats_mod_fcgi.config:CONFIG proxy.config.http.fcgi.enabled INT 1
ats_mod_fcgi.config:CONFIG proxy.config.http.fcgi.host.hostname STRING localhost
ats_mod_fcgi.config:CONFIG proxy.config.http.fcgi.host.server_ip  STRING 127.0.0.1
ats_mod_fcgi.config:CONFIG proxy.config.http.fcgi.host.server_port STRING 60000
ats_mod_fcgi.config:CONFIG proxy.config.http.fcgi.host.include STRING etc/trafficserver/fastcgi.config
ats_mod_fcgi.config:CONFIG proxy.config.http.fcgi.host.document_root STRING /var/www/
ats_mod_fcgi.config:CONFIG proxy.config.http.fcgi.host.html STRING index.php
ats_mod_fcgi.config:CONFIG proxy.config.http.fcgi.host.min_connections INT 2
ats_mod_fcgi.config:CONFIG proxy.config.http.fcgi.host.max_connections INT 16
ats_mod_fcgi.config:CONFIG proxy.config.http.fcgi.host.max_requests INT 1000
ats_mod_fcgi.config:CONFIG proxy.config.http.fcgi.host.request_queue_size INT 250
@oknet
Copy link

oknet commented May 22, 2018

Response 404 while I access the https://github.com/We-Amp/AtsFastcgi.git.
Is it a private project ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment