Disabling Passenger built-in error handler

Overview Passenger provides a user-friendly, on-screen error handler to assist debugging a Python/Ruby/Node.js application. During production, however, this may result in unnecessary and possibly dangerous information disclosure. You can turn off Passenger’s built-in logger and use Apache’s generic error handler by adding the following line to your .htaccess file located within the public/ folder of your app:…

Using WSGI

Overview Python applications can be launched using Passenger offering improved throughput and lifecycle management. Launching CGI scripts wrapped by pyenv will yield very poor throughput as a result of multiple shell subprocesses necessary to ascertain the correct Python interpreter. Adapting a CGI application to WSGI improves throughput significantly by reducing overhead through a persistent process. Pages load quickly, and applications utilize…

Restarting Passenger processes

Overview An application launched by Passenger may be restarted by creating a file in tmp/ (NB: not /tmp) within the application root directory, usually one level down from public/. Create a file under tmp/ named restart.txt to restart the application once. A restart will happen within 2 minutes. To restart an application on every request, very useful for…

Using multiple versions with Passenger

Overview Passenger provides an intelligent polyglot launcher interface for managing Node.js, Ruby, and Python processes. This can be teamed up with pyenv to effortlessly launch multiple Python applications with a single shell command and .htaccess directive. These steps are only necessary to use supplementary Python versions available on the server. If the default version works…

Django quickstart

Overview Django is a web framework based on Python. Python is available on all packages, and a Django application may be uploaded on any package. But, to create a new project on the server and complete this quickstart, a package with terminal access is necessary. This quickstart covers using Django with Passenger available on v6+ platforms. Quickstart From…