mod_ruid2 installation

what is mod_ruid2 module?

The mod_ruid2 module is a suexec module for Apache 2.0 that provides performance similar that of mod_php with the security of suphp. This module allows PHP applications to run as the user, instead of as the user nobody in a manner similar to suphp.

However, mod_ruid2 is incompatible with some EasyApache modules, such as FastCGI, mod_cache, mod_disk_cache, mod_mem_cache, and ModMono. While mod_ruid2 may be ideal for many environments, cPanel recommends testing and verification that it is appropriate for your configuration. Generally, mod_ruid2 is not considered to be production-worthy.

The latest release of EasyApache includes improvements to several third-party libraries and utilities. Updates to EasyApache 3.8.2 include support for modruid2 version 0.9.4.

Installation In cPanel Server

yum install libcap-devel
cd /usr/local/src
tar -jxf mod_ruid2-0.9.4.tar.bz2
cd mod_ruid2-0.9.4
vi ruid2.conf
LoadModule ruid2_module modules/
<IfModule mod_ruid2.c>
RMode config
RDefaultUidGid nobody nobody
RUidGid nobody nobody
RGroups nobody
apxs -a -i -l cap -c mod_ruid2.c
Open httpd.conf and remove the line from it:
LoadModule ruid2_module modules/

echo “LoadModule ruid2_module modules/” >> /usr/local/apache/conf/includes/pre_main_global.conf
/usr/local/cpanel/bin/apache_conf_distiller –update
/etc/init.d/httpd restart

In future, /scripts/easyapache recompiles will move the file out of /usr/local/apache/modules folder. So save a copy of it.
cp /usr/local/apache/modules/ /root

vi /scripts/preeasyapache

sed -i ‘s/LoadModule ruid2_module/#LoadModule ruid2_module/g’ /usr/local/apache/conf/includes/pre_main_global.conf

vi /scripts/posteasyapache

cp /root/ /usr/local/apache/modules/
sed -i ‘s/#LoadModule ruid2_module/LoadModule ruid2_module/g’ /usr/local/apache/conf/includes/pre_main_global.conf
/etc/init.d/httpd restart

chmod +x /scripts/preeasyapache
chmod +x /scripts/posteasyapache

Reference :

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: