This is a discussion on How to jail php within the Web servers forums, part of the Mastering Servers category; Hello, For security i need to put PHP in jail. How do i put or run PHP inside a chroot ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
Hello,
For security i need to put PHP in jail. How do i put or run PHP inside a chroot jail ? TIA
__________________
Raj Linux rulz. I have never turned back in my life ; I shall not do so today.. haha |
| Sponsored Links | ||
|
|
|
||||
|
Assuming that your jail is located @ /jail
First copy PHP5 to jail Code:
mkdir -p /jail/usr/bin cp /usr/bin/php5-cgi /jail/usr/bin/ cp /usr/bin/php5 /jail/usr/bin/ Code:
cd /bin wget http://www.cyberciti.biz/files/lighttpd/l2chroot.txt mv l2chroot.txt l2chroot chmod +x l2chroot Code:
BASE="/jail" Code:
/bin/l2chroot /usr/bin/php5-cgi /bin/l2chroot /usr/bin/php5 Copy /etc/php.ini and other php config files to /jail/etc/ directory and restart Web server. See following url for detailed instructions http://www.cyberciti.biz/tips/howto-...oted-jail.html |