Install WordPress When Account is Created via the API?

mikeyg6754

Verified User
Joined
Jan 23, 2012
Messages
20
Hi,
I'm working on implementing my own ordering system and on certain accounts I need to have WordPress installed automatically when the account is created.
What do you think would be the best way to achieve this?
 
i suppose you have to use domain_create_post.sh and/or user_create_post.sh with some api for create the mysql database.

Regards
 
Thanks for the Reply

Is there documentation on that? If so, where can I find it. Also can you pass values to it somehow? because WordPress only needs to be installed on certain accounts.
 
There is nothing directly related, but, maybe those should help:

http://www.directadmin.com/features.php?id=479
http://help.directadmin.com/item.php?id=299

And this is the code to create a db for an user using the API:

Code:
<?php

include 'httpsocket.php';

$sock = new HTTPSocket;
$sock->connect('localhost',2222);

$sock->set_login("admin|USER","ADMINPASS");

$sock->set_method('POST');

$sock->query('/CMD_API_DATABASES',
        array(
                'action' => 'create',
                'name' => DBNAME,
                'user' => DBUSER,
                'passwd' => DBPASS,
                'passwd2' => DBPASS
    ));

$result = $sock->fetch_body();

?>

Hope it help.

Regards
 
Last edited:
Hi,
I'm working on implementing my own ordering system and on certain accounts I need to have WordPress installed automatically when the account is created.
What do you think would be the best way to achieve this?

Hello,

Since you are writing your own ordering system... do you use API for creating accounts? Or are you going to create accounts manually? If the first, then you can use API for creating a MySQL DB directly from your ordering system, then create tables and run other queries, and of course copy WordPress to a public_html. If the second, then as Andrea already suggested you, you might want to use the scripts domain_create_post.sh and/or user_create_post.sh.
 
Since you are writing your own ordering system... do you use API for creating accounts? Or are you going to create accounts manually? If the first, then you can use API for creating a MySQL DB directly from your ordering system, then create tables and run other queries, and of course copy WordPress to a public_html. If the second, then as Andrea already suggested you, you might want to use the scripts domain_create_post.sh and/or user_create_post.sh.

I will be using the API to create the accounts... Your suggestions have been taken into consideration.

What do you mean for "full"? is the same as create a database at user level
Sorry about that... I think DA does that automatically. I am just switching from cPanel so I am used to the way it works.
 
Also if anyone was wondering. This is the plan for the system.

1) User Selects Product
2) User is presented with a page to fill out their billing address and verify the cost of the plan. At this point, they will also see if their desired username is available and password will be randomly generated.
3) Upon submission, all this data will be stored in a database and they will be passed to PayPal to setup their recurring Payment
4) The user completes their payment and it notifies the PayPal IPN script.
5) The PayPal IPN script will get the values from the database
6) It will then take these values and create the desired account.
7) WordPress will automatically be installed on certain accounts using user_create_post.sh
8) The user will receive an email stating that everything is ready.
--
For now, if a user stops payment the accounts will be suspended manually.
 
Back
Top