Page 1 of 1

change all users web template

Posted: Wed Feb 08, 2017 8:28 pm
by paunescumihai
Hello.
How to i mass change all domains in vesta cp from "default" to "phpfcgid"?


i tried:
v-change-user-template iovis web phpfcgid
it changes the: cat /usr/local/vesta/data/users/iovis/user.conf
FNAME=''
LNAME=''
PACKAGE='single'
WEB_TEMPLATE='phpfcgid'
PROXY_TEMPLATE='default'
DNS_TEMPLATE='default'
WEB_DOMAINS='1'
WEB_ALIASES='0'
DNS_DOMAINS='0'
DNS_RECORDS='0'
MAIL_DOMAINS='0'
MAIL_ACCOUNTS='0'
DATABASES='1'
......

then i tried:
vps iovis # v-rebuild-user iovis
but it does not change the web template (in web panel nore in httpd.conf)

Re: change all users web template

Posted: Wed Feb 08, 2017 10:41 pm
by skamasle
Web template is defined in /usr/local/vesta/data/users/iovis/web.conf

You can sed it ( first do a backup of your web.conf

Code: Select all

sed -i "s/TPL='default'/TPL='phpfcgid'/"  /usr/local/vesta/data/users/iovis/web.conf
Then

Code: Select all

v-rebuild-web-domains lovis
It should work.

Re: change all users web template

Posted: Thu Feb 09, 2017 1:35 am
by paunescumihai
yeah, it works.
But there must be one command to do it for all the users with their domains at the same time....

edit1:

i mean one system command or something...

cause i can do it like this:
for user in $(v-list-sys-users plain); do sed -i "s/TPL='default'/TPL='phpfcgid'/" /usr/local/vesta/data/users/$user/web.conf;done
then:
for user in $(v-list-sys-users plain); do v-rebuild-web-domains $user;done