How To: Set Domain-level Custom Apache Includes¶
Contents
Enabling Custom Apache Includes for the Domain¶
By default, domain-level custom Apache Includes are disabled in the domain’s vhost.
If custom Includes are disabled, the vhost will include the following lines, under both the port 80 and port 443 sections (if applicable):
# Custom Includes disabled for this domain
# Custom Includes can only be enabled by the server administrator
To enable custom Apache Includes for the domain:
Log in to the server at the CLI as root, either via SSH or from the terminal
Run the following command, replacing
{domain.com}with the domain/home/interworx/bin/config.pex --set --name "HTTPD_USE_CUSTOM_INCLUDE" --value "1" --domain {domain.com}
Re-write the vhost, replacing
{domain.com}with the domain~iworx/bin/httpd.pex --sync-vhosts --domain {domain.com}
Check the vhost. It should include the following line, under both the port 80 and port 443 section (if applicable).
{unixuser}``and ``{domain.com}will reflect the corresponding information:IncludeOptional /home/{unixuser}/var/{domain.com}/apache/*.conf
Restart or reload Apache
systemctl restart httpd
or
systemctl reload httpd
Creating a Custom Conf File¶
Log in to the server at the CLI as root, either via SSH or from the terminal
Navigate to the domain’s apache directory. It is located at
/home/{unixuser}/var/{domain.com}/apache/*.conf, replacing{unixuser}and{domain.com}with the corresponding information.cd /home/{unixuser}/var/{domain.com}/apache/*.conf
By default, this directory is empty. Example:
[root@server ~]# ls -la /home/examplec/var/example.com/apache/ total 0 drwx--s--x 2 iworx iworx 6 Apr 20 11:43 . drwx--x--x 13 iworx iworx 189 Apr 29 10:43 .. [root@server ~]#
Using a text editor, create and update the custom .conf file with the desired configuration
Save the file and exit the text editor
Check the Apache syntax
httpd -t
If the output of
httpd -tdoes not show any syntax errors, restart or reload Apachesystemctl restart httpd
or
systemctl reload httpd