Configuring vhosts the right way on Plesk

Plesk warns you, emphatically, not to mess with the auto-generated conf/httpd.include:

# ATTENTION!
# DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN IMPROPER PLESK
# FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU REQUIRE CUSTOM
# MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM THEM IN THE
# FOLLOWING FILE(S):
# /var/www/vhosts/yourdomain.com/conf/vhost.conf
# /var/www/vhosts/yourdomain.com/<subdomain-name>/conf/vhost.conf

Believe them. As tempting as it is to just put your customizations into that, don’t. Plesk will overwrite that file if you’re not careful (and yes, I found out the hard way).

So indeed, put your customizations into conf/vhost.conf as it recommends. But just creating the file isn’t enough, you also have to notify Plesk that it’s there as described here, then just bounce Apache.

# /usr/local/psa/admin/bin/websrvmng -a

(Feature request for Plesk: create an empty vhost.conf by default and include it so it’s ready to go).

Leave a comment

Your email address will not be published. Required fields are marked *