The web server config file was rewritten!

Post Reply
gamingtips
Posts: 4
Joined: Mon Jul 25, 2022 8:24 pm

Hello,

I added my code to the file /home/admin/conf/web/mydomain.com.apache2.ssl.conf but for some reason, the file will be automatically rewritten randomly and my code will be removed. My code is reverse proxy configuration code.

Not sure when the issue will happen yet. maybe when system update, maintenance, etc.

How to solve this problem?
User avatar
myVesta
Site Admin
Posts: 825
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 5 times
Been thanked: 6 times

Put your custom code in template files.
You can find template files in folder:

Code: Select all

/usr/local/vesta/data/templates/web/apache2/
Or better idea, copy existent template (for example: PHP-FPM-74.tpl, PHP-FPM-74.stpl, PHP-FPM-74.sh) to your own template files (for example: MY-74.tpl, MY-74.stpl, MY-74.sh).
Then put that Apache template (MY-74) to your domain.

If you sometimes change your template, you can rebuild Apache .conf files by typing:

Code: Select all

sudo /usr/local/vesta/bin/v-rebuild-web-domains yourMyVestaUser
That's better than changing .conf files manually.
gamingtips
Posts: 4
Joined: Mon Jul 25, 2022 8:24 pm

Thank you very much.

When backup the server, will the customized web template be saved?
User avatar
myVesta
Site Admin
Posts: 825
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 5 times
Been thanked: 6 times

No.
You must transfer template files separately.
gamingtips
Posts: 4
Joined: Mon Jul 25, 2022 8:24 pm

That's pain
Post Reply