Chroot Apache on CentOS 5 32bit

SECUREFOLDER=/securesystem
mkdir $SECUREFOLDER
mkdir -p $SECUREFOLDER/var/run
chown -R root.root $SECUREFOLDER/var/run
mkdir -p $SECUREFOLDER/home/httpd
mkdir -p $SECUREFOLDER/var/www/html
mkdir -p $SECUREFOLDER/tmp
chmod 1777 $SECUREFOLDER/tmp
mkdir -p $SECUREFOLDER/var/lib/php/session
chown root.apache $SECUREFOLDER/var/lib/php/session
cd /opt/
yum list | grep chroot
wget http://core.segfault.pl/~hobbit/mod_chroot/dist/mod_chroot-0.5.tar.gz
tar -zxvf mod_chroot-0.5.tar.gz
cd mod_chroot-0.5
apxs -cia mod_chroot.c
vi /etc/httpd/conf/httpd.conf
setsebool httpd_disable_trans 1
vi /etc/init.d/httpd
chattr +i /etc/init.d/httpd
/etc/init.d/httpd start
/etc/init.d/httpd start

Comments

Popular posts from this blog

Basic Send Message to MQ with Java and IBM MQ JMS

Basic Receive Message to MQ with Java and IBM MQ JMS

Creating a simple Alert / Success Message with ASP.NET/VB using Bootstrap