InterWorx version 7 introduces a template-based PHP and Apache configuration system. The new templates can be copied and customized. In addition, many template variables can be changed.
Detailed public documentation on the new PHP and Apache template system is currently being developed and will be released, soon.
However, all template-based configuration files include comments detailing the templates they are built from. The template files include additional comments on how to customize the template. For example, when viewing a vhost conf file in /etc/httpd/conf.d/, the templates used to generate the configuration file are listed. In addition, any custom templates are also listed.
# This file is maintained by InterWorx, and will be overwritten when changes # are made via the control panel. To customize, please create a custom template. # # The following templates were used to generate this file: # # /home/interworx/etc/templates/http/vhost.tpl # * /home/interworx/etc/templates/custom-global/http/vhost/single-vhost.tpl # /home/interworx/etc/templates/http/vhost/ips.tpl # /home/interworx/etc/templates/http/vhost/domain-info.tpl # /home/interworx/etc/templates/http/vhost/document-root.tpl # /home/interworx/etc/templates/http/vhost/aliases.tpl # /home/interworx/etc/templates/http/vhost/subdomains.tpl # /home/interworx/etc/templates/http/vhost/php.tpl # /home/interworx/etc/templates/php/vhost-php-fpm.tpl # /home/interworx/etc/templates/http/vhost/cgi.tpl # /home/interworx/etc/templates/http/vhost/custom-includes.tpl # # (* custom template overrides) # # Last Update : 2020-12-03 13:36:16
The * indicates that the template in use is a custom one.
If you then view one of the templates there are instructions on how to generate a custom template copy:
# This file is a default InterWorx template, and should not be edited. InterWorx # upgrades will overwrite edits to this file. # # Templates may be customized by running any of these commands as appropriate: # # ~iworx/bin/config.pex --customize-template http/vhost --for-global # ~iworx/bin/config.pex --customize-template http/vhost --for-nodeworx {EMAIL} # ~iworx/bin/config.pex --customize-template http/vhost --for-siteworx {MASTER_DOMAIN} # ~iworx/bin/config.pex --customize-template http/vhost --for-domain {DOMAIN} # # Please refer to ~iworx/etc/templates/http/vhost/README.md for more information
For example, if you wanted to change the /home/interworx/etc/templates/http/vhost.tpl for a specific domain, you would run the corresponding config.pex command:
~iworx/bin/config.pex --customize-template http/vhost --for-domain {DOMAIN}
This will copy the default template file to a custom location. You can then edit the new template file and modify the template used for the vhost.conf
Instructions for regenerating the configuration files using your template changes are in the noted README.md file. In this case, ~iworx/etc/templates/http/vhost/README.md.
In addition, the template variables can often be changed using ~iworx/bin/config.pex. Running that command with the –help flag will provide a list of potential options. For example, this may be used to change a domain’s document root, as seen here: