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
wget http://downloads.sourceforge.net/project/mod-ruid/mod_ruid2/mod_ruid2-0.9.4.tar.bz2
tar -jxf mod_ruid2-0.9.4.tar.bz2
cd mod_ruid2-0.9.4
vi ruid2.conf
LoadModule ruid2_module modules/mod_ruid2.so
<IfModule mod_ruid2.c>
RMode config
RDefaultUidGid nobody nobody
RUidGid nobody nobody
RGroups nobody
</IfModule>
apxs -a -i -l cap -c mod_ruid2.c
Open httpd.conf and remove the line from it:
LoadModule ruid2_module modules/mod_ruid2.so

echo “LoadModule ruid2_module modules/mod_ruid2.so” >> /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 mod_ruid2.so out of /usr/local/apache/modules folder. So save a copy of it.
cp /usr/local/apache/modules/mod_ruid2.so /root

vi /scripts/preeasyapache
#!/bin/bash

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

vi /scripts/posteasyapache
#!/bin/bash

cp /root/mod_ruid2.so /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 : http://forums.cpanel.net/f5/how-install-mod_ruid2-cpanel-server-229422.html

Advertisements
  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: