Apache Configuration System
An Overview of Operations
← Go BackThe process of building a new Apache configuration begins with the build time options specified during EasyApache's setup. Before setting the build options, the current Apache configuration is distilled to record the existing configuration options. Once the build options are specified, the current Apache configuration is archived and moved aside to make room for a new default configuration.
During the build process, a new default Apache configuration is installed on the system. After any additional option modules such as PHP, mod_security are installed and their necessary modifications are made to the Apache configuration file, a new, assumedly valid Apache configuration file will exist in the configuration directory. Any directives that are added to the final Apache configuration file as part of the defaults will have been removed from the configuration file at this point and no Virtual-Host entries will exist in the configuration.
The new configuration is distilled in much the same way as the preexisting configuration, but this time the configuration is used as the basis for creating the server's main Apache configuration template. Any new directives and their values will be stored. Any directives and values from the previous configuration will receive the value from the previous configuration. The combination of the main template and data stores will be the basis for regenerating the final configuration file.
A new Apache configuration file is generated from the template and data stores and finally checked for syntactical correctness. If it passes this test then the build process is deemed complete. If it fails the syntax check, then the previous Apache configuration is restored along with entire previous Apache installation.
Processing the Apache configuration consists of two main routines. The first routine attempts to pull out all the VirtualHost domain information and rectify that data with other cPanel data forming the "user data" of the system. This is the organization of domains and their mappings to specific user accounts. This task is carried out by the userdata_update utility.
The second routine attempts to pull out the remaining configuration information contained within each VirtualHost. This information is sometimes version specific and requires an Apache directive aware tool called the apache_conf_distiller. This same tool processes the main directives of the Apache configuration and generates the main Apache template. The second process involves gathering your current Apache configuration and updating some values for correctness in regards to the Apache version being installed. At the same time the configuration values are harvested, a template of the current Apache configuration file is generated.
When rebuilding Apache via EasyApache, the current Apache configuration is processed and stored. After the build process is complete, the new default Apache configuration file is processed to yield a new template and add in any missing configuration values. Finally, the previous data stores and the new template are used to generate the completed Apache configuration file.
