Control Web Panel

Developers => Functions => Topic started by: vradova on January 22, 2021, 10:25:25 AM

Title: WebServers Vhost Template
Post by: vradova on January 22, 2021, 10:25:25 AM
Hello!

I have created two custom templates and add my custom code. I did an https redirection in .tpl file and in .stpl (SSL) template I did a change to the docroot path for a domain name.

When I do a change through CWP WHM for the domain name it creates new vhosts files for a domain name, but for .tpl file, system adds suffix .disabled and after that when you open a domain name in web browser I have an error. Fix for this is just to rename .tpl file and remove .disabled suffix. Restart Apache server and domain is up and running with settings I put in a custom template file.

My main issue is when I add this template as the default, main webservers configuration. Option, Apache default PHP-FPM template, and when SSL expires and system automatically renews it site became forbidden for access because .tpl file has suffix .disabled. The solution is, rename and remove a suffix, restart Apache and get the domain up and running.

Where do I get wrong and why CWP add suffix .disabled to a custom template?

Thanks, Vlade.
Title: Re: WebServers Vhost Template
Post by: cinique on January 22, 2021, 11:32:54 AM
I have seen a similar problem too, with a custom template - somewhat annoying that it's renamed disabled.
Additionally, the editor introduces corruption to the template, adding spurious ~~@~~ (IIRC) characters at options +SymLinksIfOwnerMatch
Could this be the reason for it being marked disabled?
Title: Re: WebServers Vhost Template
Post by: studio4host on March 12, 2021, 09:35:33 AM
disabled is probably because you have some strange characters in the template, like character %
Title: Re: WebServers Vhost Template
Post by: vradova on March 12, 2021, 02:05:13 PM
Hi!

You were right... Issue was the code for redirection in .tpl file.

Thanks!