Global custom include templates for apache/nginx (SKINS)

Version 1.5


This feature will let you insert global custom values into the CUSTOM and CUSTOM# variables in the apache/nginx templates. You can think of this as a virtual_host2.conf subset template, that is only used if exists, and gets inserted into the CUSTOM tokens for all VirtualHosts. It would be handy if you want add code to all VirtualHosts, but don't want to create new templates, and don't want to add it to each domain's Custom Httpd Config. Add to new custom template token files to the data/templates/custom folder, matching the token name you want, with a .pre or .post suffix eg: /usr/local/directadmin/data/templates/custom/cust_httpd.CUSTOM.3.pre /usr/local/directadmin/data/templates/custom/ /usr/local/directadmin/data/templates/custom/ /usr/local/directadmin/data/templates/custom/ with the apache/nginx code that you want to be inserted to the given token. The prefix is either cust_httpd. or cust_nginx. to determine which server type the token is for. Where .pre means that your code would be added *before* any CUSTOM/CUSTOM.# values set in: Admin Level -> Custom Httpd Config -> -> CUSTOM or .post means it would be added after any Custom Httpd Config data. You can use tokens as desired. If you're not sure if you should use pre or post, keep in mind that tokens can be set in Custom Httpd Config, so you could then read them if they're set, and alter the behavior of your using if-then-else statements. ======================================= SKINS: admin/custom_httpd_domain.html Old textarea for the CUSTOM token: <textarea class="code_edit" cols=120 rows=10 wrap=off name=config>|CONFIG|</textarea> Changed to add 2 more: before and after, also in divs: |*if CUSTOM_PRE| <div><textarea class="code_edit" cols=120 rows=2 wrap=off readonly>|CUSTOM_PRE|</textarea></div> |*endif| <div><textarea class="code_edit" cols=120 rows=10 wrap=off name=config>|CONFIG|</textarea></div> |*if CUSTOM_POST| <div><textarea class="code_edit" cols=120 rows=2 wrap=off readonly>|CUSTOM_POST|</textarea></div> |*endif| same idea for the CUSTOM1-4 tokens, eg#1: |*if CUSTOM1_PRE| <div><textarea class="code_edit" cols=120 rows=2 wrap=off readonly>|CUSTOM1_PRE|</textarea></div> |*endif| <div><textarea class="code_edit" cols=120 rows=4 wrap=off name=custom1>|CUSTOM1|</textarea></div> |*if CUSTOM1_POST| <div><textarea class="code_edit" cols=120 rows=2 wrap=off readonly>|CUSTOM1_POST|</textarea></div> |*endif|

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