Install suPHP on CentOS 5.1

suPHP doesn't simply compile with ./configure like it used to in CentOS 4. This is because apr-config changed to apr-1-config.

Prerequisite:

yum install httpd-devel

Without httpd-devel installed you would receive this error: APXS was not found, so mod_suphp will not be built!

Step 1:

./configure --with-apr=/usr/bin/apr-1-config

Without the --with-apr=/usb/bin/apr-1-config you would receive this error: configure: error: APR is needed to build mod_suphp for Apache 2.x but was not found

Step 2:

make
sudo make install

Additional Information:
For suPHP 0.6.2 you should change src/apache2/mod_suphp.c lines 324 & 345 to:

AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp to handle these MIME-types"),
AP_INIT_ITERATE("suPHP_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp not to handle these MIME-types"),

This will allow you to set the suPHP_AddHandler & suPHP_RemoveHandler from within a VirtualHost. (Download changed package)