EasyApache builds your global Apache configuration from the following components:
/usr/local/apache/conf/includes/directory to create your global Apache configuration.
EasyApache builds each
virtualhost tag from the following components:
/var/cpanel/templates/2_2/and /var/cpanel/templates/2_4/ directories.
/usr/local/apache/conf/userdata/directory for each domain to build the configuration of each
To modify the configuration options for your Apache build, use raw opts. Raw opts are also known as custom configure flags.
Raw opts are lines of data that advanced users can add to a specific file on the server in order to customize the configuration of Apache or PHP builds. EasyApache allows you to specify any configuration option supported by Apache and/or PHP.
For more information on raw opts, read our Raw Opts documentation.
When Apache processes a request, it searches for an
.htaccess configuration file inside the directory that contains the requested file. If the
.htaccess file exists and is readable by Apache, Apache will use its contents to modify the configuration for the request. For more information about how to use
.htaccess, read Apache’s HTTP Server Tutorial.
Some events in a cPanel & WHM environment will trigger a syntax check of a
.htaccess file. When it runs the check, Apache will skip any modules that loaded at runtime. Any attempt to reference configuration directives that these modules provide will produce syntax errors. To prevent these errors, you must wrap those directives inside an
<IfModule></IfModule> block. The following is an example of an
To modify your global Apache configuration, use one of the following methods:
To modify Apache's global configuration directives that cPanel & WHM builds by default, use WHM's Global Configuration interface (Home >> Service Configuration >> Apache Configuration >> Global Configuration).
To modify the Apache configuration's include files view WHM, use WHM's Include Editor interface (Home >> Service Configuration >> Apache Configuration >> Include Editor).
To modify the Apache configuration's include files via the command line interface (CLI), edit the appropriate configuration files in the
After you modify an include file, make certain that you restart the Apache service with the
service httpd restart command.
You can use the CLI to add include files that modify the content of the virtualhost containers in your Apache configuration. You may wish to do this to modify the configuration of an individual domain or a specific user's domains. For more information on how to modify your virtualhost containers with include files, read our Modify Virtualhost Containers With Include Files documentation.
We do not recommend that you use this method. cPanel & WHM or EasyApache may overwrite your changes.
If you must modify your
httpd.conf Apache configuration file directly, perform the following steps:
Run the Apache configuration distiller script as the
root user with the following command:
The Apache configuration distiller script does not make changes to your Apache configuration. The distiller script updates the datastores in the
The Apache configuration distiller script does not guarantee that cPanel & WHM will not overwrite your direct modifications to your
To test whether cPanel & WHM will overwrite your modifications, perform the following steps:
httpd.conffile with your direct modifications.
/scripts/rebuildhttpdconfscript to rebuild your
httpd.conffile. If your changes are still present in your
httpd.conffile, then cPanel & WHM will not overwrite your modifications.
You can use custom templates to change the default content of each virtualhost container. For more information on custom templates, read our Custom Templates documentation.