Apache configuration directives have certain contexts associated with them. The contexts that are associated with a directive determine where a directive can exist. You can read more about contexts in the Apache documentation.
There are some Apache directives that need to be set within the virtualhost context. If you need to add a directive to the virtualhost context, you would need to use the method described in this article to do so.
This method is based on the following documentation:
- Log in to the server via SSH as the root user.
- Issue the following commands, replacing CPANELUSERNAME and DOMAIN.TLD as appropriate for your situation. The username and domain portion are in all capital letters in this example to highlight what needs to be changed, but make sure to use all lowercase letters when running the commands on your server:
mkdir -p /etc/apache2/conf.d/userdata/ssl/2_4/CPANELUSERNAME/DOMAIN.TLD/
mkdir -p /etc/apache2/conf.d/userdata/std/2_4/CPANELUSERNAME/DOMAIN.TLD/
- Edit the newly created files so they contain your desired directives.
- Rebuild the Apache configuration to add the includes with this command:
- Restart Apache so it reads the new configuration: