• 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
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff 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