• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Plesk 11.5 extend chroot with MySQL access and /var/www/vhosts/<domain>/httpdocs/

StéphanS

Regular Pleskian
Hi,

when messing around with Drush (a Drupal CLI application that can automate your Drupal deploys) I applied following fixes to my chroots:


To install:

Code:
mkdir -p /var/www/vhosts/<domain>/var/www/vhosts/<domain>/httpdocs/
mount --bind /var/www/vhosts/<domain>/httpdocs/ /var/www/vhosts/<domain>/var/www/vhosts/<domain>/httpdocs/
##Symlink is not an option since Drush knows that it's symlinked and uses /httpdocs/ in it's configs, giving non-working site via http://<domain>/

Code:
mkdir -p /var/www/vhosts/<domain>/var/lib/mysql/
touch /var/www/vhosts/<domain>/var/lib/mysql/mysql.sock
mount --bind /var/lib/mysql/mysql.sock /var/www/vhosts/<domain>/var/lib/mysql/mysql.sock
##Symlink is also not an option since /var/lib/mysql/mysql.sock resides outside of the chroot


To remove:

Code:
umount /var/www/vhosts/<domain>/var/www/vhosts/<domain>/httpdocs/
umount /var/www/vhosts/<domain>/var/lib/mysql/mysql.sock


Would it be possible for Parallels to incorporate these fixes into chrootmng ?



The problem right now, is that when I delete a subscription my mounts remain active and /var/www/vhosts/<domain>/ is not deleted.
Furthermore ftpuser does not get deleted because of failed deletion, resulting in a messy state.

If chrootmng could create the mount for httpdocs and mysql.sock and remove it again before doing all the other deletes, then this would work perfectly!




NOTE: Do _NOT_ bind mount /var/lib/mysql/ !
If you do, you will be deleting all your databases once somebody deletes his domain via Plesk.
This is because Plesk deletes vhosts with root, and can thus delete everything in /var/lib/mysql/ .








Edit:

I created a dirty fix for now:


Code:
/usr/local/src/exec-notify | awk '$10 ~ "--del-user" {system("echo " $12 " | sed -e s@--homedir=@@ -es@/var/www/vhosts/@@ | xargs -I {} sh /root/cleanchroot.sh {}")}'

/root/cleanchroot.sh
Code:
#!/bin/bash

HTTPD_VHOSTS_D=$(awk '$1 = /HTTPD_VHOSTS_D/{print $2}' /etc/psa/psa.conf)


umount $HTTPD_VHOSTS_D/$1/var/lib/mysql/mysql.sock
umount $HTTPD_VHOSTS_D/$1/var/www/vhosts/$1/httpdocs/


echo $1 >> /var/log/cleanchroot.log


exec-notify can be installed using:
Code:
yum -y install make gcc
cd /usr/local/src/
wget http://users.suse.com/~krahmer/exec-notify.c
make exec-notify
 
Last edited:
Back
Top