Results 1 to 2 of 2

Thread: Website create event hook to change httpdocs permissions

  1. #1

    Exclamation Website create event hook to change httpdocs permissions


    I am running into the issue that the httpdocs and httpsdocs of newly created sites have their permissions set to 750. This is causing Access Denied errors when trying to visit the URL until the permissions are changed to 755.

    I searched on the internet, and this seems to be a common error. The recommended solution was to subscribe to an event to automatically change the permissions on the newly created directory.

    Unfortunately, though the documentation says it exists, I could not locate the Advanced Administrators Guide for Plesk 10.1 which supposedly lists all of the events and their variables.

    Nevertheless, I was able to setup an hook for the Website created event, which successfully receives the new domain name as parameter. Here is the code for the hook:

    echo "--------------" >> /tmp/event_handler.log
    /bin/date >> /tmp/event_handler.log
    /usr/bin/id >> /tmp/event_handler.log
    echo "subscription created" >> /tmp/event_handler.log
    echo "domain: ${NEW_DOMAIN_NAME}" >> /tmp/event_handler.log
    chmod 755 /var/www/vhosts/${NEW_DOMAIN_NAME}/httpdocs
    echo "--------------" >> /tmp/event_handler.log

    I have subscribed it to the Website created event, run as root, with the command:
    sh /usr/local/psa/bin/

    The bash script is able to properly get the domain name, and adds it to the log. But the httpdocs folder is still set to 750. I have tested the script by hardcoding values for NEW_DOMAIN_NAME and executed it manually, and it properly changes the permissions.

    My guess it that I am subscribed to the wrong event. I am thinking that there is an event later on, which is resetting the permissions to 750.

    Can anyone help me figure out what is going wrong and how to fix this? It is frustrating to have to SSH to the server each time a new site is added, and keeps other less technical users from being able to create websites.

  2. #2


    I am not sure why my script wasn't working, but I have resolved the access denied issue, so I no longer need this work around.

    It was my own mistake, somehow the user apache had been removed from the psaserv group.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts