Welcome! Log In Create A New Profile

Advanced

php5-fpm chroot and libs for mail(); mysql, ...

Posted by Salem 
php5-fpm chroot and libs for mail(); mysql, ...
November 19, 2011 10:38PM
Hello,

i'm still trying to find an easy way to install multiple websites with php5-fpm and putting every site inside a pool with a chroot-directory.
Atm it's working really nice, except the needed libs/files for things like mail(), mysql, exec(), ...

Is there a easy way to do that? I have many different websites and i need the same files for every pool, but how should i handle updates and co? I can't copy every needed file manually and i'm still searching for a complete file list needed for everything i could do with php.

Thanks
Re: php5-fpm chroot and libs for mail(); mysql, ...
December 26, 2011 03:51PM
Hi -
What I do is copy the following files (which I figured out by running ldd a lot):

/bin/sh
(unfortunately sendmail needs this)

/dev/null
/dev/urandom

/etc/hosts
/etc/ld.so.cache
/etc/nsswitch.conf
/etc/resolv.conf
(to be able to use DNS from inside PHP)

/lib/ld-linux.so.2
/lib/libnsl.so.1
/lib/libnss_compat.so.2
/lib/libnss_dns.so.2
/lib/libnss_files.so.2
/lib/tls/i686/cmov/libc.so.6

Then I got mini_sendmail from here: http://acme.com/software/mini_sendmail/ which is an almost statically compiled sendmail alternative. It doesn't compile correctly under ubuntu, and I'd have to look up what the exact problem is, but if i remember correctly the problem was that a user was defined incorrectly and was pretty easy to fix - ask if you have problems.

You can then move the binary to /usr/sbin/sendmail and you should be done.

Finally, I also have the locale files copied for the languages I need to provide translations:

/usr/lib/locale/...

For updates, I periodically compare the files in one chroot to those in the absolute paths and check for new ones, which of course is far from optimal, but then again they seldom change.

Good luck!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 244
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready