I am creating a production server that will run nginx with php-fpm. I want to have a good mix between securing the server, and still having good quick workflow.
Now one thing that always secures the system is chrooting. Now I have read a lot about this, and chrooting nginx is pretty complicated.
It is said that a good way is using the chroot function that php-fpm has build in. I read several guides, that explain how to set this up, but I haven't read about the implications this brings. I even read that there are none.
Well, the first problem I got was something time related. Solution was to copy
/etc/localtime and the folder
/usr/share/zoneinfo into the chroot directory.
NONE of the guides tell you this, and it is the first error you notice.
Now I am having trouble with
file_get_contents, I get the following error:
failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known
I guess the solution will be to add more files into the chroot. I really don't want to do this for every website I develop.
Now is this the case with chrooting, even in php-fpm, or am I doing something wrong. Is there something I have to enable to get everything working, or should I move everything into the directory.