Steps to install a chroot jail on CentOS 6.3
Now you can use YUM to install additional software from inside the chroot jail. Or you can always exit the jail and install from outside using the yum –installroot switch.
LOGIN INTO THE CHROOT ENVIRONMENT
You should be inside the chroot now.
# add following line to /root/.bashrc
If you plan to use the screen command, or any application that uses /dev/pts, run the following script first:
CHROOT.[root@host ~]# ./mount_pts.sh
Installing packages inside the chroot:
yum provides "*/ping"
yum provides "*/bin/telnet"
yum install telnet
yum install httpd
yum install php php-cli php-pdo php-mysql php-snmp php-soap php-odbc php-imap php-gd
yum provides "*/bin/telnet"
yum install telnet
yum install httpd
yum install php php-cli php-pdo php-mysql php-snmp php-soap php-odbc php-imap php-gd
Checking PHP version
[root@host ~] php --version
No log handling enabled - turning on stderr logging
Created directory: /var/lib/net-snmp/mib_indexes
PHP 5.3.3 (cli) (built: Jul 3 2012 16:53:21)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
No log handling enabled - turning on stderr logging
Created directory: /var/lib/net-snmp/mib_indexes
PHP 5.3.3 (cli) (built: Jul 3 2012 16:53:21)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
Starting Apache ….
CHROOT.[root@host] service httpd status
httpd is stopped
CHROOT.[root@host] service httpd start
Starting httpd: [ OK ]
httpd is stopped
CHROOT.[root@host] service httpd start
Starting httpd: [ OK ]
Have Fun.