chown .htaccess files in public_html?
Hi,
We are trying to upgrade our hosted sites to php7.2 but for some reason around 50% of .htaccess files in public_html have the user set to root:root.
Is there a way to update all .htaccess within all user accounts to their correct user account please?
-
This will recursively search each account for .htaccess and change the ownership accordingly: for user in $(whmapi1 listaccts|grep user | awk '{print$2}') ; do find /home/"$user"/public_html/ -type f -name .htaccess -exec chown -v "$user": {} \; ; done
Might take a while depending on how many accounts If you strictly only want to change ownership of /home/user/public_html/.htaccess then dofor user in $(whmapi1 listaccts|grep user | awk '{print$2}') ; do chown -v "$user": /home/"$user"/public_html/.htaccess ; done0 -
Hi @Robert Wiseman Because there's no automatic way to do this the solution suggested by @Jcats would work for what you're wanting to do. Thanks! 0
Please sign in to leave a comment.
Comments
2 comments