How to reset ownership for the virtual host error_docs, cgi-bin and lib directories

Created:

2016-11-16 13:13:18 UTC

Modified:

2017-04-24 11:02:32 UTC

1

Was this article helpful?


Have more questions?

Submit a request

How to reset ownership for the virtual host error_docs, cgi-bin and lib directories

Applicable to:

  • Plesk 11.5 for Linux

Symptoms

How to fix broken ownership for ' error_docs ', ' cgi-bin ' and ' lib* ' directories and files of a domain?

Resolution

  1. Create a 'script.sh' file with the following content:

    #!/bin/bash
    #Getting list of users and their home directories from psacln group
    cat /etc/passwd | awk -F ":" '{print $1, $4, $6}' | grep `cat /etc/group | grep psacln | awk -F ":" '{print $3}'` | awk -F " " '{print $1, $3}' > /root/users_list.txt

    #Setting correct permission for forlders in home directories of each user in psacln group
    while read i
    do
    user=`echo $i | awk '{print $1}'`
    path=`echo $i | awk '{print $2}'`
    chown -R $user:`cat /etc/group | grep psacln | awk -F ":" '{print $3}'` $path/error_docs 2>>/root/report.txt
    chown -R root:root $path/lib 2>>/root/report.txt
    chown -R root:root $path/lib64 2>>/root/report.txt
    done < /root/users_list.txt
  2. Grant ' execute ' permission to it:

    # chmod +x ./script.sh
  3. Run the script:

    # ./script.sh
Have more questions? Submit a request
Please sign in to leave a comment.