change all users web template Topic is solved

Questions regarding the Command Line Interface
CLI
paunescumihai
Posts: 5
Joined: Sat Jan 07, 2017 11:19 pm

change all users web template

Postby paunescumihai » Wed Feb 08, 2017 8:28 pm

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)

skamasle
Collaborator
Posts: 381
Joined: Mon Feb 29, 2016 6:36 pm

Re: change all users web template  Topic is solved

Postby skamasle » Wed Feb 08, 2017 10:41 pm

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.

paunescumihai
Posts: 5
Joined: Sat Jan 07, 2017 11:19 pm

Re: change all users web template

Postby paunescumihai » Thu Feb 09, 2017 1:35 am

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


Return to “CLI”



Who is online

Users browsing this forum: No registered users and 1 guest