EasyApache 4 provides several ways for you to customize your Apache configuration.
EasyApache 4 builds your global Apache configuration from the following components:
/var/cpanel/templates/apache2_4/directory to create your global Apache configuration.
EasyApache builds each
virtualhost tag from the following components:
/etc/apache2/conf.d/userdata/directory for each domain to build the configuration of each
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 Apache can read it, Apache uses its contents to modify the configuration for the request. For more information about how to use
.htaccess files, read Apache’s HTTP Server Tutorial.
Some events in the cPanel & WHM environment trigger a syntax check of a
.htaccess file. When Apache runs the check, it skips any modules that it loads. Any attempt to reference configuration directives that these modules provide will produce syntax errors. To prevent these errors, you must wrap those directives within an
<IfModule></IfModule> block. The following example displays an
<IfModule mod_suphp.c> suPHP_ConfigPath /etc </IfModule>
To modify your global Apache configuration, use one or more of the following methods:
To modify the Apache global configuration directives that cPanel & WHM builds by default, use WHM's Global Configuration interface (WHM >> Home >> Service Configuration >> Apache Configuration >> Global Configuration).
To modify the Apache configuration's include files through WHM, use WHM's Include Editor interface (WHM >> Home >> Service Configuration >> Apache Configuration >> Include Editor).
To modify the Apache configuration via the command line interface, create custom configuration files in the
/etc/apache2/conf.d/ directory. Your new configuration files must use the
.conf file extension to ensure that the system will recognize them. Also, your
.conf files must possess
root:root ownership and
After you modify, add, or remove a
You can use the command line interface to add include files that modify the content of the virtual host 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 about how to modify your virtual host containers with include files, read our Modify Apache Virtual Hosts with Include Files documentation.