Child pages
  • Modify Virtualhost Containers With Include Files
Skip to end of metadata
Go to start of metadata

Overview

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. 

You must create the directories and the include files for this type of configuration. For information on the directives that you can add to the virtualhost containers in your Apache configuration, read Apache's documentation for your version of Apache:

Important:

  • Includes are the last directives in each virtualhost container. A directive or value that is in an include file will override any value that exists in the primary configuration file.
  • If you use an include that requires a specific Apache version, and you change to a different Apache version, the Apache configuration will ignore the include file.
  • If you wish to change the content of all future virtualhost containers that cPanel & WHM creates for accounts, read our Custom Templates documentation.

Warning:

Currently, EasyApache 3 is no longer in development and only receives security updates. EasyApache 3 is tentatively scheduled for deprecation at some point in 2018. You will receive at least three months notification prior to official deprecation. After that time, EasyApache 3 will no longer receive any updates. For more information, read our cPanel Long-Term Support documentation.

We strongly recommend that you upgrade to EasyApache 4. For more information, read our EasyApache 4 documentation. 

Featured documentation

  EasyApache 3

IntroductionFAQ

Change Log Release Notes  

ProfilesCustomization

Tomcat

Migrate from Tomcat 5.5 to 7

How to Deploy Java Applications

Important:

EasyApache 3 does not support Tomcat for new installations. EasyApache 4 does not support Tomcat and we do not plan to provide support in the future. 

Include file structure

The following table includes the directory structure that you must use to create an include file for an individual domain:

Important:

  • Replace $user with the username of the account.
  • Replace $domain with the domain name.
  • Replace $includename.conf with the name of the file that you wish to include.
DescriptionApplies to specific Apache versionApplies to SSL virtualhosts?Directory structure and filename
To apply to an individual virtualhost

2.2With SSL/usr/local/apache/conf/userdata/ssl/2_2/$user/$domain/$includename.conf
Without SSL/usr/local/apache/conf/userdata/std/2_2/$user/$domain/$includename.conf
2.4With SSL/usr/local/apache/conf/userdata/ssl/2_4/$user/$domain/$includename.conf
Without SSL/usr/local/apache/conf/userdata/std/2_4/$user/$domain/$includename.conf
To apply to all virtualhosts2.2 and 2.4With and without SSL

/usr/local/apache/conf/userdata/$includename.conf

With SSL/usr/local/apache/conf/userdata/ssl/$includename.conf
Without SSL/usr/local/apache/conf/userdata/std/$includename.conf
2.2With SSL/usr/local/apache/conf/userdata/ssl/2_2/$includename.conf
Without SSL/usr/local/apache/conf/userdata/std/2_2/$includename.conf
2.4With SSL/usr/local/apache/conf/userdata/ssl/2_4/$user/$includename.conf
Without SSL/usr/local/apache/conf/userdata/std/2_4/$user/$includename.conf
To apply to all virtualhosts for a specific user

 

2.2With SSL

/usr/local/apache/conf/userdata/ssl/2_2/$user/$includename.conf

Without SSL/usr/local/apache/conf/userdata/std/2_2/$user/$includename.conf
2.4With SSL/usr/local/apache/conf/userdata/std/2_4/$user/$includename.conf
Without SSL/usr/local/apache/conf/userdata/std/2_4/$user/$includename.conf