This guide will explain how to add additional Apache directives server wide using SSH terminal.
Let us follow the steps-
- Access the SSH terminal.
- Generate a configuration file for the directives-
- Debian-based OS (e.g. Debian, Ubuntu)-
# vi /etc/apache2/conf-enabled/zz011_custom_directives.conf - RHEL-based OS (e.g. RedHat, CentOS)-
# vi /etc/httpd/conf.d/zz011_custom_directives.conf
Important- As Apache loads configuration files alphabetically; ensure that the custom configuration file overwrites any values managed by Plesk by naming it, for instance, as “zz011_custom_directives.conf” to load it after “zz010_psa_httpd.conf”.
- Debian-based OS (e.g. Debian, Ubuntu)-
- Add the chosen Apache directives to the recently generated file and then “Save” the changes.
- To check whether the Apache configuration is right, run the following command-
# apachectl configtest
The predicted output is-
# Syntax OK - Now, restart Apache by running the below command-
- Debian-based OS-
# systemctl restart apache2 - RHEL-based OS-
# systemctl restart httpd
- Debian-based OS-
This way, you can use Plesk to add additional Apache directives server wide. Hope you liked our article.