My client wants me to create a “simple” script (in PHP).
He wants to fill the form with domain names, subdomain names, and blog titles. The script should create subdomains for each domain and automatically install WordPress there.
Creating subdomains is easy using the Plesk API, but the problem occurs when I want to install WordPress. Although there is an autoinstaller, I can’t find it in the API.
When creating a subdomain, I fill in the FTP login and password for it, and I can then connect over FTP and upload WordPress files. Any suggestions for doing this automatically? The script may work on my client’s server where Plesk is installed.
3
Answers
if it is ok to get wordpress from APS Catalog, you should use Plesk API for installing the applacation to webspace/subdomain. Learn more about Plesk API
http://download1.parallels.com/Plesk/PP10/10.1.1/Doc/en-US/online/plesk-api-rpc/index.htm
Installing WordPress or any other app is very poor documented. Some general information can be found here :
http://download1.parallels.com/Plesk/PP10/10.1.1/Doc/en-US/online/plesk-api-rpc/plesk-api-rpc-pt2/index.htm?fileName=64489.htm
but what kind of settings you need to provide for WordPress is indeed a very very big question.
Agree that the documentation is too poor. Here is the list of calls that could help you. You should put a proper version into the request. I hope you are using Plesk 10x for that.
Get all packages from Application catalog to catch actual package params to be used in next calls
<packet version="1.6.3.4">
<aps> <get-packages-list><all/></get-packages-list>
</aps>
</packet>
Download the package from the catalog
<packet version="1.6.3.4">
<aps>
<download-package>
<package>
<name>WordPress</name>
</package>
</download-package>
</aps>
</packet>>
Install the the app to a domain
<packet version="1.6.3.4">
<aps>
<install>
<domain-name>mydomaun.com</domain-name>
<package>
<name>WordPress</name>
</package>
<settings>
<setting>
<name>admin_email</name>
<value>[email protected]</value>
</setting>
<setting>
<name>admin_password</name>
<value>qweqwe</value>
</setting>
</settings>
</install>
</aps>
</packet>