Linux SysAdmin & DevOps

Mod_ruid2 - install from source centos

mod_ruid2 - a suexec apache module which takes the advantage of POSIX. If you want to manually install the module for the apache web server on a linux centos server:

1) Download the tar.gz file from sourceforge (link: download)

2) Extract files from archive:

tar jxvf mod_ruid2-0.9.8.tar.bz2

3) Go to folder:

cd mod_ruid2-0.9.8

4) Compile the module:

$(which apxs) -a -i -l cap -c mod_ruid2.c)

It is possible to get an error like this while compiling:

In file included from /usr/include/sys/capability.h:34,
from mod_ruid2.c:51:
/usr/include/linux/capability.h:70: error: expected specifier-qualifier-list before ‘__le32’
apxs:Error: Command failed with rc=65536

In this situation, first of all, check if you have libcap and libcpa-devel installed on your system:

rpm -qa | grep libcap

If libcap is installed and you still get that error:

mod_ruid2: Compilation error fix

1) Edit mod_ruid2.c file

2)search for line:

#include <sys/capability.h>

3) Add above that line:

#include <linux/types.h>

4) Save file

5) Recompile:

$(which apxs) -a -i -l cap -c mod_ruid2.c

The mod_ruid2.so module is automatically copied to apache module directory. A simple /etc/init.d/httpd restart will restart your apache web server with the module activated.