• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Please beaware of a breaking change in the REST API on the next Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

CLI vhost setup example?

yabado

Regular Pleskian
I have to move a lot of customers from old home-grown server setup to a plesk panel powered server.

I want to use the CLI to do this and wondered if there was a tutorial showing how to setup the customer and add the subscription/hosting plan for that customer?

I looked over the docs and tested them, but the service plan never shows that hosting is added.

# ./customer --create JDoe -name "John Doe" -passwd sample -country US -notify false
# ./subscription --create example.com -owner admin -service-plan "Default Domain" -ip 192.168.1.100 -login JDoe -passwd "user pass"


I get the email saying that the do moan was setup, but the domain does not show that hosting is affiliated with it.


Thanks for any help or guidance anyone can give.
 
Sorry, but I don't understand your statement "the service plan never shows that hosting is added". What do you mean? How Service Plan should it show? Where? Why creating subscriptions with corresponding utility is not enough for you? What do you mean "domain does not show that hosting is affiliated with it"? Please be more specific. Thanks.
 
Here is a picture to help you understand.

This is what the subscription looks like after it is added via CLI commands shown in first post.

exampledotcom_1A2358B5.png


The subscription should show all the web hosting features/settings right?

example3dotcom_1A235A6F.png
 
Please add the string "-hosting true" , because the hosting - setting is "false" by default.
 
# plesk bin subscription --help
..........
-hosting <true|false> Switches on/off web hosting for domain (default: false).
-hst_type <phys|std|frm> Sets up the specified hosting type (default: phys).
 
Please add the string "-hosting true" , because the hosting - setting is "false" by default.
Thanks , that was the part I was missing.

One other thing is to make sure that the login (ftp) does not use same username that the main owner uses.

Final command , that worked, looks like so...

./subscription -c example6.com -hosting true -hst_type phys -ip 1.2.3.4 -owner JDoe -login john -passwd sample
 
Back
Top