Add additional folder in home directory of a virtual host

ISPConfig sets the immutable bit of a vHost’s home directory, which prevents adding/deleting files or folders there. To add a custom folder, the immutable bit must first be reset, which can only be done as the root user.

In this example, we want to create the additional folder .cache within the home directory.

chattr -i /var/www/clients/client1/web1
mkdir /var/www/clients/client1/web1/.cache
chown web1:client1 /var/www/clients/client1/web1/.cache
chattr +i /var/www/clients/client1/web1

If PHP needs to write to the new folder, add the path to PHP open_basedir as well.