CloudLinux: update DocumentRoot.cache.json after each httpd.conf write

Version 1.62.8


Relating to the existing DocumentRoot.cache.json cache: which was meant for the now deprecated suid call: ./directadmin --DocumentRoot this change will keep the DocumentRoot.cache.json file updated via task.queue updates after each write to the User's httpd.conf The file lives at: /usr/local/directadmin/data/users/fred/DocumentRoot.cache.json and now has the User's group 640 set, eg: -rw-r----- 1 diradmin fred 817 Sep 16 16:00 DocumentRoot.cache.json so the need for the suid binary is no longer needed, as the json file can be read directly. ================ TASK.QUEUE 2 new task.queue calls are used by this feature, can be triggered manually if needed: echo "action=cache&value=document_root" >> /usr/local/directadmin/data/task.queue echo "action=cache&value=document_root&user=fred" >> /usr/local/directadmin/data/task.queue Where the user option rewrites the DocumentRoot.cache.json for just that User. Absense of the user option rewrite the DocumentRoot.cache.json files for all DA Users. ================ REQUIREMENTS This task.queue write will trigger if the custombuild/options.conf has: cloudlinux=yes You can accomplish the same thing by creating: /usr/local/directadmin/scripts/custom/user_httpd_write_post/ with code: #!/bin/sh echo "action=cache&value=document_root&user=$username" >> /usr/local/directadmin/data/task.queue exit 0 and set the script to chmod 755.

Try DirectAdmin with a 30-day money back guarantee!