We’re switching to SuPHP setup; I’ve created the following bash scripts with my limited bash knowledge.
To remove ‘php_value’ from the .htaccess file:
To correct the permission on the files and directory:
I want to remove all the ‘php_value’ from every .htaccess file. This is working but it only removes the ‘php_value’ from the ‘public_html’ directory, .htaccess file.
Any help appreciated!
Thanks,
To remove ‘php_value’ from the .htaccess file:
Code:
#!/bin/bash
for i in `ls /home/*/public_html/.htaccess` ; do cat $i | sed "s/php_value/###php_value/g" > $i.new; mv -f $i.new $i;done
Code:
#!/bin/bash
for user in `ls /var/cpanel/users`; do
chown -R ${user}:${user} /home/${user}/public_html
chmod 755 /home/${user}/public_html
find /home/${user}/public_html -group nobody -exec chgrp ${user} {} \; -print0
find /home/${user}/public_html -perm 777 -type d -exec chmod 755 {} \; -print0
find /home/${user}/public_html -perm 666 -type f -exec chmod 644 {} \; -print0
find /home/${user}/public_html -perm 777 -type f -exec chmod 644 {} \; -print0
done
Any help appreciated!
Thanks,