Author Topic: WebServers Domain Configuration Reset  (Read 6446 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
WebServers Domain Configuration Reset
« on: January 10, 2022, 09:57:04 AM »
I work with multiple Laravel websites on my server so I have created a template for apache and nginx to handle laravel instalations, after I create a new domain I go to "WebServers Domain Conf" and set a custom template, everything works well but sometimes without any reason some domians lose that custom template, this is really strange.

Any tips?

For example I can have an account with 3 domains with custom template most of the times the only one of that domains will be reset to the initial template, usually this happens more in new domains, I add a new domain create add the custom template everything work and 1 ou 2 days later it lose that custom template and return to de default

Offline
***
Re: WebServers Domain Configuration Reset
« Reply #1 on: January 10, 2022, 07:39:06 PM »
Confirm the content of this file is the same as the configuration you have done through "WebServer Domain Conf"
Code: [Select]
/home/USER/.conf/webservers/DOMAIN.conf.

If they are but getting overwritten back to default after a while, then there is an extreme method you can test which is to stop everything from touching that file;
with SSH
chattr +i /home/USER/.conf/webservers/DOMAIN.conf

Offline
*
Re: WebServers Domain Configuration Reset
« Reply #2 on: January 12, 2022, 07:01:08 AM »
Also here an example for Codeigniter 4. https://forum.centos-webpanel.com/index.php?topic=11682.0
There I use Webserver config: nginx ->apache ->php-fpm

Then the custom templates are located here: /usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/httpd/php-fpm

The part to read and understand carefully is where the custom templates are located and named:
Read all the info here: http://wiki.centos-webpanel.com/webservers-vhost-templates

Template folders explained
List from folder: /usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/

httpd = apache templates
nginx = nginx templates
varnish = varnish templates
php-fpm = php-fpm service templates (used for all php-fpm versions)

httpd (subfolders explained)
- main folder = default templates used with php-cgi, this is only httpd folder no subfolder
- php-fpm folder = php-fpm templates used when server/domain is running php-fpm
- proxy folder = proxy templates used when apache is used as proxy to other service/port

nginx (subfolders explained)
- main folder = default templates used as proxy templates, this is only nginx folder no subfolder
- php-fpm folder = php-fpm templates used when server/domain is running nginx&php-fpm

varnish (no subfolders)
- main folder = default templates used as proxy templates, varnish has no .stpl (https/ssl) files and also has no other subfolders

php-fpm (no subfolders)
- main folder = default templates used as templates for all php-fpm versions, php-fpm has no .stpl (https/ssl) files and also has no other subfolders.

Offline
*
Re: WebServers Domain Configuration Reset
« Reply #3 on: January 14, 2022, 11:49:23 AM »
In my server I already implement this changes by creating the templates for Laravel.

The problem is that sometimes the server lose the selection of that templates.

Usually change to the default template the last domain that I configure with a custom template.

I have 2 server and both have the same problems, yesterday I have created in both servers a website with the laravel template, everything works great, today in both server the website stop working, after I checked the I saw that the configurations return to the default value, the other older domains that also use the custom template still working great.

Offline
***
Re: WebServers Domain Configuration Reset
« Reply #4 on: January 14, 2022, 10:10:33 PM »
I don't know if is really the same problem as yours, but I had this type of problem when forgetting to check the mark "Rebuild WebServers conf for domain on save".

Did you already checked the content of the configuration file?:
Code: [Select]
# cat /home/user/.conf/webservers/DOMAIN.conf

Offline
*
Re: WebServers Domain Configuration Reset
« Reply #5 on: January 15, 2022, 10:46:40 AM »
I don't know if is really the same problem as yours, but I had this type of problem when forgetting to check the mark "Rebuild WebServers conf for domain on save".

Did you already checked the content of the configuration file?:
Code: [Select]
# cat /home/user/.conf/webservers/DOMAIN.conf

At the moment I have this on that file:
{
    "nginx_template-type": "default",
    "nginx_template-name": "laravel-force-https",
    "apache_template-type": "default",
    "apache_template-name": "laravel",
    "nginx": true,
    "php-cgi": true,
    "apache-additional": true
}

And it's working, this is a very strange bug, I saw lots of posts on the forum about the same, and any official solution.

Offline
***
Re: WebServers Domain Configuration Reset
« Reply #6 on: January 15, 2022, 10:51:37 AM »
Confirm the content of this file is the same as the configuration you have done through "WebServer Domain Conf"
Code: [Select]
/home/USER/.conf/webservers/DOMAIN.conf.

If they are but getting overwritten back to default after a while, then there is an extreme method you can test which is to stop everything from touching that file;
with SSH
chattr +i /home/USER/.conf/webservers/DOMAIN.conf

At the moment I have this on that file:
{
    "nginx_template-type": "default",
    "nginx_template-name": "laravel-force-https",
    "apache_template-type": "default",
    "apache_template-name": "laravel",
    "nginx": true,
    "php-cgi": true,
    "apache-additional": true
}

And it's working, this is a very strange bug, I saw lots of posts on the forum about the same, and any official solution.

Make sure you rebuild the vhosts, and then lock the file for good measure as I mentioned in my post.
Remember, you need to unlock the file with "chattr -i" before doing changes and then lock it again after confirming the content.

Offline
***
Re: WebServers Domain Configuration Reset
« Reply #7 on: January 15, 2022, 10:57:55 PM »
(...)
At the moment I have this on that file:
{
    "nginx_template-type": "default",
    "nginx_template-name": "laravel-force-https",
    "apache_template-type": "default",
    "apache_template-name": "laravel",
    "nginx": true,
    "php-cgi": true,
    "apache-additional": true
}

And it's working, this is a very strange bug, I saw lots of posts on the forum about the same, and any official solution.

Did you try to check if you reall have .tpl and .stpl files.?

Use the command:
Code: [Select]
find /usr/local/cwpsrv/htdocs/resources/conf/web_servers | grep laravel

Offline
*
Re: WebServers Domain Configuration Reset
« Reply #8 on: January 16, 2022, 09:55:25 AM »
Confirm the content of this file is the same as the configuration you have done through "WebServer Domain Conf"
Code: [Select]
/home/USER/.conf/webservers/DOMAIN.conf.

If they are but getting overwritten back to default after a while, then there is an extreme method you can test which is to stop everything from touching that file;
with SSH
chattr +i /home/USER/.conf/webservers/DOMAIN.conf

At the moment I have this on that file:
{
    "nginx_template-type": "default",
    "nginx_template-name": "laravel-force-https",
    "apache_template-type": "default",
    "apache_template-name": "laravel",
    "nginx": true,
    "php-cgi": true,
    "apache-additional": true
}

And it's working, this is a very strange bug, I saw lots of posts on the forum about the same, and any official solution.

Make sure you rebuild the vhosts, and then lock the file for good measure as I mentioned in my post.
Remember, you need to unlock the file with "chattr -i" before doing changes and then lock it again after confirming the content.

Yes I can lock it but this is not the correct approach, the correct approach is someone fix this annoying problem, there are lots of people complaining about the same and we get not answers from CWP team.

(...)
At the moment I have this on that file:
{
    "nginx_template-type": "default",
    "nginx_template-name": "laravel-force-https",
    "apache_template-type": "default",
    "apache_template-name": "laravel",
    "nginx": true,
    "php-cgi": true,
    "apache-additional": true
}

And it's working, this is a very strange bug, I saw lots of posts on the forum about the same, and any official solution.

Did you try to check if you reall have .tpl and .stpl files.?

Use the command:
Code: [Select]
find /usr/local/cwpsrv/htdocs/resources/conf/web_servers | grep laravel



Yes I have the .tpl and .stpl, I have lots of domains working this problem only occurs for new domains with custom vhost and in that case the vhost revert to default during the next night, then if I change it again for the custom template it works and don't change anymore