How to extend chrooted environment with additional commands


2016-11-16 13:25:14 UTC


2017-06-05 06:11:00 UTC


Was this article helpful?

Have more questions?

Submit a request

How to extend chrooted environment with additional commands

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux


How to extend chrooted environment with additional commands?


Chrooted shell provides limited functionality. It only allows to use very simple commands such as cp , mv , mkdir , and a few others. Neither tar functionality is not included into the chrooted shell, nor certain other system utilities are.

Find the actual set of utilities that are available in the chrooted environment in the ${HTTPD_VHOSTS_D}/chroot directory hierarchy ( HTTPD_VHOSTS_D is defined in /etc/psa/psa.conf ; it is /var/www/vhosts in RedHat-based distributions).

If it is needed to add other files to the chrooted environment skeleton (which is copied to each new domain added on to the server), paste them to the appropriate subfolder in the ${HTTPD_VHOSTS_D}/chroot directory. Also, do not forget copying over all dependencies, such as the shared libraries that executables are linked to.To apply the skeleton changes changes to the chroot environments for other existing domains, use the following commands:

    # /usr/local/psa/admin/sbin/chrootmng --remove --source=/var/www/vhosts/chroot --target=${HTTPD_VHOSTS_D}/<domain name>
# /usr/local/psa/admin/sbin/chrootmng --create --source=/var/www/vhosts/chroot --target=${HTTPD_VHOSTS_D}/<domain name>

For Plesk versions 8.x and 9.x it is possible to use --target=all to cover all hosted domains at once.

The script recreate_chroot_env from the archive attached to this article automates the process. It takes names of the files and directories to add to the chroot skeleton as the parameters:

    #./recreate_chroot_env /usr/bin/php /usr/share/zoneinfo

In the above example, the /usr/share/zoneinfo directory is added together with the PHP interpreter as this directory is required to run .php files properly. Without it, php -i fails with a message: " glibc detected ."


Have more questions? Submit a request
Please sign in to leave a comment.