Global pre/post per-file before each apache/nginx CUSTOMX token

Version 1.533

Feature
Finished

Very similar to this feature, which allow pre/post code to be inserted before each CUSTOM/CUSTOM# token: https://www.directadmin.com/features.php?id=1816 this variation does the same thing, but not for all templates, rather for the specific template that is named, eg: All inside this directory: /usr/local/directadmin/data/templates/custom/ virtual_host2.conf.CUSTOM.pre nginx_server.conf.CUSTOM.4.post virtual_host2_secure_sub.conf.CUSTOM.1.pre etc. Where the format is: <templatename>.<tokenname>.<pre|post> Note these per-template token files are included before the id=1816 files, which is still included, if both exist. ======= ALSO at the start/end of the entire httpd.conf or nginx.conf file, unrelated to any VirtualHost or CUSTOM token: /usr/local/directadmin/data/templates/custom/cust_httpd.pre /usr/local/directadmin/data/templates/custom/cust_httpd.post /usr/local/directadmin/data/templates/custom/cust_nginx.pre /usr/local/directadmin/data/templates/custom/cust_nginx.post which shows up just after the comments, before the user_virtual_host.conf, and at the very end of the .conf files. Note that these start/end .conf templates do not share the token files, like per-domains do, so you cannot pass variables around in the same way. However, like all apache/nginx templates, they run as root, and they have embedded scripting abilities, so you can read or write data to disk, even a database, and control things that way. eg: https://www.directadmin.com/features.php?id=756

Interested to try DirectAdmin? Get a 30-day Free Trial!