Categories
Passenger

Rails user? Dotdeb now supports Passenger

Let me introduce Passenger :

Phusion Passenger™ — a.k.a. mod_rails or mod_rack — makes deployment of Ruby web applications, such as those built on the revolutionary Ruby on Rails web framework, a breeze. It follows the usual Ruby on Rails conventions, such as “Don’t-Repeat-Yourself”.

  • Deployment is only a matter of uploading application files. No Ruby (on Rails)-specific server configuration required!
  • Supports both the industry standard Apache web server and the fast and lightweight Nginx web server.
  • Zero maintenance. No port management, server process monitoring or stale file cleanup required. Errors are automatically recovered whenever possible.
  • Designed for performance, stability and security. Phusion Passenger should never crash Apache even in case of crashing Rails applications.
  • Well-documented, for both system administrators and developers!

 

I’m glad to announce that Dotdeb now provides Passenger 3.0.7 packages for Debian 6.0 “Squeeze” and Debian 5.0 “Lenny” in amd64 and i386 flavours and I hope you’ll enjoy them.

The installation is very easy :

  • your Apache 2.2 server will support Passenger by installing the libapache2-mod-passenger package
  • Nginx will be updated to the 1.0.1 version and it will support Passenger in the nginx-extras package

Have fun!

(Thanks to the Brightbox team for their work on the Ubuntu packages)

Categories
Documentation PHP

How to use PHP5 and PHP4 on the same Apache2 server

Since PHP4 is officially dead, it is now urgent to migrate your applications to PHP5, but it’s not that easy and you’ll have to test them before replacing PHP4 by PHP5 on your server. This article will help you to install both PHP4 and PHP5 on your box and swicth easily between them…

The problem

It is not possible to enable both PHP4 and PHP5 Apache2 modules on the same webserver, it causes shared objects collision. Then, the idea is to enable PHP5 as Apache2 module on one side and PHP4 as CGI on the other side.

Please note that this solution is not a good idea anywhere else but on developpement servers and should be temporary because of the performance and security issues of PHP as CGI.

Installation

First, we have to install the appropriate PHP packages and their dependencies (from Dotdeb, of course) :

apt-get install libapache2-mod-php5 php4-cgi

Apache2 is now configured by default to parse .php files with the mod_php5 module.

But, using mod_actions, we can tell Apache2 to parse .php files with the php4 CGI. First, enable mod_actions :

a2enmod actions
/etc/init.d/apache2 force-reload

Now, by adding the following two lines in a Virtualhost or Directory (…) context or directly in the main Apache2 configuration file, we’ll switch from PHP5 to PHP4 :

AddHandler php-script .php
Action php-script /cgi-bin/php4

(It could be necessary to reload your apache configuration :

/etc/init.d/apache2 force-reload

)

The result
To check that all works fine, create a file, called phpinfo.php, containing the following code :

Depending on the presence (or not) of the two above magical lines, a HTTP request on the script will show a PHP4 (or PHP5)-typical output.