Author Topic: Conf files reset problem  (Read 9299 times)

0 Members and 5 Guests are viewing this topic.

Offline
*
Conf files reset problem
« on: January 01, 2022, 04:34:42 AM »
Hi,

I am editing and using vhost conf files (/usr/local/apache/conf.d/vhosts) of some websites on my server. However, on certain dates, all conf files are reset and all the edits I have made are deleted.

What task triggers this reset? How can I disable this?



Thanks in advance for your help.

Offline
***
Re: Conf files reset problem
« Reply #1 on: January 01, 2022, 10:36:37 PM »
Hi,

I am editing and using vhost conf files (/usr/local/apache/conf.d/vhosts) of some websites on my server. However, on certain dates, all conf files are reset and all the edits I have made are deleted.

What task triggers this reset? How can I disable this?
(image)
Thanks in advance for your help.

You must avoid to change directly the vhosts/*.conf files.
They will always overwritten always the webservers must be rebuilt.
I a recent update of CWP was needed to rebuild the webservers.
Instead of to change directly the vhosts conf files, you must create additional custom templates, simply copying and change them.
After that, you must apply the customized template to you site in CWP, "WebServers Domain Conf".

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 per-si are *always* overwritten when CWP is updated too. So, you *must* to create additional files in that directories, instead to change it.
Copy an existant file, change the name of the file, one for .conf and another for .ssl.conf (always two files, obligatorily). This is needed to the template is showed in the "WebServers Domain Conf".

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. You can use it, if possible.

The triggers are the rebuild of the WebServers.
Possibly, the update_cwp routine now is rebuilding the Webservers daily.
It is in a cron file: /etc/cron.daily/cwp

Regards,
Netino

Offline
*
Re: Conf files reset problem
« Reply #2 on: January 02, 2022, 09:17:44 AM »
Hi,

I am editing and using vhost conf files (/usr/local/apache/conf.d/vhosts) of some websites on my server. However, on certain dates, all conf files are reset and all the edits I have made are deleted.

What task triggers this reset? How can I disable this?
(image)
Thanks in advance for your help.

You must avoid to change directly the vhosts/*.conf files.
They will always overwritten always the webservers must be rebuilt.
I a recent update of CWP was needed to rebuild the webservers.
Instead of to change directly the vhosts conf files, you must create additional custom templates, simply copying and change them.
After that, you must apply the customized template to you site in CWP, "WebServers Domain Conf".

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 per-si are *always* overwritten when CWP is updated too. So, you *must* to create additional files in that directories, instead to change it.
Copy an existant file, change the name of the file, one for .conf and another for .ssl.conf (always two files, obligatorily). This is needed to the template is showed in the "WebServers Domain Conf".

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. You can use it, if possible.

The triggers are the rebuild of the WebServers.
Possibly, the update_cwp routine now is rebuilding the Webservers daily.
It is in a cron file: /etc/cron.daily/cwp

Regards,
Netino

First of all, thank you very much for your help.

As I understand it;

I created a template via WebServers Template Editor. I associated it with the relevant website via WebServers Domain Conf and rebuild the vhosts file. Everything looks normal now.

When an update is released, the vhosts file will be created over the template I specified, so I will not have the same problem. I hope I understood correctly.

Best regards.

Offline
*
Re: Conf files reset problem
« Reply #3 on: January 02, 2022, 02:46:58 PM »
you need to create your own new vhost template and you will not have issue.
http://wiki.centos-webpanel.com/webservers-vhost-templates
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: Conf files reset problem
« Reply #4 on: January 03, 2022, 09:31:29 AM »
I sincerely appreciate all the people offering advice.  Unfortunately, nothing is working.  Every night between 3am and 4am (my time), all of my websites get knocked offline with the "Suspended Account" message.

I tried setting up custom vhost templates but the problem just happened again.

The following advice provided does fix the problem, but it doesn't "stick" and I have to repeat it every night:
Code: [Select]
/scripts/update_cwp
rm -f /usr/local/cwp/users/suspended/*.bandwidth
/scripts/cwp_api webservers rebuild_all

Honestly, I'm exhausted from having to be awake at 3am for the past four nights just to keep my websites online.  So, it's certainly possible that I did something wrong when I set up the vhost files.

As I noted elsewhere, I've been using CWP Pro for years.  I've never had to make changes to my servers any time an update happened...let alone needing to do it every single night just to stay online.

The lack of guidance and a permanent fix from the folks running CWP is rather shocking.

Offline
*
Re: Conf files reset problem
« Reply #5 on: January 03, 2022, 10:29:10 AM »
I opened a ticket with CWP support right now and I wrote them:
" I do not understand why was all working great and fine for years with your CPW (and I never modified any Vhost configuration in my server), and now starting from 30th of december 2021 all the nights between 3am and 4am all my customized conf files are resetting to default."
and they answered me:
"yes because of CWP security and integrity and hardened and improved quota system, from this point the CWP files will get reset on every update and to retain the user side changes you've to have templates.
Regards"

Offline
*
Re: Conf files reset problem
« Reply #6 on: January 03, 2022, 01:54:31 PM »
Not going to solve your problems but could help your sleep:

I have adjusted /etc/anacrontab to have:

START_HOURS_RANGE=9-22

That way it won't run in the middle of the night with surprise alarms or errors before you are in the office!  I think the standard is hours "3-22"  thus your 3-4am wake up call.


Offline
*
Re: Conf files reset problem
« Reply #7 on: January 03, 2022, 03:49:50 PM »
the main issue many do wrong is by editing vhost files directly.
You can't do that! If you plan to do something custom then you need to make own custom vhosts templates.

Info
http://wiki.centos-webpanel.com/webservers-vhost-templates
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: Conf files reset problem
« Reply #8 on: January 03, 2022, 07:49:00 PM »
I opened a ticket with CWP support right now and I wrote them:
" I do not understand why was all working great and fine for years with your CPW (and I never modified any Vhost configuration in my server), and now starting from 30th of december 2021 all the nights between 3am and 4am all my customized conf files are resetting to default."
and they answered me:
"yes because of CWP security and integrity and hardened and improved quota system, from this point the CWP files will get reset on every update and to retain the user side changes you've to have templates.
Regards"

Thank you for sharing.  I do appreciate it.

This makes me absolutely enraged.  They make a fundamental change that completely alters the way CWP works without notifying their clients in advance.  Then, they seem to not care that they created a massive ongoing problem for some of us.

Not going to solve your problems but could help your sleep:

I have adjusted /etc/anacrontab to have:

START_HOURS_RANGE=9-22

That way it won't run in the middle of the night with surprise alarms or errors before you are in the office!  I think the standard is hours "3-22"  thus your 3-4am wake up call.

Thank you.  I'll look at this.  I've literally not had any "normal" sleep since this debacle started.

the main issue many do wrong is by editing vhost files directly.
You can't do that! If you plan to do something custom then you need to make own custom vhosts templates.

Info
http://wiki.centos-webpanel.com/webservers-vhost-templates

I'm not like many of you in that I don't set up website regularly.  I set up each of my servers once...years ago.  I haven't added a site since nor made any changes to wbat I have.  As such, this aspect of how all of this works is "new" to me.  (Plus, I'm exhausted from lack of sleep.)

At this point, I don't even know if I ever altered the default vhosts.  I lterally run the "rebuild_all" code I posted and nothing else to fix the problem.  I'm not making any other edits to the default files.

I'm at a loss as to how to permanently fix the problem.  I did try to follow the link you provided.  But, I must have missed a step.  (Seriously, though, thank you for trying to help us.) 

-----

Can anyone provide screenshots of what the WebServers Main Conf (and any other pages on CWP) is supposed to look like to fix this problem?  If I have an end-goal, I might be able to work backwards.

Or, maybe a more detailed tutorial.

I'm running Apache only, if that matters.


Offline
***
Re: Conf files reset problem
« Reply #9 on: January 03, 2022, 11:12:36 PM »
(...)
Can anyone provide screenshots of what the WebServers Main Conf (and any other pages on CWP) is supposed to look like to fix this problem?  If I have an end-goal, I might be able to work backwards.

Or, maybe a more detailed tutorial.

I'm running Apache only, if that matters.

The menu "WebServers Settings", "WebServers Main Conf" serves to configure the configuration of all domains on your server.
The menu "WebServers Settings", "WebServers Domain Conf" serves to define the individual configuration of each domain.
Each one depends on how your site will work.
But it all depends on how your webserver is configured.
What is your configuration in "WebServers Settings", "Select WebServers"...?

Offline
*
Re: Conf files reset problem
« Reply #10 on: January 04, 2022, 05:40:17 AM »
Thanks for responding.

WebServer Settings --> Select WebServers:
Apache Only



WebServer Settings --> WebServers Main Conf:
Apache default vhost template type: Default
Apache default vhost template: cloned_default*
Apache default vhost template: not installed
Apache default PHP-FPM template: cloned_all_methods*
PHP-FPM default template: cloned_default*

* These "cloned" files are copies of the templates from when the server is working properly.



WebServer Settings --> WebServers Domain Conf --> username selected --> domain selected --> View/Edit Configuration

Configuration --> Web server Configuration dataserver11.com
Please Select: apache -> php-cgi

Apache Configuration
Apache default vhost template type: default
Apache default vhost template type: cloned_all_methods*



-----

Maybe what I did above will work.  I will report back if my sites get auto-suspended again at some point in the next 24 hours.

Offline
*
Re: Conf files reset problem
« Reply #11 on: January 05, 2022, 06:30:42 AM »
I got same problem. I didn't know why CWP do that. Why CWP run the cronjob reset to default? If CWP wanna we do not change it manual, oh please lock it! But if we can change that, please leave it alone! Don't do the nightmare at 3:50am, CWP change it back to default. WHY?

Offline
*
Re: Conf files reset problem
« Reply #12 on: January 05, 2022, 04:59:08 PM »
Thanks for responding.

WebServer Settings --> Select WebServers:
Apache Only



WebServer Settings --> WebServers Main Conf:
Apache default vhost template type: Default
Apache default vhost template: cloned_default*
Apache default vhost template: not installed
Apache default PHP-FPM template: cloned_all_methods*
PHP-FPM default template: cloned_default*

* These "cloned" files are copies of the templates from when the server is working properly.



WebServer Settings --> WebServers Domain Conf --> username selected --> domain selected --> View/Edit Configuration

Configuration --> Web server Configuration dataserver11.com
Please Select: apache -> php-cgi

Apache Configuration
Apache default vhost template type: default
Apache default vhost template type: cloned_all_methods*



-----

Maybe what I did above will work.  I will report back if my sites get auto-suspended again at some point in the next 24 hours.

Where you working this morning?

Offline
*
Re: Conf files reset problem
« Reply #13 on: January 05, 2022, 07:43:40 PM »

I don't know if anything has been resolved.  I've been manually changing the active hours in the etc/anacrontab file like kadybee mentioned because I hadn't had time to work on this project.

I think I'll have time to troubleshoot tonight.  If I do, I'll change the active hours and monitor my servers to see if the problem reoccurs.

Offline
*
Re: Conf files reset problem
« Reply #14 on: January 05, 2022, 08:36:06 PM »

I don't know if anything has been resolved.  I've been manually changing the active hours in the etc/anacrontab file like kadybee mentioned because I hadn't had time to work on this project.

I think I'll have time to troubleshoot tonight.  If I do, I'll change the active hours and monitor my servers to see if the problem reoccurs.

I changed my hours as well. One server went down in the last hour but I didn't do all the steps you did yet. I have another server that is fine all except for one host file that went it gets reset is goes down. Waiting for another server to go down any minute now.

What a freaking pain.