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

ActiveMQ, easy to use open source message oriented middleware (MOM)

Basic Send Message to MQ with Java and IBM MQ JMS