New in CWP Edge / LTSFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers. Available now in the Edge-Latest and LTS-Stable versions. Discuss in the forum

LSPHP / Cache ›
CWP Secure KernelKernel-level protectionEvery site in its own sandbox

Every PHP site, cron job and SSH session runs in its own profile that the kernel enforces. A hacked WordPress cannot read other accounts’ files, and crypto miners and unexpected processes are stopped. Discuss in the forum

Secure Kernel ›
CWP DataCenter PanelFree for CWPpro serversAll your servers on one screen

Manage all your CWP servers from one panel: live health, every hosting account, CWP and OS updates on many servers at once, backups, SSL, firewall and Telegram alerts. Discuss in the forum

DataCenter Panel ›
CWP Backup ServerFree for CWPpro serversBackups that ransomware cannot reach

Protected backups of all your CWP servers on a separate machine. Snapshots a hosting server cannot delete, and restore of files, databases, mail and whole accounts in the admin and user panel. Discuss in the forum

Backup Server ›
WordPress ManagerIncluded & freeWordPress managed from the panel

Install, secure, update, back up and clone WordPress sites without FTP. Updates are tested on a staging clone first and applied to the live site only when they pass, with a backup taken first. Discuss in the forum

WordPress Manager ›
CWP CageIsolationEvery account in its own cage

Per-account isolation built from Linux namespaces and cgroups. A break-in or a runaway script on one site cannot reach another account, the panel or the rest of the server; resource limits per hosting package. Discuss in the forum

CWP Cage ›
Script InstallerOne-click appsWordPress, Joomla, Moodle and more in one click

CWP’s own script installer in the user panel: pick an app, choose the domain and folder, and it is live in seconds with its database and admin login created automatically. Ready for LSPHP and LSAPI-Cache. Discuss in the forum

Script Installer ›
DNS ClusterFor every control panelOne DNS cluster for all your servers

Your servers keep creating domains as usual; the zones are collected into one authoritative PowerDNS cluster you control, with DNSSEC, roles and a full activity trail. Accepts CWP, cPanel, Plesk, DirectAdmin and BIND. Discuss in the forum

DNS Cluster ›
CWP BillingFree to useBilling and support system for hosting providers

Clients, services, invoices, payments, domains, server provisioning and support tickets in one place. All gateways, server modules and registrars are free, with free migration from WHMCS, ClientExec and Blesta. Discuss in the forum

CWP Billing ›
CWPproFrom $1.49 per monthEvery CWP feature unlocked

CWPpro is the professional version of Control Web Panel: all features, unlimited accounts, the latest CWP version and security fixes first. $1.49 per month or $11.99 per year. Discuss in the forum

Get CWPpro ›

Conf files reset problem

Started by rklendes, January 01, 2022, 04:34:42 AM

Previous topic - Next topic

rklendes

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.

Netino

Quote from: rklendes 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?
(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

rklendes

Quote from: Netino on January 01, 2022, 10:36:37 PM
Quote from: rklendes 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?
(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.

studio4host

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.

writerguyfl

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:
/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.

gotracker

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"

kadybee

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.


studio4host

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.

writerguyfl

Quote from: gotracker 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"

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.

Quote from: kadybee 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.

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

Quote from: studio4host 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

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.


Netino

Quote from: writerguyfl on January 03, 2022, 07:49:00 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"...?

writerguyfl

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.

tdn2kit

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?

mgworek

Quote from: writerguyfl 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.

Where you working this morning?

writerguyfl

Quote from: mgworek on January 05, 2022, 04:59:08 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.

mgworek

Quote from: writerguyfl on January 05, 2022, 07:43:40 PM
Quote from: mgworek on January 05, 2022, 04:59:08 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.