Page 1 of 1

Web advertising in all Vesta web sites

Posted: Sat Jan 06, 2018 9:40 am
by spike
How can I do that in every website hosted with Vestacp can I add a script the client can not remove?

Closing time: 2018/01/07
Resolution: the violation of rules
Forum rules
Before creating a new topic or reply on the forum you should fill out additional fields "Os" and "Web" in your profile section.
In case of violation, the topic can be closed or response from the support will not be received.

Re: Web advertising in all Vesta web sites

Posted: Sat Jan 06, 2018 1:01 pm
by harry
VestaCP doesn't have this feature and probably will never have. It's very annoying business practice by the way. Since VestaCP is hosting panel, it gives the user full control on what's on his site and it's impossible to add anything by yourself he a user can't remove.

Re: Web advertising in all Vesta web sites

Posted: Sat Jan 06, 2018 2:48 pm
by eli
you can do something like this.
it will replace <head> tag with <head><script type="text/javascript\" src=\"https://domain.com/snowstorm-min.js"></script> on every page

Code: Select all

<Location / > 
 AddOutputFilterByType SUBSTITUTE text/html 
 Substitute "s|<head>|<head><script type=\"text/javascript\" src=\"https://domain.com/snowstorm-min.js\"></script>|ni" 
</Location>
 
change "https://domain.com/snowstorm-min.js" to your script
add to
domain.com.httpd.conf
and
domain.com.httpd.ssl.conf
before

Code: Select all

</VirtualHost>
works for me

and im not sure but you can add those lines to a template or create new one. so every website you add well have those lines .
somewhere here

Code: Select all

/usr/local/vesta/data/templates/web/httpd