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

0 Members and 1 Guest are viewing this topic.

Offline
***
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...

You are right. Sorry for confusion.

Quote
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.
Yes, this is the method I use to check diffs. But I do it with a script, because this is a headache and this would be too much more headache to make it manually.
And I assure to you these templates change over time.

Offline
*
Not sure why the CWP team is quite about this
I'm also having this issue across 6 servers.

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

Today already have this issue 4 times.
I can't fix it, already talk with support and the problem remains

Offline
*
Not sure why the CWP team is quite about this
I'm also having this issue across 6 servers.

It's insane, isn't it?  Having to be awake in the middle of the night...every night...to manually unsuspend all of my servers because of a bug or a change in the way CWP updates is asinine.

Offline
*
you need to use make all configurations in custom vhost templates...info about this is on cwp wiki.
Manual changes in the path or anything else in the vhost files are BAD and you should never do it.
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
*
you need to use make all configurations in custom vhost templates...info about this is on cwp wiki.
Manual changes in the path or anything else in the vhost files are BAD and you should never do it.

A template is supposed to be something that you can use several times and that just gets the "custom" info replaced... or at least, that's what I understand for "template". When you have to create a "template" for each and every single site that uses a custom rewrite, redirect, directive, etc. then it's a custom config, not a template.

The RIGHT way for it to work (hope CWP staff reads this) is to:

1. Have a templates section as it is right now.
2. Have a CUSTOM CONFIG section for each website.
3. Have the vhosts "builder" load the template, replace the "regular" info, check if there's  a custom config for this website and if there is, then include such config in the vhost config file.

Offline
*
Guys, i resolved this by setting custom configuration. this might help someone.

1. Create Template by going into > WebServers Template Editor > Create file > select Template type vhost > type any name for file > paste your custom file code

2. Go to WebServers Domain Conf > select domain or subdomain > Create configuration > Select nginx -> proxy > Select custom file you created in "Nginx default vhost template"

3. Add custom port or simply add 80

4. Save it and restart nginx

Please note, i am using only nginx.

Offline
***
(...)
A template is supposed to be something that you can use several times and that just gets the "custom" info replaced... or at least, that's what I understand for "template". When you have to create a "template" for each and every single site that uses a custom rewrite, redirect, directive, etc. then it's a custom config, not a template.

The RIGHT way for it to work (hope CWP staff reads this) is to:

1. Have a templates section as it is right now.
2. Have a CUSTOM CONFIG section for each website.
3. Have the vhosts "builder" load the template, replace the "regular" info, check if there's  a custom config for this website and if there is, then include such config in the vhost config file.

I have customizations in '/usr/local/apache/conf.d', for example, and all of them was preserved with the rebuild of the webservers, without any templates.
But you can do it too in nginx, if needed.
It depends of your preferences.

Offline
*
Hello everyone,

I'm following all the threads reporting this issue (vhosts overwritten with default values, page suspended) since Dec 30. For my server, the overwritting happens at 3:00 am, so fifteen minutes later, a cron job restore vhosts/ from backup and reload apache to recover the websites.
However, I was specting a better/more formal solution, maybe a patch, coming from the CWP team. All the solutions proposed in the forum are hacks, not real solutions. If I'm missing something, the proper solution, can anyone please point me what's the correct fix for this problem?

Thanks in advance :-)

Offline
***
Hello everyone,

I'm following all the threads reporting this issue (vhosts overwritten with default values, page suspended) since Dec 30. For my server, the overwritting happens at 3:00 am, so fifteen minutes later, a cron job restore vhosts/ from backup and reload apache to recover the websites.
However, I was specting a better/more formal solution, maybe a patch, coming from the CWP team. All the solutions proposed in the forum are hacks, not real solutions. If I'm missing something, the proper solution, can anyone please point me what's the correct fix for this problem?

Thanks in advance :-)

The CWP dashboard now rebuilds all sites daily.
This means that if you have any previous customizations, you cannot do them directly in the Apache server configuration files.
You must create the customizations only in cloned template files for this purpose.
You did it?
What types of customization have you done?

Offline
*
The CWP dashboard now rebuilds all sites daily.
This means that if you have any previous customizations, you cannot do them directly in the Apache server configuration files.
You must create the customizations only in cloned template files for this purpose.
You did it?
What types of customization have you done?

Did you read all previous posts? A template shouldn't be something that needs to be created for each website, the definition of "template" in computing is:

