InterWorx version 7 – PHP and Apache template customizationInterWorx version 7 – PHP and Apache template customizationInterWorx version 7 – PHP and Apache template customizationInterWorx version 7 – PHP and Apache template customization
  • Pricing
  • Features
    • InterWorx
    • Clustering
    • Developers
    • Roadmap
  • Support
    • Overview
    • Latest News and Blog
    • Documentation
    • InterWorx Forums
    • Version History
    • Help Desk
    • FAQ’s
    • New Feature Requests
  • Company
    • End User License Agreement
    • Privacy Policy
    • Bug Bounty
    • InterWorx Partners
    • Our Brand
    • Website Accessibility Statement
    • Contact Us
  • My Account
✕
New Support System and Forum
September 11, 2020
Regarding CVE-2021-3156
January 27, 2021

InterWorx version 7 – PHP and Apache template customization

Published by InterWorx on September 29, 2021

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.


Template Customization

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. 


Template Variables

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:

Share
31

Related posts

March 12, 2025

InterWorx 8 and EL9 Support Public Release


Read more
August 7, 2024

InterWorx 8 Public Beta Update: In-place Upgrade Tool


Read more
July 2, 2024

CentOS 7 EOL Information


Read more
  • Liquid Web Family of Brands
  • Liquid Web
  • Visit Nexcess
  • Visit iThemes
  • Visit Interworx
© 2019 InterWorx, LLC. All Rights Reserved.