Using custom Rack servers

By default, applications deployed by Cloud 66 run on Phusion Passenger behind Nginx. You can also choose to use one of several servers:

It’s vital to distinguish between these Rack-based application (or “web app”) servers and Nginx which acts as the public web front-end for Cloud 66 applications. We usually refer to Nginx as our “web server”, but it performs a different task to the Rack-based app servers described in this doc.

Important

You need to choose your web app / Rack server when you first build an application. Changes to or from Passenger will not be applied after your application has initially been built. You can however change freely between other supported servers after build.

Configuring a custom Rack server

If you would like to use a different server, there are some points you’d need to consider for it to work with a Cloud 66 application. These conventions will allow Cloud 66 to redirect traffic to your servers and manage them for availability, memory consumption and restart cycles.

Traffic Socket

For the traffic to be redirected to your web app server, it should use a Unix socket at /tmp/web_server.sock

PID file

For the web app server to be managed and restarted properly by Cloud 66, it needs to have it’s PID file at /tmp/web_server.pid

Manual control of the web servers

To control your web app servers manually you can use the following commands:

Stop the web app server

sudo bluepill cloud66_web_server stop

Start the web app server

sudo bluepill cloud66_web_server quit
sudo bluepill load /etc/bluepill/autoload/cloud66_web_server.pill

Restart the web app server

If supported by your web app server, you can use the following command to restart the web app server with no down time (this will send a USR2 signal to the server)

sudo bluepill cloud66_web_server restart

What’s next?