NOTE: This repository depends on the repository http://github.com/ReSTARTR/unit that is forked from https://github.com/nginx/unit
Install dependencies(ref: https://github.com/nginx/unit#precompiled-packages).
Build unitd control server
$ go get github.com/ReSTARTR/unit # or git-clone
$ cd github.com/ReSTARTR/unit
$ git checkout go-include-path
$ ./configure && make
Run unitd
$ ./build/unitd --control unix:/tmp/control.unit.sock
Prepare for each app server
for lang in php python go; do
./configure $lang && make $lang
done
$ cd ./go_server
$ go build -o go_server
Edit listeners.json for your environment.
# If you run on Mac, with "-i ''" option
$ sed -E "s:GOPATH:$GOPATH:g" ./listeners.json
Notify to unit control server.
$ cd github.com/ReSTARTR/unit
$ curl --unix /tmp/control.unit.sock -XPUT -d @./listeners.json http://localhost/
and request to the application server
$ for port in 8200 8300 8400; do curl localhost:$port; echo; done
Hello, PHP
Hello, Python
Hello, Go