Page 1 of 1

The web server config file was rewritten!

Posted: Wed Apr 19, 2023 7:15 pm
by gamingtips
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?

Re: The web server config file was rewritten!

Posted: Thu Apr 20, 2023 9:49 am
by myVesta
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.

Re: The web server config file was rewritten!

Posted: Thu Apr 20, 2023 9:16 pm
by gamingtips
Thank you very much.

When backup the server, will the customized web template be saved?

Re: The web server config file was rewritten!

Posted: Thu Apr 20, 2023 9:18 pm
by myVesta
No.
You must transfer template files separately.

Re: The web server config file was rewritten!

Posted: Thu Apr 20, 2023 9:47 pm
by gamingtips
That's pain