• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

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