I'm presently on a dedicated server running FreeBSD, and Apache using mod_php. CGI isn't presently an option due to long-running scripts on one of the domains.
I'm presently using a simple script to unsecure/secure an installation; but the secure script does not appear to always execute the chmods for e.g. the cache directory.
find ./public_html -type f ! -user apache -exec chmod 644 {} \;
find ./public_html -type d ! -user apache -exec chmod 755 {} \;
chmod -R 777 public_html/cache/
chmod -R 777 public_html/administrator/cache/
chmod -R 777 public_html/logs/
chmod -R 777 public_html/tmp/
chmod -R 777 public_html/components/com_sh404_sef/cache/
chmod -R 777 public_html/downloads/
chmod -R 777 public_html/content/
In the above, quite often I find the cache directories unwritable after running the script. If I execute all commands one after another on the command line it works as expected It'd be great if you might have an idea what I should be looking at instead?
Thanks for any suggestion.