Found the solution myself. SELinux prevents the permission change from taking effect. command setenforce 0
allowed the permission changes to take effect.
I set applications, datastore, and plugins permissions to 777 but for some reason the script doesn't recognize their permission staus. How can I fix this?