Apache config with PLESK and Linux

The configuration files of Apache web server are overwritten by PLESK whenever a domain is added, a domain is deleted, a subdomain is added, or whenever needed, All the Apache config files related or unrelated are overwritten, so if you plan to Modify a domain or subdomain’s config, Plesk gives you the chance to do so by creating a new file and adding the settings to it.

The file you create is not overwritten and is loaded with all the other config files

So

DO NOT edit /home/httpd/vhosts/<domain-name>/conf/httpd.include because this file is overwritten whenever Plesk changes something about apache's config, Rather create the file vhost.conf and/or vhost_ssl.conf with necessary directives in the directory /home/httpd/vhosts/<domain-name>/conf/

For security reasons, only root can create the vhost.conf and vhost_ssl.conf files.

For the changes to take effect, you need to run the following:

/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<domain_name>

The line above tells plesk to add the includes directive into the website’s configuration file, Plesk will probe for the file’s existence before including it.

For sub domains, the file that needs to be created is in

/var/www/vhosts/domain.com/subdomains/<subdomain-name>/conf/vhost.conf

Rules for the domain also apply to the subdomain, But this is particularly useful since plesk allows disabling safe mode for the domain, but not directly for the sub domain, to see how you can disable safe mode for a sub domain see here.