Custom directives outside of a VirtualHost tag

Includes and the Include Editor

When your EasyApache profile is rebuilt using a different version of Apache, changes made to the configuration file will be replaced with their default values to ensure a working configuration.

If you would like to keep your changes through a rebuild wherein the Apache version changes, several include files can be used, eliminating the need for you to directly edit httpd.conf. WHM features an editor for these include files. This interface can be accessed at Main::Service Configuration::Apache Configuration::Include Editor.

PICK Important: This is the preferred method of making changes to httpd.conf.

Virtually any Apache directives can be added through the Include Editor. However, you should make sure that changes made through the editor are syntactically valid. For example, if you were to add a directive that pertains to mod_suphp, it would need to be enclosed in an <IfModule> block. This will allow Apache to start even when mod_suphp has not loaded.

The Apache Config Distiller

If you do decide to make direct edits to httpd.conf, most changes outside of a VirtualHost directive can be preserved easily using the config distiller tool:

  1. Make your desired changes to httpd.conf.
  2. Run the following script:
    • /usr/local/cpanel/bin/apache_conf_distiller --update --main
  3. To verify that your changes were properly stored, run the following script:
    • /scripts/rebuildhttpdconf

Custom Templates

ALERT! Warning: Custom templates will require a fair amount of upkeep.

Custom templates can be used to include information into the httpd.conf file. The information contained within a custom template file is processed by the Template Toolkit, http://template-toolkit.org, and will automatically be updated with information from the datastores used by the configuration system.

Apache 1 templates should be placed at /var/cpanel/templates/apache1/main.local. You should copy /var/cpanel/templates/apache1/main.default to /var/cpanel/templates/apache1/main.local.

Apache 2 templates should be placed at /var/cpanel/templates/apache2/main.local. You should copy /var/cpanel/templates/apache2/main.default to /var/cpanel/templates/apache2.main.local.

However, it is important to remember that, once you create a custom template, the EasyApache system will no longer preserve changes made outside of the VirtualHost directives in httpd.conf. The Apache config distiller only updates the main.default template.

For more information about custom templates, please visit our documentation here.

PICK Remember: The changes made within a custom template will require the proper tags, blocks, and directives and will require these elements to be syntactically sound.

Topic revision: r7 - 08 Jun 2009 - 16:02:57 - Main.MelanieSeibert
EasyApache3.OutsideVHost moved from Sandbox.OutsideVHost on 08 Jun 2009 - 14:51 by Main.JustinSchaefer - put it back
 

Copyright © cPanel 2000-2009.