Issue how to edit global custom directives?

sergx

New Pleskian
Server operating system version
almalinux
Plesk version and microupdate number
last
What is the correct procedure to edit the global custom directive files when running Plesk and Almalinux? Any change we make in the conf files is overwritten by Plesk

Any direct changes we make to the configuration files are overwritten by Plesk when it rebuilds the configs. We tried placing our modified directives (e.g. adding reuseport to listen) under:
/usr/local/psa/admin/conf/templates/custom/

This works temporarily, but every time Plesk itself is updated or upgraded, the update fails unless we delete the custom templates first. As a result, our changes are lost after every update.

Is there an official way to add or persist such global nginx directives so they survive config regeneration and Plesk upgrades without breaking the updater?
 
Hi,
instead of deleting the custom templates, leave them in place, if they are no longer valid, they will be moved to to a different folder like...

/usr/local/psa/admin/conf/templates/<random>_broken

So just check for that after an update, if present, then recreate your templates.
In my opinion, Plesk should only warn about custom templates when the default ones have changed,
Anyway, I hope that helps.
Regards

LD
 
Yes, this is how we do it. But if the folder custom exists, Plesk refuses to update unless we delete it and recreate the customs templates.
We need to recréate these custom templetes each time the original templates changes

Is there a solution that doesn't require constant maintenance?
 
You shouldn't need to delete the custom templates unless the templates are not set properly or if there's major changes and if anything like what @LRLD said it should just renamed the custom folder (or you can rename it yourself, there is no need to delete it), then just need to rename it back and update the templates accordingly if need to.
 
Hi:

I have the same error, and i chek the file and is ok:

root@XXXXX:/home/ubuntu# /opt/plesk/php/8.4/bin/php -l /usr/local/psa/admin/conf/templates/custom/server.php
No syntax errors detected in /usr/local/psa/admin/conf/templates/custom/server.php

I only edit this line: sed -i 's|\(%a\) %l %u %t|\1 - %v - %l %u %t|' /usr/local/psa/admin/conf/templates/custom/server.php

Because plesk said this error when i go to update, and is ok the custom?

Thanks!
 
Hi @sergx

I contact with plesk support, and comment me that plesk check update said that error, because onlye check if some files exist in /usr/local/psa/admin/conf/templates/custom/ and not check if is ok the flie and said the error of upgrade.

I recommend to lear before the change in the new version to check if edits some files of you edit in custom.


Thanks!
 
Back
Top