Author Topic: Apache Vhosts getting rebuilt automatically everynight  (Read 6098 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Apache Vhosts getting rebuilt automatically everynight
« on: January 10, 2022, 06:27:12 PM »
Hello it seems my apache vhosts are getting rebuilt every night automatically.



I've edited the template for the specific vhosts but still it overrides the configuration to default.



how can i prevent this or make the custom vhosts config stick

Offline
***
Re: Apache Vhosts getting rebuilt automatically everynight
« Reply #1 on: January 10, 2022, 07:09:53 PM »
- If you are using custom templates that you made yourself or copied into a new file, then it shouldn't overwrite them (the templates themselves). It will however "re-apply" the templates into the domains every while (24h) to keep them "fresh"..


In my case, it deletes the configuration and re-applies them using the custom template (Default_patched.tpl) and the default all-methods.tpl I have set in "webserver Main conf"

Quote
I've edited the template for the specific vhosts but still it overrides the configuration to default.

Are you saying that the "WebServers Main Conf" are getting reset back to "default.tpl"? or are you editing the vhost .conf files of the "specific" domain and expecting it to stay the same overnight?

or are you saying that the custom template that you have made, which is not visible in the image of the logs you have attached are getting overwritten? the tpl files themselves?

Please paste here the content of: /usr/local/cwp/.conf/web_servers.conf
and the content of the /home/USER/.conf/webservers/DOMAIN.conf of one of the domains you are saying their configuration are getting overwritten

*Do NOT edit the last two files. They are meant to be edited through the panel.

Edit: Also, where is the stpl file of the template file that you have blacked out in your second image [????????s.com.tpl] Or are you not using SSL for the domains using that template?
« Last Edit: January 10, 2022, 07:14:27 PM by iraqiboy90 »

Offline
*
Re: Apache Vhosts getting rebuilt automatically everynight
« Reply #2 on: January 19, 2022, 02:23:40 AM »
Hey man, let me share my findings:

/usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/httpd - you clone a file of choice here and then copy to /usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/php-fpm - this will make the cloned template of your choice appear in the menu on my screenshot under the php-fpm section.



Check these folders. I pointed out my template with mouse pointer.

After that http will work but not the https.

Offline
***
Re: Apache Vhosts getting rebuilt automatically everynight
« Reply #3 on: January 19, 2022, 12:01:50 PM »
Hey man, let me share my findings:

/usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/httpd - you clone a file of choice here and then copy to /usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/php-fpm - this will make the cloned template of your choice appear in the menu on my screenshot under the php-fpm section.



Check these folders. I pointed out my template with mouse pointer.

After that http will work but not the https.

No, the copy part info can lead to issues.
There is a simple video made by the devs explaining how to do it.
http://wiki.centos-webpanel.com/webservers-vhost-templates

The template for
/vhosts/httpd
is NOT the same for
/vhosts/php-fpm

You DON'T mix templates between different folders.

If you want the functionality of a template that works with httpd WITHOUT php-fpm (like putting apache in front of nginx for some reason), then you use /vhosts/httpd.
If you want the functionality of a template that works with httpd WITH php-fpm, then you use /vhosts/httpd/php-fpm
If you want to use nginx-only WITH php-fpm, then you use /vhosts/nginx/php-fpm
If you want to use "nginx -> apache -> PHP-FPM", then you use /vhosts/httpd/php-fpm for editing apache related stuff and /vhosts/nginx for nginx related stuff

As for the issue of SSL issue you have. Whatever you do to a name.tpl template, you need to do the same with name.Stpl. The STPL template has the https connection info.

p.s. you are mentioning that you posted an image with your mouse pointing to something. There is no image.

Offline
*
Re: Apache Vhosts getting rebuilt automatically everynight
« Reply #4 on: January 19, 2022, 05:46:04 PM »
Because the system is not showing images I post.

pasteboard dot co/nnck8jFzO08x dot png

Take a look if you can figure it out. No matter which template I edit it does not show up in this menu, CWP is not reading it out for some reason.

Offline
***
Re: Apache Vhosts getting rebuilt automatically everynight
« Reply #5 on: January 19, 2022, 09:19:31 PM »
Because the system is not showing images I post.

pasteboard dot co/nnck8jFzO08x dot png

Take a look if you can figure it out. No matter which template I edit it does not show up in this menu, CWP is not reading it out for some reason.

Then how did you get "default_httpd_php-fpm_snipeit" in there?
To add a template to that exact list, you will have to add it to this path:
Code: [Select]
/usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/httpd/php-fpmYou will have to add a tpl and a stpl file for the ssl.

As for the picture you're trying to post, pasteboard link is not actually an image link even though it says png at the end.
This is the actual image link:
https://gcdn.pbrd.co/images/nnck8jFzO08x.png

Offline
*
Re: Apache Vhosts getting rebuilt automatically everynight
« Reply #6 on: January 19, 2022, 10:10:58 PM »
Because the system is not showing images I post.

pasteboard dot co/nnck8jFzO08x dot png

Take a look if you can figure it out. No matter which template I edit it does not show up in this menu, CWP is not reading it out for some reason.

Then how did you get "default_httpd_php-fpm_snipeit" in there?
To add a template to that exact list, you will have to add it to this path:
Code: [Select]
/usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/httpd/php-fpmYou will have to add a tpl and a stpl file for the ssl.

I simply duplicated the .tpl and .stpl templates in the httpd folders and moved both to the php-fpm folder. But only the .tpl one is showing in my interface, not the .stpl one.

See below.

Code: [Select]
[root@opal php-fpm]# ls -ll
total 64
-rw-r--r-- 1 root root 1291 Jan 19 02:36 all_methods_snipeit.stpl
-rw-r--r-- 1 root root 1126 Jan 19 02:36 all_methods_snipeit.tpl
-rw-r----- 1 root root 3654 Jun  9  2021 all_methods.stpl
-rw-r----- 1 root root 2863 Jun  9  2021 all_methods.tpl
-rw-r--r-- 1 root root 1540 Jan 19 02:36 default_httpd-php-fpm_snipeit.stpl
-rw-r--r-- 1 root root 1376 Jan 19 02:36 default_httpd_php-fpm_snipeit.tpl
-rw-r----- 1 root root 3769 Jun 16  2020 default.stpl
-rw-r----- 1 root root 2978 Jun 16  2020 default.tpl
-rw-r----- 1 root root  643 Jun  6  2019 suspend.stpl
-rw-r----- 1 root root  494 Jun  6  2019 suspend.tpl
-rw-r----- 1 root root 3806 Jul 27 18:43 timeout_30-minutes.stpl
-rw-r----- 1 root root 3013 Jul 27 18:43 timeout_30-minutes.tpl
-rw-r----- 1 root root 3804 Jul 27 18:43 timeout_5-minutes.stpl
-rw-r----- 1 root root 3011 Jul 27 18:43 timeout_5-minutes.tpl
-rw-r----- 1 root root 3806 Jul  6  2021 timeout_60-minutes.stpl
-rw-r----- 1 root root 3013 Jul  6  2021 timeout_60-minutes.tpl
[root@opal php-fpm]#

Offline
***
Re: Apache Vhosts getting rebuilt automatically everynight
« Reply #7 on: January 20, 2022, 02:54:24 PM »
I simply duplicated the .tpl and .stpl templates in the httpd folders and moved both to the php-fpm folder. But only the .tpl one is showing in my interface, not the .stpl one

you DO NOT move templates or copy them across different folders. I've already mentioned this!

You DON'T mix templates between different folders.


I repeat: You do NOT clone, copy, move, whatever, between
/usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/httpd
and
/usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/httpd/php-fpm

You clone a template from httpd/php-fpm to httpd/php-fpm  <--- yes
You do NOT clone a template from httpd into httpd/php-fpm  <--- NO

I hope that by repeating myself, you will not repeat the same mistake again.

As for the stpl. If both the tpl and stpl templates has the same names, then no worries. The system will automatically read the stpl file when a client tries to access the website with https:// or if you told the tpl file to redirect to https:// in which case it will automatically force clients to access the website with https:// and the system will automatically read the stpl file.
« Last Edit: January 20, 2022, 02:56:21 PM by iraqiboy90 »

Offline
*
Re: Apache Vhosts getting rebuilt automatically everynight
« Reply #8 on: January 24, 2022, 09:22:25 PM »
I repeat: You do NOT clone, copy, move, whatever, between
/usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/httpd
and
/usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/httpd/php-fpm

As for the stpl. If both the tpl and stpl templates has the same names, then no worries. The system will automatically read the stpl file when a client tries to access the website with https:// or if you told the tpl file to redirect to https:// in which case it will automatically force clients to access the website with https:// and the system will automatically read the stpl file.

Well, I will just add that the only way to get this resolved was by copying the file like I said. By doing exactly what you said is wrong - I made a fix.


Offline
***
Re: Apache Vhosts getting rebuilt automatically everynight
« Reply #9 on: January 24, 2022, 10:05:23 PM »
Well, I will just add that the only way to get this resolved was by copying the file like I said. By doing exactly what you said is wrong - I made a fix.

The templates at /usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/httpd/  does not contain the parameters for using php-fpm. So, I don't understand why you keep wanting to use it even though you keep saying that you want to use php-fpm?

If you want apache with php-fpm, then you use the templates at:
/usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/httpd/php-fpm
If you want apache with suPHP, then you use the templates at:
/usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/httpd

It's simple. Not sure how you came to a solution with your own way... Confirm your php type with the setup that you have...
Create a php file at the domain that have the setup that you made for yourself, and put this inside:
Code: [Select]
<?php
phpinfo
();
?>

Now load the file through the browser and confirm if your PHP is FPM/FastCGI under "Server API"
« Last Edit: January 24, 2022, 10:11:07 PM by iraqiboy90 »