Note

You are viewing the documentation for an older release of Interworx (8.0). To see documentation for the current generally available release of Interworx, click here: 8.2.

How To: Set Domain-level Custom Apache Includes

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:

  1. Log in to the server at the CLI as root, either via SSH or from the terminal

  2. 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}
    
  3. Re-write the vhost, replacing {domain.com} with the domain

    ~iworx/bin/httpd.pex --sync-vhosts --domain {domain.com}
    
  4. 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
    
  5. Restart or reload Apache

    systemctl restart httpd
    

    or

    systemctl reload httpd
    

Creating a Custom Conf File

  1. Log in to the server at the CLI as root, either via SSH or from the terminal

  2. 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 ~]#
    
  3. Using a text editor, create and update the custom .conf file with the desired configuration

  4. Save the file and exit the text editor

  5. Check the Apache syntax

    httpd -t
    
  6. If the output of httpd -t does not show any syntax errors, restart or reload Apache

    systemctl restart httpd
    

    or

    systemctl reload httpd