• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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