• 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.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

How to setup event handler to change default permissions

S

sflc2000

Guest
Am attempting to setup an Event Handler to execute upon Domain Creation to change the permissions of the /httpdocs and /httpsdocs folders, using Plesk 9.2.x on a dedicated Linux server.

The script works from the shell command line, however it does not seem to be executing when creating a new domain in Plesk.

Event settings...

Event: Domain created
Priority: lowest (0) * also tried highest (100)
User: root * also tried user psaadm (plesk)
Command: /usr/local/psa/admin/plib/modules/test-domain-created-handler.sh <new_domain_name>

The script:

#!/bin/bash
echo "--------------" >> /tmp/event_handler.log
/bin/date >> /tmp/event_handler.log
/usr/bin/id >> /tmp/event_handler.log
echo "domain created" >> /tmp/event_handler.log
echo "name: $1" >> /tmp/event_handler.log
chmod 0775 /var/www/vhosts/$1/httpdocs
echo "chmod 0775" >> /tmp/event_handler.log
echo "--------------" >> /tmp/event_handler.log

File: -rwxr-xr-x 1 root root test-domain-created-handler.sh

When I add a new domain via Plesk, the script outputs to the /tmp/event_hanlder.log file, but the permissions remain 750 (defaults).

Found examples in the Plesk documentation and read / followed the directions. I also referred to this post in a Plesk 8.x forum, which also links to the documentation sample: http://forum.parallels.com/showthread.php?t=91221

Not sure if it's related to the user set to run the script or the script's permissions itself.

Any help appreciated, thanks!
 
Update --- got it to work, changed the event to get handled to "Physical hosting created".

The flow -> create domain, then create hosting..., so just had to figure out where to have the event script triggered.
 
Back
Top