How httpd.conf Is Processed
Advanced users who wish to customize their Apache configurations would benefit from understanding how
is built and processed by AdvConfig (the Apache configuration system). Once you use the EasyApache interface to specify the options you wish to include in your configuration and click the Build
button, the following steps take place.
Building the Apache Configuration File
- The build process begins by distilling and recording Apache’s current configuration.
- The build time options you configured during the EasyApache setup are used to begin building the configuration.
- Option modules such as
mod_security are installed, and their corresponding modifications are made to the new Apache configuration file.
- A new, assumedly valid Apache configuration file will exist in the configuration directory.
- Directives added to the final Apache configuration file as defaults have been removed at this point.
- No VirtualHost entries exist in the configuration file at this point.
- The new configuration is distilled in much the same way as before; however, this time the configuration is used as the basis for creating the server’s main Apache configuration template.
- New directives and values are stored.
- Any directives and values held over from the previous configuration will retain their values from that configuration.
- The combination of the main template and data stores will be the basis for regenerating the final configuration file.
- Finally, the new Apache configuration file is generated from the template and data stores and checked for syntactical correctness.
- If the new file passes the test, the process is complete.
- If the file fails the syntax check, the previous Apache configuration is restored.
Processing the Apache Configuration
Processing Apache’s configuration file is completed in 2 routines.
- The first routine attempts to extract VirtualHost domain information and combine it will other cPanel data, in effect creating “user data.” This information is used in mapping domains to user accounts. This particular task is carried out by the
userdata_update utility (
- If you wish to make custom alterations you would need to run
- The second routine attempts to pull out the remaining information within each VirtualHost entry. Some of this information is version-specific and requires the Apache directive-aware tool
/usr/local/cpanel/bin/apache_conf_distiller. This is the same tool that processes Apache’s main directives and generates the main Apache template.
- This second process gathers your current Apache configuration information, and uses it to update the new version being installed.
- At the same time these values are harvested, a template of the current Apache configuration is generated.
When Apache is rebuilt using EasyApache, the current configuration is processed and stored. After the build process is complete, the new Apache configuration file is processed to yield a new template and add any missing configuration values.
Finally, the previous data stores and the new template are used to generate the completed Apache configuration file.
Topic revision: r9 - 08 Oct 2010 - 15:53:20 - Main.MelanieSeibert
EasyApache3.EA3Overview moved from Sandbox.EA3Overview on 08 Jun 2009 - 14:40 by Main.JustinSchaefer
- put it back