a preset format for a document or file, used so that the format does not have to be recreated each time it is used.

So if we need to create a "template" for each website, then it's not a template, but a custom config.

There might be a thousand ways to go around this BUG, but the main purpose of this (and any) community forum is to get feedback so you can create a better product.

My scripting solution works for me, I can go to bed right now knowing that the websites will be up and running 24/7 (I even added a custom check that runs every minute, so the longest the websites can remain offline is 59 seconds)... But it's a hack, it's not a real solution.

 I even created a crack for CWP that could allow me to use Pro features without a Pro license (never released it and I am paying for my pro licenses), so the fact that something "can be done" doesn't mean that it "should be done"... or at least, that by doing things a specific way doesn't imply that it's the right way to do them.

Again, my hack works... but I have mixed feelings about having to do some custom coding to go around a bug that wasn't there... if CWP had rebuilt vhosts from the beginning, then it would be my choice to do some custom coding, go the "cwp way" or install another panel. But the fact that this "feature" (a.k.a. "bug") appeared out of nowhere with the last update and without any previous notice is what troubles me.


Offline
*
I agree, this whole situation cannot be happening.

At the momment I got 2 servers with 6 frontends and 14 backends.. the template "solution" is just a temp workaround to a problem introduced with no notice whatsoever but I'm not willing to make a template for each of the projects on my server. That defeats the whole purpose of a template.
Making modifications to vhosts is a pretty common practice. Even CWP "allowed" it for years.

We know it's gonna be reset whenever apache is rebuilt, but first, apache shouldn´t be rebuilt by an update or at least not without a big ass notice prior to the update and second we as admins have the meanings to restore them whenever we manually rebuild it.

For now, I'm just restoring my vhosts everyday in hopes that they fix this bug, but things like this makes me consider dropping CWP for anything else more reliable and transparent. I understand you need to make money with the paid support, but staying radio silent won´t do any good.

Offline
*
The CWP dashboard now rebuilds all sites daily.
This means that if you have any previous customizations, you cannot do them directly in the Apache server configuration files.
You must create the customizations only in cloned template files for this purpose.
You did it?
What types of customization have you done?

Hello Netino,

Sorry the delay. I'm not the one who add domains to CWP, and I don't know exactly whats the procedure that my partners follow. I tried yesterday to edit a domain using the "select template" method, and it seems that the nightly rebuild keep the changes and the site is still working.

To summarize (please, correct me if I misunderstand): I have to create a template for every site that has a configuration detail. For example, if I don't want to have webmail support for a site, I have to create a template for that. If a site should not have "AllowOverride All", it is necessary to create a template for that. And so on. Like seati pointed before, it is necessary to have a template for every difference that a site has with another site in the same server. Right? So when CWP does the automatic vhosts rebuild, the sites keep up and running.

I have hundreds of domains in the server. It will be a lot of work and testing to create a template for each one. Is there any workaround? Can this rebuild process be stopped or masked somehow? Is it possible to protect the configurations until we move to the "template" method?

Thank you for your help.


Offline
*
I have extra information that forgot to add.

In the CWP installation that we use, when a new domain is added, it uses a default configuration for webserver in vhosts. That default configuration leaves the new domain working without issues. At night, that same configuration is overriden by the "rebuild vhosts" script, using the "suspended" template. I'm not sure, but it looks like there is a bug somewhere. If a website is added through CWP, and this website is running when finished, it shouldn't be disabled when this "vhosts rebuild" takes place at night.

Thanks for your help.

Offline
***
(...)
Did you read all previous posts? A template shouldn't be something that needs to be created for each website, the definition of "template" in computing is:
a preset format for a document or file, used so that the format does not have to be recreated each time it is used.
So if we need to create a "template" for each website, then it's not a template, but a custom config.

But you don't have to create a new template for each site!
You can create just one template for all other sites.
So you set and use the same template for that customized sites.
You only need to create a new template just when you have a new type of customization. For a new site, or new group of sites.

Quote
(...)
Again, my hack works... but I have mixed feelings about having to do some custom coding to go around a bug that wasn't there... if CWP had rebuilt vhosts from the beginning, then it would be my choice to do some custom coding, go the "cwp way" or install another panel. But the fact that this "feature" (a.k.a. "bug") appeared out of nowhere with the last update and without any previous notice is what troubles me.

I don't know what bug are you mentioning, but the templates are a feature for the panel.