You could setup a cron job that executes a shell script on a regular base... like every 10 min or so...
That shell script will then fetch all .htaccess files from a given directory (or maybe even subdirectories [but one level down is probably enough] and alter the ownership and file mode...
The shell script would be something like this (needs to be tested!!!):
Code:
for FILE in "$(find /var/www -maxdepth 2 -name ".htaccess")"
do
# Echo the files found
echo $FILE
# Chown the files found
# chown root.root $FILE
# Chmod the files found
# chmod 0755 $FILE
done
exit 0
This above script will search all /var/www plus it will go one directory down.... assuming that you have the setup something like this:
/var/www
--> /var/www/web1
--> /var/www/web2
--> /var/www/web3
If you have the user webfolder in something like this:
--> /var/www/web3/html
Then alter the maxdepth limitation... I'm not sure if the above example is already set to one level deep or not...
Hence I did comment out the actual chownin and chmodding... first use the echo
Recent comments
15 hours 12 min ago
1 day 39 min ago
1 day 1 hour ago
1 day 5 hours ago
1 day 9 hours ago
1 day 9 hours ago
1 day 11 hours ago
1 day 21 hours ago
2 days 2 hours ago
2 days 4 hours ago