QuestionHow to add additional Apache directives by service plan or globally, so that these directives will not be overwritten by an update?AnswerThe following steps apply to each Service Plan individually. For server wide solution follow the steps from the SSH Terminal section below:1.Log into Plesk2.Go to Service Plans > Example Plan > Web Server > Additional Apache directives3.Enter the desired directives in the Additional directives for HTTP and Additional directives for HTTPS fields4.Scroll down and click on Update & SyncNote: All newly created domains will receive the specified settings. Existing domains will not be updated. Additional directives set for already existing domains should be changed on a per-domain basis. SSH Terminal - Server wide solution1.Connect to the server via SSH2.Create a configuration file for the directives:- Debian-based OS (e.g. Ubuntu, Debian):
# vi /etc/apache2/conf-enabled/zz011_custom_directives.conf- RHEL-based OS (e.g. CentOS, RedHat):
# vi /etc/httpd/conf.d/zz011_custom_directives.confNote: Apache loads configuration files in alphabetical order, so if it's required to overwrite some values managed by Plesk, make sure the new custom config file is loaded after zz010_psa_httpd.conf. For example by naming it as zz011_custom_directives.conf3.Add the desired Apache directives to the newly created file and save the changes4.Check if the Apache configuration is correct by executing this command:# apachectl configtestExpected output:# Syntax OK5.Restart Apache by executing this command:Debian-based OS:# systemctl restart apache2[/li]
RHEL-based OS:# systemctl restart httpd