Author Topic: After update or script update, my conf files of vhosts al revert to default  (Read 16836 times)

0 Members and 1 Guest are viewing this topic.

Offline
**
Since 2 days ago, I have this problem, if execute manually /scripts/update_cwp or simple, wait to anacron execute this, my conf files of my vhosts are revert to default, exact that, If I rebuilt configuration.

This cause to me the lost trafic in 2 nights, because, in my DNS (I use vpn) I have set the ipv6 and in my conf file of vhost I set ipv4 and ipv6 but the dns to my site point to ipv6.

When this update are execute, this files return to stock files and lost all changes, include, my ipv6 add configuration.

A big problem for me because I don't want point to ipv4, I want point to ipv6 like this lasts months...

Offline
***
As reported by CWP team, the solutions is just:
Code: [Select]
rm -f /usr/local/cwp/users/suspended/*.bandwidth
/scripts/cwp_api webservers rebuild_all
The first command remove all bandwidth limits from your sites, and the second rebuil all sites configurations of your webservers.

NOTE: if you customize your webserver configuration, you *must* customize too the webserver templates in "/usr/local/cwpsrv/htdocs/resources/conf/web_servers/", otherwise, they will always be overwritten when CWP is updated.
(check there your webservers files used)

The templates are *always* overwritten when CWP is updated too. So, you *must* to create additional files in that directories, instead to change it.

One way to avoid this customization above (in webserver templates) is to create your custom files directly in 'conf.d' diretories of your webservers, avoiding to change the system config webserver files.

Regards,
Netino
« Last Edit: December 31, 2021, 04:22:04 AM by Netino »

Offline
**
This is something that had never happened until 2 days ago.
First, a CWP update caused a failure in the vhosts (apache, nginx ...) and then, although CPW did not update, at night it always passes the script to check for updates and / or perform the necessary actions.
From then on, my vhost files are restored by default.

As I comment, this had never happened until 2 days ago.

I had modified the vhosts (I use apache) to add my ipv6 as indicated in this thread:
http://forum.centos-webpanel.com/index.php?topic=9935.0


Now it doesn't work, if I run the cwp update script it restores my vhost to default.

The change you mean, I don't know exactly what you mean, is it possible you mean this :?
https://www.mysterydata.com/enable-ipv6-cwp-centos-webpanel/

If so, if there is an update to those template files I will not be knowledgeable and will continue to use my custom template without the new updates / changes coming in.

I am surprised by what happened because of what I said, for months, the vhosts were never restored to default, they always kept the change I made (add my ipv6).

Regards.

Offline
***
You may have had your sites up and running for months with a custom setup, because in no time did you have to rebuild your sites. When you do that, it changes *all* the site settings in apache, and if you made any changes there, you lose them all.

To avoid this, you should configure additional files in the 'conf.d' directories, either from apache or nginx. So when these changes take place, they won't affect the settings in apache/nginx.

If this is not possible, you should make changes to the apache or nginx templates, and apply the template to the respective site. To change the template, as it will also be overwritten by future changes, you must create new template files in their respective directories, and apply the template to the site configuration under "Webservers Domain Config".

Offline
*
Same problem here. It was working great until 3 days back and now its reseting all sites to default everyday. I am trying to figure out how templates working but there is no enough information. I created one template and applied it and rebuilt vhosts but still its taking default configuration. I am using nginx, can anyone give clear guideline on this.

Offline
*
As reported by CWP team, the solutions is just:
Code: [Select]
rm -f /usr/local/cwp/users/suspended/*.bandwidth
/scripts/cwp_api webservers rebuild_all
The first command remove all bandwidth limits from your sites, and the second rebuil all sites configurations of your webservers.

NOTE: if you customize your webserver configuration, you *must* customize too the webserver templates in "/usr/local/cwpsrv/htdocs/resources/conf/web_servers/", otherwise, they will always be overwritten when CWP is updated.
(check there your webservers files used)

The templates are *always* overwritten when CWP is updated too. So, you *must* to create additional files in that directories, instead to change it.

One way to avoid this customization above (in webserver templates) is to create your custom files directly in 'conf.d' diretories of your webservers, avoiding to change the system config webserver files.

Regards,
Netino

We really need clear explanations how to solve this problem permanently. The codes given above are working and the sites are working. But next night it is happening again. So can anyone explain clearly how to solve this for people who are basic level on these issues? Or will be a panel update to fix this problem?

Thanks...

Offline
**
You may have had your sites up and running for months with a custom setup, because in no time did you have to rebuild your sites. When you do that, it changes *all* the site settings in apache, and if you made any changes there, you lose them all.

To avoid this, you should configure additional files in the 'conf.d' directories, either from apache or nginx. So when these changes take place, they won't affect the settings in apache/nginx.

If this is not possible, you should make changes to the apache or nginx templates, and apply the template to the respective site. To change the template, as it will also be overwritten by future changes, you must create new template files in their respective directories, and apply the template to the site configuration under "Webservers Domain Config".

It is correct, during all the time that I have been using CWP I have not had to rebuild the webservers, and yes, I am aware that, when I rebuild, the custom changes disappear, of that I am aware and aware, and as I mentioned, no I had to rebuild once I left everything well configured many months ago.

But .... for 2 or 3 days, rebuild is done automatically when anacron executes the update script, something that did not happen before, and it happens from the problem with the suspended pages ...

Indeed, creating a template, as indicated in the link that I put in my previous post (copy one with another name and customize it as desired) and then rebuild by selecting that new template, will solve the issue that now, all the nights, the automatic rebuild, which there was not before, did not affect my changes.

But what "worries" me is that one day a new change to the templates (in my case apache) will enter and since I am using a custom one, I may not be aware of this possible new change.

Be that as it may, I understand the people who comment on it, this did not happen before, for months, years and so on, now, every day the daily automatic script rebuilds and we lose all the changes made.

Greetings and happy new year.

Offline
*
As reported by CWP team, the solutions is just:
Code: [Select]
rm -f /usr/local/cwp/users/suspended/*.bandwidth
/scripts/cwp_api webservers rebuild_all
The first command remove all bandwidth limits from your sites, and the second rebuil all sites configurations of your webservers.

NOTE: if you customize your webserver configuration, you *must* customize too the webserver templates in "/usr/local/cwpsrv/htdocs/resources/conf/web_servers/", otherwise, they will always be overwritten when CWP is updated.
(check there your webservers files used)

The templates are *always* overwritten when CWP is updated too. So, you *must* to create additional files in that directories, instead to change it.

One way to avoid this customization above (in webserver templates) is to create your custom files directly in 'conf.d' diretories of your webservers, avoiding to change the system config webserver files.

Regards,
Netino

Any way to run this command every hour for example?
Because my websites are blank every day and some times 2 times for day

Offline
*
What a pain in the butt!

For some of us who use nginx as default webserver, there's no such thing as .htaccess. Therefore all redirects, rewrites, etc. have to be written to the vhost conf file. Creating a separate template file for EACH website based on their rewrite/redirect needs seems like too much work to do.

So far, the only viable solution that I've found is to keep a backup copy of the vhosts' conf files and created a script that will run periodically to match md5sums and if some file is different, it replaces the current file with the backup and then reloads nginx.

This update was (from my personal point of view) irresponsible, as it has brought too many issues for server administrators. Rebuilding vhosts should be something that server admins could do if needed, but that wouldn't be done by the update cron.

I'm surprised that no one from CWP has jumped in to explain if this will be a permanent "feature" (not to say a BUG).

Offline
*
This update was (from my personal point of view) irresponsible, as it has brought too many issues for server administrators. Rebuilding vhosts should be something that server admins could do if needed, but that wouldn't be done by the update cron.

I'm surprised that no one from CWP has jumped in to explain if this will be a permanent "feature" (not to say a BUG).

Amen to this.  I've been using CWP Pro for years.  Updates have never completely broken all websites before.

This is a massive bug or a fundamental change in the way the Control Panel is updated.  Either way, the lack of an official statement is troubling...particularly for those of us who pay for the product.

Offline
***
(...)
But what "worries" me is that one day a new change to the templates (in my case apache) will enter and since I am using a custom one, I may not be aware of this possible new change.

Be that as it may, I understand the people who comment on it, this did not happen before, for months, years and so on, now, every day the daily automatic script rebuilds and we lose all the changes made.

If you apply the template to any domain in "Webservers Conf Domain", the future changes in templates will not affect your customization.

Quote
Greetings and happy new year.

Regards, and happy new year!

Offline
***
Any way to run this command every hour for example?
Because my websites are blank every day and some times 2 times for day

Surely.
But the problem is supposed to be solved, with that command, after 'update_cwp' command.
So, must be issued three commands, as root user:
Code: [Select]
# /scripts/update_cwp
# rm -f /usr/local/cwp/users/suspended/*.bandwidth
# /scripts/cwp_api webservers rebuild_all

The new and updated version of CWP is supposed to solve the problem.
If you have problems in the execution of these commands, may be you need to update Ioncube loader:
Code: [Select]
# /scripts/update_ioncube

To put the commands after daily update, you can add he commands to the file '/etc/cron.daily/cwp'.
To run hourly, put the cwp file above in '/etc/cron.hourly/'.

Offline
***
What a pain in the butt!

For some of us who use nginx as default webserver, there's no such thing as .htaccess. Therefore all redirects, rewrites, etc. have to be written to the vhost conf file. Creating a separate template file for EACH website based on their rewrite/redirect needs seems like too much work to do.

So far, the only viable solution that I've found is to keep a backup copy of the vhosts' conf files and created a script that will run periodically to match md5sums and if some file is different, it replaces the current file with the backup and then reloads nginx.

You can use the following command to freeze the any regular file, preventing any changes in it:
Code: [Select]
# chattr +i /path/to/file
Use it in a controlled way, knowing when to remove the immutability of the file, for example, when you need to change it.

When you want to change that file, just issue the command:
Code: [Select]
# chattr +e /path/to/file

Offline
**

If you apply the template to any domain in "Webservers Conf Domain", the future changes in templates will not affect your customization.
Yes, at this moment I have it like this, so I have had to do so as not to lose my custom configurations (such as ipv6) but I fully agree with what colleagues have commented in previous posts.

Regards!

Offline
*
What a pain in the butt!

For some of us who use nginx as default webserver, there's no such thing as .htaccess. Therefore all redirects, rewrites, etc. have to be written to the vhost conf file. Creating a separate template file for EACH website based on their rewrite/redirect needs seems like too much work to do.

So far, the only viable solution that I've found is to keep a backup copy of the vhosts' conf files and created a script that will run periodically to match md5sums and if some file is different, it replaces the current file with the backup and then reloads nginx.

You can use the following command to freeze the any regular file, preventing any changes in it:
Code: [Select]
# chattr +i /path/to/file
Use it in a controlled way, knowing when to remove the immutability of the file, for example, when you need to change it.

When you want to change that file, just issue the command:
Code: [Select]
# chattr +e /path/to/file

The right command to be able to edit the file again would be:

Code: [Select]
# chattr -i /path/to/file

The "+e" switch is related to extents...

As to why I went the "script way" is because if something "changes" in the way nginx is set up (like for instance, where the private keys and certs are stored), I always have a "backup file" to compare and diff.