Softaculous Remote

From Softaculous Wiki
Jump to: navigation, search

Contents

Overview

The following guide will show you how to install Softaculous Remote. Softaculous Remote is suitable for a system where installation needs to be done on a remote server with the help of FTP / FTPS / SFTP. Softaculous will be installed on a single VM or dedicated server and will install applications over FTP / FTPS / SFTP. Softaculous Remote is suitable for a setup where the FTP / FTPS / SFTP details of the endusers are available.

Requirements

  • A server with Root access.
  • If you have a firewall, then please allow access to download all packages from *.softaculous.com
  • GCC is required to be installed on the server. If it is not already installed you can install it using the following command :

yum install gcc

Note : Please allow access to the following domains to your firewall as these are the mirrors used to download the script packages.

  • api.softaculous.com (IP : 192.198.80.3)
  • s1.softaculous.com (IP : 158.69.6.246)
  • s2.softaculous.com (IP : 192.200.108.99)
  • s3.softaculous.com (IP : 178.32.158.97)
  • s4.softaculous.com (IP : 138.201.24.83)
  • s7.softaculous.com (IP : 167.114.200.240)

IMPORTANT : Please do not use any other web server on this server because Softaculous will be using its own web server on port 80, 443, 2006 and 2007. Also do not install any other database as MySQL too will be installed by Softaculous and will be using port 3178.

Supported OS

  • CentOS
  • Ubuntu
  • Debian

Installing Softaculous

  • SSH to your server and enter following commands:
wget -N http://files.softaculous.com/install.sh
chmod 755 install.sh
./install.sh --remote
  • Note the API KEY and API PASSWORD given by the installer in the end. It will be used for Login and verification purpose.
  • That's it the installation of Softaculous Remote is completed!

Installing a Script

You can install a script directly by passing the details mentioned below. This will add a domain and also install the script.

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act software, js, perl The value should be "software" to install PHP script, "js" to install a JavaScript and "perl" to install a PERL script for softaculous to perform the action of installing a software.
soft 26 (26 is the Script ID of WordPress) The value should be "SID" for softaculous to perform the action of installing a software. You can find the list of sid's here
POST
domainadd array() This will be the array with the details of the domain where you want to install the script.
softsubmit 1 This will trigger the install
softdomain domain.com This is the domain on which you wish to install the script
softdirectory wp This is the sub-directory to install the script in. Leave it blank to install in root of the domain
softdb wp123 This is the database name for the script. If the script does not require database you can leave this blank
dbusername wp123 This is the database user
dbuserpass w1XRF28mq8 This is the database password. You can generate a random password
hostname localhost This is the hostname of your MySQL server. You can enter your MySQL server IP if you have MySQL on a remote server
admin_username admin This is the admin account username for the installation
admin_pass pass This is the admin account password for the installation
admin_email admin@domain.com This is the admin account email address for the installation
language en Language for the installation. You can get the language codes from the respective install.xml
site_name My Blog Site Name for the installation
site_desc My WordPress Blog Site Description for the installation


Example

// URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=software'.
                        '&soft=26';

$post = array('softsubmit' => '1',
              'domainadd' => array(
                   'domain' => 'example.com', // domain name
                   'port' => '21', // FTP port
                   'protocol' => 'ftp', // Protocol
                   'ftp_user' => 'testuser', // FTP User
                   'ftp_pass' => 'testpass', // FTP Password
                   'ftp_path' => '/public_html', // Relative path to document root of the domain
                   'path' => '/home/testuser/public_html', // Full path to the document root of the domain
                   'backupdir' => '/backups', // Backups directory path
                   'datadir' => '/datadir' // Data directory path
              ),
              'softdomain' => 'example.com', // Must be a valid Domain
              'softdirectory' => 'wp', // Keep empty to install in Web Root
              'softdb' => 'wpdb',
              'dbusername' => 'dbusername',
              'dbuserpass' => 'dbuserpass',
              'hostname' => 'localhost',
              'admin_username' => 'admin',
              'admin_pass' => 'adminpassword',
              'admin_email' => 'admin@example.com',
              'language' => 'en',
              'site_name' => 'WordPress Site',
              'site_desc' => 'My Blog'
);

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}

User Management

Types of Users

There are three types of Users in Softaculous Remote :

Admin User

  • There is only one Admin User i.e root and is by default added during the installation.
  • Owner and Username of Admin User is root
  • It is responsible for handling the scripts, users, domains and other settings.
  • Admin can create Reseller as well as Regular Users.
  • Like Regular users even Admins can use the Enduser Panel and install scripts.

Reseller User

  • Only Admin can create Resellers.
  • Resellers can be added from Admin Panel
  • Number of users allotted to Reseller should be more by one because reseller himself is counted as a user. E.g If Admin has allotted 10 number of users then Reseller can add total 9 Regular Users under his account.
  • Resellers can create Regular Users.
  • Like Regular users even Resellers can use the Enduser Panel and install, remove and manage scripts.
  • If the Reseller is 'xyz' then the owner and the username of his accounts will be 'xyz'.

Regular User

  • Regular Users can be created by Admin or Resellers.
  • Owner of the Regular User will the User who is creating the user, it can be Admin(root) or Reseller.
  • They can install, remove, update, manage scripts from Enduser Panel.
  • The owner and the username of the Regular users create by a Reseller will be :
    • Owner => Reseller's Username(xyz in above example)
    • Username => User name of the regular user just created
  • The owner and the username of the Regular users create by Admin will be :
    • Owner => root
    • Username => User name of the regular user just created


Authentication Methods

There are three possible ways to login into Softaculous Remote :

Default Login

  • Access your server through browser <your-server-ip> or <your-domain>.com
  • Enter the API KEY and API PASS provided by the Installer or your host to login into Softaculous Remote.

Default Login Page

Login Code

This is optional part and Softaculous will use the default session handling.

  • Softaculous allows you to dynamically handle the session and define the User details and Domains to be listed under the user. This can be done using session.php where you can communicate with your control panel and validate the current user's session.
  • If session.php is created Softaculous will skip the authentication part and will assume that the session is authenticated by you.
  • You can define the user details i.e. username, owner, email and the domains owned by the current logged in user in $PRE_LOGIN array.
  • When Softaculous is loaded it will add the user and domains defined in $PRE_LOGIN if it does not exist in Softaculous database.
  • You can refer to the session.sample.php located at /usr/local/softaculous/enduser/session.sample.php

Variable Example Description
$PRE_LOGIN['username'] test Username who will be accessing Softaculous Remote. Admin user is root which is created during installation time. If the username passed here does not exist in Softaculous Remote database it will be added.
$PRE_LOGIN['owner'] (Optional) root Owner who will own this account. This is not the username but this is the user who will own the account. If not specified 'root' will be assumed. Default owner is root which is created during installation time.
$PRE_LOGIN['email'] user@email.com Email of the username. This is used to send emails like whether Install, Remove, Update of Scripts were successful or not.
$PRE_LOGIN['plan'] (Optional) platinum This is used to specify which control panel plan does this user falls under. Refer [[1]] for defining control panel plans
$PRE_LOGIN['domains'][0]['domain'] domain.com Domain Name where the users will be installing the scripts
$PRE_LOGIN['domains'][0]['server_host'] (Optional) ftp.domain.com Server host if domain and server host are different.
$PRE_LOGIN['domains'][0]['port'] 21 Port which should be used to connect FTP server
$PRE_LOGIN['domains'][0]['protocol'] ftp Protocol that should be used to connect to the server. Possible values (ftp, ftps, sftp)
$PRE_LOGIN['domains'][0]['ftp_user'] user Valid FTP User to connect to the domain
$PRE_LOGIN['domains'][0]['ftp_pass'] password Valid FTP Password of the user
$PRE_LOGIN['domains'][0]['ftp_path'] /public_html Valid Web accessible directory available and accessible to the FTP User. Directory should be present. It should be relative from Home Directory of the user with a slash in the beginning as FTP requires it this way.
$PRE_LOGIN['domains'][0]['path'] /home/USERNAME/public_html Full path of the web accessible directory.
$PRE_LOGIN['domains'][0]['backupdir'] /backups Relative Path of the Backup Directory. Backups created by Softaculous will be located here.
$PRE_LOGIN['domains'][0]['datadir'] /home/USERNAME/datadir Absolute path of the Data Directory. Some scripts like Elgg, Moodle, etc need a non web accessible folder.

Example

// Write your code to authenticate the session with your control panel
if(!$authenticated){
	die('Could not validate session');
}

$PRE_LOGIN['owner'] = 'root'; // Owner
$PRE_LOGIN['username'] = 'test'; // Username
$PRE_LOGIN['email'] = 'user@email.com'; // Email
$PRE_LOGIN['plan'] = 'platinum'; // Control Panel Plan

// Domain 1 details
$PRE_LOGIN['domains'][0]['domain'] = 'domain1.com';
$PRE_LOGIN['domains'][0]['port'] = 21;
$PRE_LOGIN['domains'][0]['protocol'] = 'ftp';
$PRE_LOGIN['domains'][0]['ftp_user'] = 'user';
$PRE_LOGIN['domains'][0]['ftp_pass'] = 'password';
$PRE_LOGIN['domains'][0]['ftp_path'] = '/public_html';
$PRE_LOGIN['domains'][0]['path'] = '/home/USERNAME/public_html';
$PRE_LOGIN['domains'][0]['backupdir'] = '/backups';
$PRE_LOGIN['domains'][0]['datadir'] = '/home/USERNAME/datadir';

// Domain 2 details
$PRE_LOGIN['domains'][1]['domain'] = 'domain2.com';
$PRE_LOGIN['domains'][1]['server_host'] = 'ftp.domain2.com';
$PRE_LOGIN['domains'][1]['port'] = 21;
$PRE_LOGIN['domains'][1]['protocol'] = 'ftp';
$PRE_LOGIN['domains'][1]['ftp_user'] = 'user';
$PRE_LOGIN['domains'][1]['ftp_pass'] = 'password';
$PRE_LOGIN['domains'][1]['ftp_path'] = '/public_html/domain2';
$PRE_LOGIN['domains'][1]['path'] = '/home/USERNAME/public_html/domain2';
$PRE_LOGIN['domains'][1]['backupdir'] = '/backups';
$PRE_LOGIN['domains'][1]['datadir'] = '/home/USERNAME/datadir';


// You can also define the following optional constants
define('SOFT_LOGOUT_URL', 'http://YOUR_LOGOUT.URL'); // Define your custom logout URL here
define('SOFT_LOGOUT_REDIRECT', 'http://YOUR_REDIRECT.URL'); // Define the URL where you want the user to be redirected after logging out using default logout URL
define('SOFT_SIGNIN_REDIRECT', 'http://YOUR_SIGNIN.URL'); // Define the URL where you want the user to be redirected for login

Sync Domains

  • When the domains are passed using $PRE_LOGIN['domains'] array described in the previous section the domain is synced with the Softaculous Remote database and if the domain does not exist in Softaculous Remote database the domain is added automatically.
  • However if you remove a domain from the $PRE_LOGIN['domains'] array it will not be deleted from Softaculous Remote database. In order to delete the domains when they are not passed in $PRE_LOGIN['domains'] you will need to enable the Enable Sync Domain(s) from Softaculous Admin Panel -> Settings page. Once this setting is enabled the domains passed in $PRE_LOGIN['domains'] will be in sync with the database and only the domains passed in $PRE_LOGIN['domains'] will be present in the database.

Session Tokens

  • Refer to Session Tokens for creating session tokens which can be used to redirect the user to Softaculous Remote with the session created. The user will not have to do anything to login in this method as the session is created by the Admin here for automation purposes.

Extended Integration (Optional)

  • You can extend the integration with Softaculous Remote to automate tasks like database creation, database deletion, adding cronjob, etc
  • Softaculous Remote requires a database when a user wants to install a script which requires a database. By Default Softaculous Requires the database to be created. If you want to automate this for the user so that the database is created automatically by Softaculous when required you will need to write some functions in remote.php
  • You can refer to the remote.sample.php located at /usr/local/softaculous/enduser/remote.sample.php

remote.php consists of a PHP class named remote which has the functions (explained below) which are called by Softaculous when required.

Auto generate database name

Use this option if you do not want to ask the user for the database name. You can write your algorithm to generate database name. In order to use this option you will need to write the dbname() and dbuser() functions which are explained in the guide below.

var $auto_managedb = 1;

Constructor

If you want to execute anything when remote class is loaded you can put it here. For example you can connect to mysql as shown in below example if you want.

function remote(){

	// Connecting to the database with root privileges. This will be used to create database for any new installations.
	// Note: This is not compulsory and just an example
	$this->db = mysql_connect($this->dbhost(), 'root', 'mysql');
	
	if(!$this->db){
		die('Could not establish a connection to a database.');
	}
}

Database Query function

Create this function to execute a database query. You can use this function later to execute like CREATE DATABASE, DELETE DATABASE, etc in the functions defined later.

function myquery($query, $report = 1){
	$result = mysql_query($query, $this->db);
	if($report && !$result){
		echo 'Could not make query : <br />'.$query.'
		<br /><br /> MySQL ERROR :'.mysql_error($this->db);
		die();
	}
	return $result;
}

Database Host

It should return the hostname of the database. This function is used to connect to a database where Softaculous can install scripts.

function dbhost($type = 'mysql'){	
	return 'localhost';
}

Database Usage Limit

The max number of databases that this user can create. This function is used to check that user does not create more databases than allotted. If the user is allowed unlimited database return a string.

function maxdb($type = 'mysql'){
	// return 'unlimited';
	return 1000000;
}

Current Database Usage

This function is called to CHECK whether the existing number of databases is not GREATER that or EQUAL to (>=) than the allowed number of Databases. If the user is allowed unlimited database return a string.

function dbsused($type = 'mysql'){
	return 0;
}

Database Name

If the panel requires to modify the DB NAME that is to be created when installing a script, it has to be done here. If your panel adds the username as prefix to the input from users as DBNAME and create Databases like USERNAME_DBNAME. In such a case this function must return USERNAME_DBNAME

function dbname($dbname){		
	return $dbname;
}

Database Username

If the panel requires to modify the DB USERNAME that is to be created when installing a script, it has to be done here. If your panel adds the username as prefix to the input from users as DBUSERNAME and create Database user like USERNAME_DBUSERNAME. In such a case this function must return USERNAME_DBUSERNAME

function dbuser($dbuser){
	return $dbuser;
}

Database User Password

This should return the password that should be used for the database user just created. You can generated a random password.

function dbpass($dbpass){
	if(!empty($dbpass)) return $dbpass;
	else return generateRandStr(7);
}

Check Database Exists

Check whether the specified Database Exists. Return true if it exists or false if it doesnt.

function dbexists($dbname){
	return false;
}

Check Database User Exists

Check whether the specified Database User Exists. Return true if it exists or false if it doesnt.

function dbuserexists($dbuser){
	return false;
}

Create Database

This function should create the DATABASE and also the Database USER.

* The user must also be added to the database so that the user can conduct all necessary operations on the Database.
* Return true if it is created successfully or false if there were any error
* If there are any errors while creation of database please fill in $GLOBALS['error'][] = 'The error';
function createdb($dbname, $dbuser, $dbpass, $type = 'mysql'){
	$is_empty = $this->dbexists($dbname);
	if(!empty($is_empty)) return true;

	$result = $this->myquery("CREATE DATABASE ".$dbname, 0);
	
	// Softaculous is installed on 192.168.17.131 and will be accessing the database from here
	$result = $this->myquery("GRANT ALL PRIVILEGES ON $dbname.* TO '$dbuser'@'192.168.17.131' IDENTIFIED BY '$dbpass'", 0);
	
	$result = $this->myquery("GRANT ALL PRIVILEGES ON $dbname.* TO '$dbuser'@'".$this->dbhost()."'
	IDENTIFIED BY '$dbpass'", 0);
	
	/* if(!$result){
		$GLOBALS['error'] = 'Could not create the database';
	} */
	
	return true;
}

Delete Database

This function should delete the DATABASE and also the Database USER.

* Return true if it deletes the database and user successfully or false if it doesn't
* If there are any errors while deleting of database please fill in $GLOBALS['error'][] = 'The error';
function deldb($dbname, $dbuser, $type = 'mysql'){		
			
	global $globals, $__settings;
	$result = $this->myquery("DROP DATABASE ".$dbname, 0);
	$result = $this->myquery("DROP USER '".$dbuser."'@'192.168.17.131'", 0);
	$result = $this->myquery("DROP USER '".$dbuser."'@'".$this->dbhost()."'", 0);
	
	return true;	
}

Space Remain

This function should return the Disk Space Available in BYTES. If a string is returned it will be assumed that the user has unlimited space.

function spaceremain(){	
	return 'UNLIMITED';	
}

Add Cron Job

Some scripts require a CRON job to be added under the user's account. This function should add a CRON job for a script. Return TRUE if cron job was added successfully else FALSE.

* @param string $min.
* @param string $hour.
* @param string $day.
* @param string $month.
* @param string $weekday.
* @param string $command.
function addcron($min, $hour, $day, $month, $weekday, $command, $mail = ''){		
	
	// This function should create a cron job on the machine where the script will be installed.
	// Certain scripts like Drupal require a cron job for certain activity.
	
	// NOTE : This has to be created on the machine where the script will be installed and not where the Softaculous is located.
	
	return true;
	
}

Delete Cron Job

Delete a CRON job of an installed script. Return TRUE if cron job was deleted successfully else FALSE

* @param string $command.
function delcron($command){	
	return true;
}

Blacklist Domains (Optional)

This function is optional. Choose list of domains you want to exclude for the user from existing list of domains owned by that user. Return array list of domains you want to blacklist with domain name as the key

* @param array $domains Existing Domains list under the user's account.
function blacklist_domains($domains){
	$blacklist_domains = array();
	return $blacklist_domains;
}

Control Panel Plans (Optional)

This function is optional. You can use this function to pass a list of plans by fetching it from your control panel. Once you pass the control panel plans here you will be able to create an ACL for users from Softaculous Admin panel -> Plans and assign scripts to the user as per the plan he is under. Return array list of control panel plans

function listcpplans(){
	$cpplans = array();	
	return $cpplans;
}


How to use Softaculous Remote

  • To access Enduser Panel visit http://<your-ip> or http://<your-domain> and (Port 443 for HTTPS)
  • To access Admin Panel visit http://<your-ip>:2006 and (Port 2007 for HTTPS)
  • To access phpMyAdmin visit http://<your-ip>/phpmyadmin/index.php or http://<your-domain>/phpmyadmin/index.php (index.php in the end is compulsory)
  • MySQL root password is stored at /usr/local/softaculous/conf/myconf

WEB API

List Scripts

Key Value Description
Authentication - You can use the Enduser Authenticating or Admin Authentication methods.
act blank or any Any act will do as this is available everywhere.


Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&act=home'.
			'&api=serialize';

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
 
// Get response from the server.
$resp = curl_exec($ch);

// Unserialize data
$res = unserialize($resp);

// The Installed scripts list is in the array key 'iscripts'
print_r($res['iscripts']);


Install a Script

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act software, js, perl The value should be "software" to install PHP script, "js" to install a JavaScript and "perl" to install a PERL script for softaculous to perform the action of installing a software.
soft 26 (26 is the Script ID of WordPress) The value should be "SID" for softaculous to perform the action of installing a software. You can find the list of sid's here
POST
softsubmit 1 This will trigger the install
softdomain domain.com This is the domain on which you wish to install the script
softdirectory wp This is the sub-directory to install the script in. Leave it blank to install in root of the domain
softdb wp123 This is the database name for the script. If the script does not require database you can leave this blank
dbusername wp123 This is the database user(Only for Softaculous Remote)
dbuserpass w1XRF28mq8 This is the database password. You can generate a random password(Only for Softaculous Remote)
hostname localhost This is the hostname of your MySQL server. You can enter your MySQL server IP if you have MySQL on a remote server(Only for Softaculous Remote)
admin_username admin This is the admin account username for the installation
admin_pass pass This is the admin account password for the installation
admin_email admin@domain.com This is the admin account email address for the installation
language en Language for the installation. You can get the language codes from the respective install.xml
site_name My Blog Site Name for the installation
site_desc My WordPress Blog Site Description for the installation
dbprefix dbpref_ (Optional) Table Prefix to be used for the tables created by application
noemail 1 (Optional) - Use this only if you do not want to send an email to the user
overwrite_existing 1 (Optional) - Use this only if you do not want Softaculous to check for existing files in installation path. If any file(s) exists they will be overwritten.


Example

// URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=software'.
                        '&soft=26';

$post = array('softsubmit' => '1',
              'softdomain' => 'example.com', // Must be a valid Domain
              'softdirectory' => 'wp', // Keep empty to install in Web Root
              'softdb' => 'wpdb',
              'dbusername' => 'dbusername',
              'dbuserpass' => 'dbuserpass',
              'hostname' => 'localhost',
              'admin_username' => 'admin',
              'admin_pass' => 'adminpassword',
              'admin_email' => 'admin@example.com',
              'language' => 'en',
              'site_name' => 'WordPress Site',
              'site_desc' => 'My Blog',
              'dbprefix' => 'dbpref_'
);

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


Edit an Installation

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act editdetail The value should be "editdetail" for softaculous to perform the action of editing an installation.
insid 26_12345 The installation ID that you want to edit. It can be fetched from List Installed Script
POST
editins 1 This will trigger the edit function
edit_dir /home/USERNAME/public_html (Optional) Path to installation. If not posted the path in existing records will be used.
edit_url http://example.com (Optional) URL to installation. If not posted the URL in existing records will be used.
edit_datadir /home/USERNAME/datadir (Optional) Path to data directory of the installation. If not posted the data directory in existing records will be used.
edit_dbname username_dbname (Optional) Database name for the installation. If not posted the Database name in existing records will be used.
edit_dbuser username_dbuser (Optional) Database user for the installation. If not posted the Database user in existing records will be used.
edit_dbpass dbpass (Optional) Password of the database user for the installation. If not posted the password in existing records will be used.
edit_dbhost localhost (Optional) Database host for the installation. If not posted the Database host in existing records will be used.
eu_auto_upgrade 1 (Optional) 1 to Enable auto upgrade option and 0 to disable. If not posted the existing setting will not be changed.
auto_upgrade_plugins 1 (Optional) 1 to Enable auto upgrade plugins option and 0 to disable. If not posted the existing setting will not be changed. (Currently this option is supported only in WordPress)
auto_upgrade_themes 1 (Optional) 1 to Enable auto upgrade themes option and 0 to disable. If not posted the existing setting will not be changed. (Currently this option is supported only in WordPress)
noemail 1 (Optional) - Use this only if you do not want to send an email to the user


Example

// URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=editdetail'.
                        '&insid=26_12345';

$post = array('editins' => '1',
              'edit_dir' => '/path/to/installation/', // Must be the path to installation
              'edit_url' => 'http://example.com', // Must be the URL to installation
              'edit_dbname' => 'wpdb',
              'edit_dbuser' => 'dbusername',
              'edit_dbpass' => 'dbuserpass',
              'edit_dbhost' => 'dbhost'
);

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}

// Print the entire output just incase !
print_r($res);


Upgrade an Installed Script

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act upgrade The value should be "upgrade" for softaculous to perform the action of upgrading an installation.
insid 26_12345 The installation ID that you want to upgrade. It can be fetched from List Installed Script
POST
softsubmit 1 This will trigger the upgrade


Example

// URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=upgrade'.
                        '&insid=26_12345';

$post = array('softsubmit' => '1');

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	// There might be some task that the user has to perform
	if(!empty($res['setupcontinue'])){

		echo 'Please visit the following URL to complete upgrade : '.$res['setupcontinue'];	

	// It upgraded
	}else{

		echo 'Upgraded successfully. URL to Installation : '.$res['__settings']['softurl'];	

	}

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}

// Print the entire output just incase !
print_r($res);


Clone an Installed Script

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act sclone The value should be "sclone" for softaculous to perform the action of cloning an installation.
insid 26_12345 The installation ID that you want to clone. It can be fetched from List Installed Script
POST
softsubmit 1 This will trigger the upgrade
softdomain domain.com This is the domain on which you wish to clone the installation
softdirectory wp This is the sub-directory to clone the installation in. Leave it blank to clone in root of the domain
softdb wp123 This is the database name for the cloned installation. If the script does not require database you can leave this blank.


Example

// URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=sclone'.
                        '&insid=26_12345';

$post = array('softsubmit' => '1',
              'softdomain' => 'example.com', // Must be a valid Domain
              'softdirectory' => 'wp', // Keep empty to install in Web Root
              'softdb' => 'wpdb'
);

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	echo 'Cloned successfully. URL to Installation cloned installation : '.$res['__settings']['softurl'];

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}

// Print the entire output just incase !
print_r($res);


Remove an Installed Script

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act remove The value should be "remove" to perform the action of removing an installed script.
insid 8 (Installation ID) Installation ID of the installed script. It can be fetched from List Installed Script
POST
removeins 1 This will trigger the remove install process
remove_dir 1 This is to remove the directory where the script is installed. If you do not want to remove the directory do not pass this key in post.
remove_datadir 1 This is to remove the data directory where the script is installed. If you do not want to remove the data directory do not pass this key in post.
remove_db 1 This is to remove the database of the installation. If you do not want to remove the database do not pass this key in post.
remove_dbuser 1 This is to remove the database user of the installation. If you do not want to remove the database user do not pass this key in post.
noemail 1 (Optional) - Use this only if you do not want to send an email to the user


Example

// URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=remove'.
                        '&insid=8';

$post = array('removeins' => '1',
              'remove_dir' => '1', // Pass this if you want the directory to be removed
              'remove_datadir' => '1', // Pass this if you want the data directory to be removed
              'remove_db' => '1', // Pass this if you want the database to be removed
              'remove_dbuser' => '1' // Pass this if you want the database user to be removed
		);

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);


Import an Installation

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act import The value should be "import" to perform the action of importing an installation.
soft 26 (26 is the Script ID of WordPress) The value should be "SID" for softaculous to perform the action of installing a software. You can find the list of sid's here
POST
softdomain example.com This will be the domain where your script is installed. Domain should be without http:// or https://
softdirectory wp (OPTIONAL) This will be the directory under the domain where your script is installed. Leave this blank if the script is installed in the root of domain.
softsubmit 1 This will trigger the import function.

Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=import'.
			'&soft=26';

$post = array('softsubmit' => 1,
		'softdomain' => 'example.com',
		'softdirectory' => 'wp');

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);


List Installed Script

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act installations The value should be "installations" to perform the action of listing installations.
showupdates true (OPTIONAL) The value should be "true" if you want to list only installations that have an update available for softaculous to perform the action of listing installations.

Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=installations';


// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);



List Outdated Installations/ Installations that need update

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act installations The value should be "installations" to perform the action of listing installations.
showupdates true The value should be "true" if you want to list only installations that have an update available for Softaculous to perform the action of listing installations.

Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=installations'.
			'&showupdates=true';


// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);


List Backups

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act backups The value should be "backups" to perform the action of listing backups.

Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=backups';


// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);


Backup an Installed Script

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act backup The value should be "backup" to perform the action of taking the backup of the installation.
insid 26_5454 (Installation ID) Installation ID of the installed script. It can be fetched from List Installed Script
POST
backupins 1 This will trigger the backup function.
backup_dir 1 This is to backup the directory
backup_datadir 1 This is to backup the data directory
backup_db 1 This is to backup the database
backup_location 2
(Location ID)
(Optional) - Location id of the backup location where you want to store your current backup. Default value will be the one saved in the installation's settings. You can find the location id from List Backup Locations
noemail 1 (Optional) - Use this only if you do not want to send an email to the user

Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=backup'.
			'&insid=26_4545';

$post = array('backupins' => '1',
              'backup_dir' => '1', // Pass this if you want to backup the directory
              'backup_datadir' => '1', // Pass this if you want to backup the data directory
              'backup_db' => '1', // Pass this if you want to backup the database
		);

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);


Restore an Installed Script

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act restore The value should be "restore" to perform the action of restoring the backup of the installation.
restore backup_time_insid.tar.gz (Backup File Name) Name of the Backup File. It can be fetched from List Backups
POST
restore_ins 1 This will trigger the restore function.
restore_dir 1 This is to restore the directory
restore_datadir 1 This is to restorethe data directory
restore_db 1 This is to restore the database
noemail 1 (Optional) - Use this only if you do not want to send an email to the user

Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=restore'.
			'&restore=backup_time_insid.tar.gz';

$post = array('restore_ins' => '1',
              'restore_dir' => '1', // Pass this if you want to restore the directory
              'restore_datadir' => '1', // Pass this if you want to restore the data directory
              'restore_db' => '1', // Pass this if you want to restore the database
		);

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);


Download Backups

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act backups The value should be "backups" to perform the action of downloading the backup of an installation.
download backup_time_insid.zip (Backup File Name) Name of the Backup File. It can be fetched from List Backups

Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=backups'.
			'&download=backup_time_insid.zip';


// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);


Delete Backups

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act backups The value should be "backups" to perform the action of downloading the backup of an installation.
remove backup_time_insid.zip (Backup File Name) Name of the Backup File. It can be fetched from List Backups

Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=backups'.
			'&remove=backup_time_insid.zip';


// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);


Edit Enduser Settings

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act settings The value should be "settings" to perform the action of updating the settings of a user.
POST
editsettings 1 This will trigger the edit settings function
language english The language you want to set for the user.
timezone 0 This is the timezone that you want to set for the user. User 0 to set the timezone to Server Default.

Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=settings;

$post = array('editsettings' => 1,
		'language' => 'english',
		'timezone' => '0');


// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);


Edit Enduser Email Settings

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act email The value should be "email" to perform the action of updating the email settings of a user.
POST
editemailsettings 1 This will trigger the edit email settings function
email admin@example.com (Optional) Pass a valid email to receive the updates, leave blank to leave the email unchanged.
ins_email 1 (Optional) Pass this as 1 to enable receiving email for new installations, off to disable the same.
rem_email 1 (Optional) Pass this as 1 to enable receiving email after removing an installation, off to disable the same.
editdetail_email 1 (Optional) Pass this as 1 to enable receiving email after editing an installation, off to disable the same.
backup_email 1 (Optional) Pass this as 1 to enable receiving email after backup of an installation, off to disable the same.
restore_email 1 (Optional) Pass this as 1 to enable receiving email after restore of an installation, off to disable the same.
clone_email 1 (Optional) Pass this as 1 to enable receiving email after cloning an installation, off to disable the same.
disable_all_notify_update 1 (Optional) Pass this as 1 to disable receiving update available notification email, off to enable the same.

Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=email;

$post = array('editemailsettings' => 1,
		'email' => 'admin@example.com',
		'ins_email' => '1');


// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);


Auto Sign On

Key Value Description
Authentication - You can use the Enduser Authenticating or Admin Authentication methods.
act sign_on The value should be "sign_on" to perform the action to get the sign on URL.
insid 26_12345 The installation ID that you want to edit. It can be fetched from List Installed Script
autoid abcdefghijklmnopqrstuvwxyz0123456789 This must be any 32 character random string.

Example

// The URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=sign_on'.
                        '&insid=26_12345'.
                        '&autoid=abcdefghijklmnopqrstuvwxyz0123456789';


// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

// Get response from the server.
$resp = curl_exec($ch);

On using this API, you will get the sign_on_url, upon accessing which the user will be logged in to the admin panel of the script. You can use the same URL to redirect the user as shown here:

$op = unserialize($resp);
header('Location: '.$op['sign_on_url']);








Domains Functions

List Domains

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act domains This will list the domains under the account that you are logged in as.


Example
// URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=domains';

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


Add Domain

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act adddomain This will trigger the add domain function under the account that you are logged in as.
POST
add_domain 1 This will trigger the add domain function
domain domain.com Name of the domain to be added
server_host ftp.domain.com (Optional) This is the server host which will be used as the host to connect via FTP/FTPS/SFTP.
ftp_user ftp_user User to connect to the FTP/FTPS/SFTP server
ftp_pass ftp_pass Password for User to connect to the FTP/FTPS/SFTP server
ftp_path /public_html Path to the directory relative to home directory of user for installations
backup_path /backups Path to the directory relative to home directory of user for storing backups
data_dir /datadir Path to the data directory which will be used to create data directories required by some scripts like Moodle. This should not be accessible by webserver.
protocol (Optional) ftp, ftps, sftp (Default: ftp) The Protocol to use for this domain
port 21 Port number to connect to the FTP/SFTP/FTPS server. FTP default is 21.
public_key (Optional) Public Key Path to Public Key. Specify only when sftp protocol is used
private_key (Optional) Private Key Path to Private Key. Specify only sftp protocol is used
passphrase (Optional) Passphrase Passphrase for Private Key. Specify only sftp protocol is used


Example
// URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=adddomain';


$post = array('add_domain' => 1,
		'domain' => 'example.com',
		'server_host' => 'ftp.example.com', // Optional
		'ftp_user' => 'ftp_user',
		'ftp_pass' => 'ftp_pass',
		'ftp_path' => '/public_html',
		'backup_path' => '/backups',
		'data_dir' => '/datadir',
		'protocol' => 'ftp',
		'port' => '21');

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


Edit a Domain

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act editdomain This will trigger the edit domain function under the account that you are logged in as.
did 1 This will will be the domain id of the domain which you want to edit. You can use the List Domains function.
POST
edit_domain 1 This will trigger the edit domain function
domain domain.com This is the updated domain
server_host ftp.domain.com (Optional) This is the updated server host which will be used as the host to connect via FTP/FTPS/SFTP.
ftp_user ftp_user This is the updated FTP User
ftp_pass ftp_pass This is the updated FTP Pass
ftp_path /public_html This is the updated FTP Path
backup_path /backups This is the updated backup path
data_dir /datadir This is the updated data directory
protocol (Optional) ftp, ftps, sftp (Default: ftp) The Protocol to use for this domain
port 21 This is the updated port
public_key (Optional) Public Key Path to Public Key. Specify only when sftp protocol is used
private_key (Optional) Private Key Path to Private Key. Specify only sftp protocol is used
passphrase (Optional) Passphrase Passphrase for Private Key. Specify only sftp protocol is used


Example
// URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=editdomain'.
			'&did=1';


$post = array('edit_domain' => 1,
		'domain' => 'example.com',
		'server_host' => 'ftp.example.com', // Optional
		'ftp_user' => 'ftp_user',
		'ftp_pass' => 'ftp_pass',
		'ftp_path' => '/public_html',
		'backup_path' => '/backups',
		'data_dir' => '/datadir',
		'protocol' => 'ftp',
		'port' => '21');

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


Delete a Domain

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act domains This will trigger the domains function under the account that you are logged in as.
delid 1 This will will be the domain id of the domain which you want to delete. You can use the List Domains function.
cleanins 1 (Optional) Passing this as 1 will delete all the installations under this domain. If you do not want to delete the installations for the domain being deleted leave this parameter empty.


Example
// URL
$url = 'http://your.softaculous.com/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=domains'.
			'&delid=1'.
			'&cleanins=1';

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


Admin Panel API

List Users

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act listuser This will trigger the list users function.


Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=listuser';

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


Add User

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act adduser This will trigger the add user function.
POST
saveuser 1 This will trigger the add user function
username testuser This is the username of the user you want to add. Note : Only lowercase characters are allowed in username
user_email admin@example.com This is the email of the user you want to add
num_users 0 (OPTIONAL) Leave this 0 if this is user is an enduser. If Reseller add the number of users they should be allowed to create


Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=adduser';


$post = array('saveuser' => 1,
		'username' => 'testuser',
		'user_email' => 'admin@example.com',
		'num_users' => '0');

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


Edit User

Key Value Description
Authentication - You can use the Enduser Authenticating or Admin Authentication methods.
act listuser This will trigger the edit user function.
nof 10 This will be the updated number of users to be allotted (Can be used for Reseller users only)
email email@xyz.com This will be the Email ID to be set for the user
updateuser newuser This is the new username that you want to set (Can be changed for non-reseller users only)
moduser testuser This is the username of the user you want to edit
modowner testuser This is the owner of the reseller. In case of Resellers they are owned by themselves


Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&email=email@xyz.com'.
			'&act=listuser'.
			'&nof=10'.
			'&updateuser=newuser'.
			'&moduser=testuser'.
			'&modowner=testuser';

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}

Delete User

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act listuser This will trigger the delete user function.
deluser testuser This will be the username of the user to be deleted
delowner root This is the owner username of the user you want to delete. Default owner is root if the user is not created by a reseller.


Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=listuser'.
			'&deluser=testuser'.
			'&delowner=root';

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


List Installations (Admin Panel)

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act installations This will trigger the list installations function.
POST
listinstallations 1 This will trigger the listinstallations function
users root;user1; (Optional) Pass ; separated list of users to filter installations by users
scripts WordPress;Joomla; (Optional) Pass ; separated list of scripts to filter installations by scripts
domains example.com;example2.com; (Optional) Pass ; separated list of domains to filter installations by domains


Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=installations';

$post = array('listinstallations' => 1,
              //'users' => 'root;user1;', // Pass this if you want the installation list of specific users
              //'scripts' => 'WordPress;Joomla;', // Pass this if you want the installation list of specific scripts
              //'domains' => 'example.com;example2.com;', // Pass this if you want the installation list of specific domains
              );

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res)){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}



List Outdated Installations (Admin Panel)

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act installations This will trigger the list installations function.
show outdated This will trigger the outdated installations list function
POST
listinstallations 1 This will trigger the listinstallations function
users root;user1; (Optional) Pass ; separated list of users to filter installations by users
scripts WordPress;Joomla; (Optional) Pass ; separated list of scripts to filter installations by scripts
domains example.com;example2.com; (Optional) Pass ; separated list of domains to filter installations by domains


Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=installations'.
			'&show=outdated';

$post = array('listinstallations' => 1,
              //'users' => 'root;user1;', // Pass this if you want the installation list of specific users
              //'scripts' => 'WordPress;Joomla;', // Pass this if you want the installation list of specific scripts
              //'domains' => 'example.com;example2.com;', // Pass this if you want the installation list of specific domains
              );

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res)){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


List Real Version (Admin Panel)

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act installations This will trigger the list installations function.
POST
listinstallations 1 This will trigger the listinstallations function
only_realversion 1 This will trigger the only_realversion function to list only installations in which the version in Softaculous records do not match with actual installation version

Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=installations';

$post = array('listinstallations' => 1, 'only_realversion' => 1);

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res)){

	print_r($res);

}


Update Real Version (Admin Panel)

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act installations This will trigger the list installations function.
POST
listinstallations 1 This will trigger the listinstallations function
only_realversion 1 This will trigger the only_realversion function to list only installations in which the version in Softaculous records do not match with actual installation version
list array('username-26_68351', 'username-26_68352') This will contain the array list for the installations which needs to be updated in Softaculous record(you will need to pass installation id which you will get from Real Version response in List Real Version

Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=installations';

$post = array('listinstallations' => 1, 'only_realversion' => 1, 'list' => array('username-26_68351', 'username-26_68352'));

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res)){

	print_r($res);

}


Installation Statistics (Admin Panel)

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act ins_statistics This will trigger the installation statistics function


Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=ins_statistics';

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


Add Plan (ACL)

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act addplans This will trigger the add plan function
POST
saveplan 1 This will trigger the add plan function
planname plan1 Plan name for the new plan being created
resellers_abc 1 (Optional) Use this only if you want to add a reseller to the plan. resellers_ is the prefix for adding a reseller and abc is the name of the reseller (that should already exist). Similarly pass a separate key for each reseller you want to add to the plan.
users_xyz 1 (Optional) Use this only if you want to add a user to the plan. users_ is the prefix for adding a user and xyz is the name of the user (that should already exist). Similarly pass a separate key for each user you want to add to the plan.
scripts_26 1 Use this to pass the scripts to be added to the plan. scripts_ is the prefix for adding a script and 26 is the id of the script to be added. Similarly pass a separate key for each script you want to add to the plan. Get Script ids


Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=addplans';

$post = array('saveplan' => '1',
	'planname' => 'plan1',
	'resellers_abc' => '1',
	'users_xyz' => '1',
	'scripts_26' => '1', // Add WordPress
	'scripts_413' => '1' // Add Joomla
); 

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


Edit Plan (ACL)

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act editplans This will trigger the edit plan function
plan plan1 This will be the plan name of the plan you want to edit
POST
saveplan 1 This will trigger the add plan function
planname plan1 Plan name for the new plan being created
resellers_abc 1 (Optional) Use this only if you want to assign a reseller to the plan. resellers_ is the prefix for adding a reseller and abc is the name of the reseller (that should already exist). Similarly pass a separate key for each reseller you want to assign to the plan.
users_xyz 1 (Optional) Use this only if you want to assign a user to the plan. users_ is the prefix for assigning a user and xyz is the name of the user (that should already exist). Similarly pass a separate key for each user you want to assign to the plan.
scripts_413 1 Use this to pass the scripts to be assigned to the plan. scripts_ is the prefix for assigning a script and 26 is the id of the script to be assigned. Similarly pass a separate key for each script you want to assign to the plan. Get Script ids


Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=editplans'.
			'&plan=plan1';

$post = array('saveplan' => '1',
	'planname' => 'plan1',
	'resellers_abc' => '1',
	'users_xyz' => '1',
	'scripts_543' => '1', // Add Drupal
	'scripts_72' => '1' // Add PrestaShop
); 

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


Delete Plan (ACL)

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act plans This is the default plans page act
delete plan1 This will be the plan name of the plan you want to delete


Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=plans'.
			'&delete=plan1';

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}


Enable / Disable Script

Key Value Description
Authenitcation - You can use the Enduser Authenticating or Admin Authentication methods.
act softwares This will trigger the enable/disable script function
POST
updatesoft Update Settings This will trigger the submit function for enabling/disabling the scripts
soft_26 1 Use it to Enable Script from Admin Panel. soft_ is the prefix for enabling a script and 26 is the id of the script to be enabled. Similarly pass a separate key for each script you want to enable. Get Script ids

Note: If you have 10 scripts Enabled. You want to Enable 1 more script you will need to pass all 11 scripts id in the POST data for it to Enable the script. The scripts which are not posted will be disabled.

Example

// URL
$url = 'http://your.softaculous.com:2006/index.php?'.
			'api_key=TESTAPIKEY'.
			'&api_pass=PASSPASSPASSPASSPASSPASSPASSPASS'.
			'&api=serialize'.
			'&act=softwares';

$post = array('updatesoft' => 'Update Settings',
	'soft_26' => 1, // WordPress
	'soft_18' => 1, // Joomla 2.5
	'soft_543' => 1, // Drupal 8
	'soft_11' => 1, // Open Blog
	'soft_3' => 1, // Serendipity
	'soft_34' => 1, // Dotclear
	'soft_14' => 1, // b2evolution
	'soft_470' => 1 // Ghost
);

// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}
 
// Get response from the server.
$resp = curl_exec($ch);
 
// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = unserialize($resp);
 
// Done ?
if(!empty($res['done'])){

	print_r($res);

// Error
}else{

	echo 'Some error occured';
	print_r($res['error']);

}

SDK

  • The Softaculous Remote SDK allows to perform all the basic functions performed by Softaculous Remote.
  • The API simplifies task such as Installing Scripts, Removing Scripts, Creating Domains, Deleting Domains, Adding Users, Removing Users, Editing User Details and such similar functions.
  • You can find the files in /usr/local/softaculous/sdk/ namely sdk.php and remote_sdk.php
  • Remote_API extends Softaculous_API (Softaculous SDK)
  • To Install, Remove, Upgrade installations refer Softaculous API.

List of Functions in Short

Here is the list of functions available for the developers:

Function Description For User Parameters
function createSession($username, $owner, $ip_address) Create Session Tokens All string $username The Username of the user
string $owner The owner of the user account
string $ip_address IP address where created session will be allowed.
function switchUser($username, $owner) Switch User Admin/Reseller string $username The Username of the user
string $owner The owner of the user account
function list_domains() List Domains All -
function add_domain($domain, $ftp_user, $ftp_pass, $ftp_path, $backup_path, $data_dir, $protocol, $port, $public_key, $private_key, $passphrase) Add a Domain All string $domain The Domain name
string $ftp_user The User with FTP access
string $ftp_pass Password for the above user
string $ftp_path Path to the directory relative to home directory of user for installations
string $backup_path Path to the directory relative to home directory of user for storing backups
string $data_dir Full path to the data directory which will be used to create data directories required by some scripts like Moodle. This should not be accessible by webserver.
string $protocol it can be only ftp, ftps or sftp. Default is ftp.
int $port Port through which Softaculous will connect to the server.
string $public_key Path to Public key.
string $private_key Path to Private Key.
string $passphrase Passphrase for Private Key.
function edit_domain($domain, $ftp_user, $ftp_pass, $ftp_path, $backup_path, $data_dir, $protocol, $port, $public_key, $private_key, $passphrase) Edit a Domain All string $domain The Domain name
string $ftp_user The User with FTP access
string $ftp_pass Password for the above user
string $ftp_path Path to the directory relative to home directory of user for installations
string $backup_path Path to the directory relative to home directory of user for storing backups
string $data_dir Full path to the data directory which will be used to create data directories required by some scripts like Moodle. This should not be accessible by webserver.
string $protocol it can be only ftp, ftps or sftp. Default is ftp.
int $port Port through which Softaculous will connect to the server.
string $public_key Path to Public key.
string $private_key Path to Private Key.
string $passphrase Passphrase for Private Key.
function delete_domain($domain) Delete a Domain All string $domain The Domain name
function list_users() List of Users Admin/Reseller -
function adduser($username, $email, $num_users) Add a User Admin/Reseller string $username User Name to add
string $email Email of the user
string $num_users (Optional) Number of Users a Reseller can add. Empty in case of Regular users.
function deleteuser($user, $owner) Delete a User Admin/Reseller string $user User Name to delete
string $owner (Optional) Owner of the User.
function edituser($username, $num_user) Edit User Admin/Reseller string $username User Name to Edit
int $num_user Number of Users to edit, empty in case of Regular users.

Enduser

Initializing

$rsdk = new Remote_API($url, $api_key, $api_pass);

This will load the Class in $rsdk with the paramaters: Parameters :

  • $url is the login URL to access the Softaculous Remote Enduser Panel.
  • $api_key is the Remote API KEY provided by Softaculous Installer or your Host to login to the Remote Enduser Panel.
  • $api_pass - is the Remote API PASSWORD provided by Softaculous Installer or your Host with API KEY to login to the Remote Enduser Panel.

These parameters are required for authentication, as without authentication you will not be able to access Softaculous Remote.

Example
include_once('remote_sdk.php');

$rsdk = new Remote_API('http://192.168.17.132', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd');

Session Tokens

function createSession($username, $owner = '', $ip_address = '')
  • Create a SESSION of a USER to enable the user to USE the Softaculous GUI Interface.

Parameters :

  • $username The username for the user you want to create a session.
  • $owner The owner who owns the account of user. By default it is root.
  • $ip_address IP address where created session will be allowed.

Return Values :

$resp Will contain a KEY 'rsid' with the session ID which can be used to redirect the user to $url.'?rsid='.$resp['rsid'];

Example
include_once('remote_sdk.php');

$rsdk = new Remote_API('http://192.168.17.132', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd');

$res = $rsdk->createSession('root', 'root', '192.168.17.131');

// Error
if(!empty($res['error'])){
	
	if(!empty($res['error'])){
		$rsdk->r_print($res['error']);
	}

// No error
}else{
	$rsdk->r_print($res);
}

Output will be:

Array
(
    [rsid] => itcqztcgbu8ngnqadiwsg3m98o0zrlcf
    [redirect_url] => http://192.168.17.131?rsid=itcqztcgbu8ngnqadiwsg3m98o0zrlcf
)

List Domains

function list_domains()
  • This function has no parameters, it will get you the list of domains.
Example
include_once('remote_sdk.php');

$rsdk = new Remote_API('http://192.168.17.132', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd');
$result = $rsdk->list_domains();
print_r($result);
  • Will give you the output :
Array
(
    [title] => List Domains
    [domain_list] => Array
        (
            [domain.com] => Array
                (
                    [did] => 4
                    [owner] => root
                    [username] => root
                    [domain] => domain.com
                    [ftp_user] => user
                    [ftp_pass] => password
                    [ftp_path] => /public_html
                    [path] => /home/user/public_html
                    [backup_dir] => /backups
                )

        )

    [timenow] => 1361009593
    [time_taken] => 0.016
.
.
.
  • In the above output, domains_list provides the list of domains. You can iterate through domains_list to perform actions.

Add a Domain

function add_domain($domain, $ftp_user, $ftp_pass = '', $ftp_path, $backup_path, $data_dir, $protocol = 'ftp', $port = '21', 
$public_key = '', $private_key = '', $passphrase = '')
  • This function will allow you to ADD a domain.

Parameters :

  • $domain is the domain to be added
  • $ftp_user is the User with the access to FTP/FTPS/SFTP.
  • $ftp_pass is the Password for the above user to access FTP/FTPS/SFTP.(Can be optional if protocol used is 'sftp' and authentication is by keys)
  • $ftp_path is the folder/path where your installations will be made.

Note : The path is absolute to FTP Users HOME directory.
E.g $ftp_path set to '/public_html' will be referred to as '/home/USER/public_html' when protocol is 'ftp' and 'ftps';
AND Full Path '/home/USER/public_html' when protocol is set to 'sftp' .

  • $backup_path is the folder/path where all the backups will be stored(If made any).

Note : The path is absolute to FTP Users HOME directory.
E.g $backup_path to '/backups' will be referred to as '/home/USER/backups' when protocol is 'ftp' and 'ftps';
AND Full Path '/home/USER/backups' when protocol is set to 'sftp'.

  • $data_dir is the full path to the data directory which will be used to create data directories required by some scripts like Moodle. This should not be accessible by webserver.

E.g $data_dir can be '/home/USERNAME/datadir'

  • $protocol is a string, it can be only 'sftp', 'ftps' or 'sftp'. Default value is 'ftp'
  • $port is the port number through which Softaculous will be connecting to the server. Default is 21
  • $public_key is the Absolute path to public key.(Specify only when protocol is 'sftp' and when you want to authenticate the user using keys)
  • $private_key is the Absolute path to private key. (Only for 'sftp' and must be specified with public key)
  • $passphrase is the pass phrase of the private key.(Optional and Only for 'sftp')


Return Values :

  • Result will be in array.
  • The result is stored in $result and if the domain was added successfully,
    • $result['done'] should be 1.
    • $result['error'] should be empty.
  • If the domain was not added successfully,
    • $result['done'] should be 0.
    • $result['error'] should be an array with error message.


Example for FTP
$rsdk = new Remote_API($url, $api_key, $api_pass);

// Add Domain
$res = $rsdk->add_domain('domain.com', 'user', 'password', '/public_html', '/backups', '/home/USERNAME/datadir');

// Error
if(!empty($res['error'])){
	
	print_r($res['error']);

// No error
}else{
        // $res['done'] will be TRUE
	print_r($res);
}


Example for FTPS
$rsdk = new Remote_API($url, $api_key, $api_pass);

// Add Domain
$res = $rsdk->add_domain('domain.com', 'user', 'password', '/public_html', '/backups', '/home/USERNAME/datadir', 'ftps', 21);

// Error
if(!empty($res['error'])){
	
	print_r($res['error']);

// No error
}else{
        // $res['done'] will be TRUE
	print_r($res);
}
Example for SFTP using Password
$rsdk = new Remote_API($url, $api_key, $api_pass);

// Add Domain
$res = $rsdk->add_domain('domain.com', 'user', 'password', '/home/USER/public_html', '/home/USER/backups', '/home/USERNAME/datadir', 22);

// Error
if(!empty($res['error'])){
	
	print_r($res['error']);

// No error
}else{
        // $res['done'] will be TRUE
	print_r($res);
}
Example for SFTP using Keys
$rsdk = new Remote_API($url, $api_key, $api_pass);

// Add Domain
$res = $rsdk->add_domain('domain.com', 'user', NULL, '/home/USER/public_html', '/home/USER/backups', '/home/USERNAME/datadir', 22,
 '/path/to/file.pub', '/path/to/file', 'passphrase');

// Error
if(!empty($res['error'])){
	
	print_r($res['error']);

// No error
}else{
        // $res['done'] will be TRUE
	print_r($res);
}
  • The output of code above in case of success will be :
Array
(
    [title] => Add a Domain
    [done] => 1
    [timenow] => 1361009724
    [time_taken] => 6.730
)
  • In case of failure the variable $res['error'] will contain :
Array
(
    [already_exists] => The submitted domain already exists in your account.
)

Edit a Domain

function edit_domain($domain, $ftp_user, $ftp_pass = '', $ftp_path, $backup_path, $data_dir, $protocol = 'ftp', $port = '21', 
$public_key = '', $private_key = '', $passphrase = '')
  • This function will allow you to EDIT a domain.

Parameters :

  • $domain is the domain to be added
  • $ftp_user is the User with the access to FTP/FTPS/SFTP.
  • $ftp_pass is the Password for the above user to access FTP/FTPS/SFTP.(Can be optional if protocol used is 'sftp' and authentication is by keys)
  • $ftp_path is the folder/path where your installations will be made.

Note : The path is absolute to FTP Users HOME directory.
E.g $ftp_path set to '/public_html' will be referred to as '/home/USER/public_html' when protocol is 'ftp' and 'ftps';
AND Full Path '/home/USER/public_html' when protocol is set to 'sftp' .

  • $backup_path is the folder/path where all the backups will be stored(If made any).

Note : The path is absolute to FTP Users HOME directory.
E.g $backup_path to '/backups' will be referred to as '/home/USER/backups' when protocol is 'ftp' and 'ftps';
AND Full Path '/home/USER/backups' when protocol is set to 'sftp'.

  • $data_dir is the full path to the data directory which will be used to create data directories required by some scripts like Moodle. This should not be accessible by webserver.

E.g $data_dir can be '/home/USERNAME/datadir'

  • $protocol is a string, it can be only 'sftp', 'ftps' or 'sftp'. Default value is 'ftp'
  • $port is the port number through which Softaculous will be connecting to the server. Default is 21
  • $public_key is the Absolute path to public key.(Specify only when protocol is 'sftp' and when you want to authenticate the user using keys)
  • $private_key is the Absolute path to private key. (Only for 'sftp' and must be specified with public key)
  • $passphrase is the pass phrase of the private key.(Optional and Only for 'sftp')

Return Values :

  • Result will be in array.
  • The result is stored in $result and if the domain was added successfully,
    • $result['done'] should be 1.
    • $result['error'] should be empty.
  • If the domain was not added successfully,
    • $result['done'] should be 0.
    • $result['error'] should be an array with error message.
Example for FTP
$rsdk = new Remote_API($url, $api_key, $api_pass);

// Edit Domain
$res = $rsdk->edit_domain('domain.com', 'user', 'password', '/public_html', '/backups', '/home/USERNAME/datadir');

// Error
if(!empty($res['error'])){
	
	print_r($res['error']);

// No error
}else{
        // $res['done'] will be TRUE
	print_r($res);
}
Example for FTPS
$rsdk = new Remote_API($url, $api_key, $api_pass);

// Edit Domain
$res = $rsdk->edit_domain('domain.com', 'user', 'password', '/public_html', '/backups', '/home/USERNAME/datadir', 'ftps', 21);

// Error
if(!empty($res['error'])){
	
	print_r($res['error']);

// No error
}else{
        // $res['done'] will be TRUE
	print_r($res);
}
Example for SFTP using Password
$rsdk = new Remote_API($url, $api_key, $api_pass);

// Edit Domain
$res = $rsdk->edit_domain('domain.com', 'user', 'password', '/home/USER/public_html', '/home/USER/backups', '/home/USERNAME/datadir', 22);

// Error
if(!empty($res['error'])){
	
	print_r($res['error']);

// No error
}else{
        // $res['done'] will be TRUE
	print_r($res);
}
Example for SFTP using Keys
$rsdk = new Remote_API($url, $api_key, $api_pass);

// Edit Domain
$res = $rsdk->edit_domain('domain.com', 'user', NULL, '/home/USER/public_html', '/home/USER/backups', '/home/USERNAME/datadir', 22,
 '/path/to/file.pub', '/path/to/file', 'passphrase');

// Error
if(!empty($res['error'])){
	
	print_r($res['error']);

// No error
}else{
        // $res['done'] will be TRUE
	print_r($res);
}


  • The output of code above in case of success will be :
Array
(
    [title] => Edit a Domain
    [done] => 1
    [thisdomain] => => Array
        (
            [did] => 18
                    .
                    .
    [timenow] => 1361009724
    [time_taken] => 6.730
)

Delete a Domain

function delete_domain($domain)
  • This function will allow you to Delete a domain.

Parameters :

  • $domain is the domain to be DELETED

Return Values :

  • Result will be in array.
  • The output is stored is stored in $result and if the domain was deleted successfully,
    • $result['done'] should be 1.
    • $result['error'] should be empty.
  • If the domain was not deleted successfully,
    • $result['done'] should be 0.
    • $result['error'] should be an array with error message.
Example
include_once('remote_sdk.php');

$rsdk = new Remote_API('http://192.168.17.132', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd');

$res = $rsdk->delete_domain('domain.com');

// Error
if(!empty($res['error'])){
	
	print_r($res['error']);

// No error
}else{
	// $res['done'] will be TRUE
	print_r($res);
}
  • The output of code above in case of success will be :
Array
(
    [title] => List Domains
    [done] => 1
    [domain_list] => Array
        (
            [domain1.com] => Array
                (
                    [did] => 5
                    [owner] => root
                    [username] => root
                    [domain] => domain1.com
                    [ftp_user] => user1
                    [ftp_pass] => password1
                    [ftp_path] => /public_html
                    [path] => /home/user1/public_html
                    [backup_dir] => /backups
                )

        )

    [timenow] => 1361009970
    [time_taken] => 0.038
)
  • In case of failure the error message will be available in the variable $res['error'] :
Array
(
    [no_domain] => Domain does not exist
)

Admin Functions

Initializing Admin panel

Note : The below functions are for the Softaculous Admin panel and hence you will have to initialize the admin panel. The port for Softaculous Admin panel is 2006

$rsdk = new Remote_API($url, $api_key, $api_pass);

This will load the Class in $rsdk with the paramaters:

  • $url is the login URL to access the Softaculous Remote Admin Panel.
  • $api_key is the Remote API KEY provided by Softaculous Installer or your Host to login to the Remote Admin Panel.
  • $api_pass - is the Remote API PASSWORD provided by Softaculous Installer or your Host with API KEY to login to the Remote Admin Panel.

These parameters are required for authentication, as without authentication you will not be able to access Softaculous Remote.

Example
include_once('remote_sdk.php');

$rsdk = new Remote_API('http://192.168.17.132:2006', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd');

Switch User

function switchUser($username = '', $owner = '')
  • This function is only for API. This function helps you to switch between the users.
  • Suppose you are a Admin and if you want to install a script for a user. You can login from your own details and use this function in between to switch to your user.
  • Only Admins and Resellers can use this function.

Parameters :

$username The username for the user Admin/Reseller want to switch to.
$owner The owner who owns the account of user. By default it is root.

Return Values : NULL

Example

In the following example root is logged in first with its API_KEY and API_PASS, then he switches to user abc. After switching, wordpress is installed as the user abc. Install function is explained in Softaculous SDK.
Similarly Admin/Reseller can perform tasks on behalf of their users.
Note : Once you have switched to the user level then you cannot switch back to Admin/Reseller. You will have to login again.

include_once('remote_sdk.php');

$rsdk = new Remote_API('http://192.168.17.132', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd'); // Admin Details

$res = $rsdk->switchUser('abc');

$data['softdomain'] = 'domain.com'; // OPTIONAL - By Default the primary domain will be used
$data['softdirectory'] = 'wp222'; // OPTIONAL - By default it will be installed in the /public_html folder
$data['admin_pass'] = 'pass';
$data['admin_email'] = 'admin@domain.com';
$data['softdb'] = 'wp222';
$data['dbusername'] = 'wp222';
$data['dbuserpass'] = 'wp222';
$data['site_name'] = 'Wordpess wp222';
$data['admin_username'] = 'admin';
$data['language'] = 'en';
$data['site_desc'] = 'WordPress API Test';

$res = $rsdk->install(26, $data); // 26 is the SCRIPT ID for Wordpress
$res = unserialize($res);
if(!empty($res['done'])){
	echo 'Installed';
}else{
	echo 'Installation Failed<br/>';
	if(!empty($res['error'])){
		print_r($res['error']);
	}
}

List Users

function list_users()
  • This function has no parameters, it will get you the list of users.
Example
include_once('remote_sdk.php');

$rsdk = new Remote_API('http://192.168.17.132:2006', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd');
$result = $rsdk->listusers();
print_r($result);
  • Will give you the output :
Array
(
    [title] => Softaculous - List User
    [error] => 
    [listusers] => Array
        (
            [owner_user] => Array
                (
                    [uid] => 3
                    [owner] => owner
                    [username] => user
                    [email] => 
                    [num_users] => 0
                    [disable_all_notify_update] => 0
                )

            [owner1_user1] => Array
                (
                    [uid] => 4
                    [owner] => owner1
                    [username] => user1
                    [email] => 
                    [num_users] => 0
                    [disable_all_notify_update] => 0
                )

            [owner2_owner2] => Array
                (
                    [uid] => 4
                    [owner] => owner2
                    [username] => owner2
                    [email] => 
                    [num_users] => 2
                    [disable_all_notify_update] => 0
                )

            [root_root] => Array
                (
                    [uid] => 4
                    [owner] => root
                    [username] => root
                    [email] => 
                    [num_users] => 0
                    [disable_all_notify_update] => 0
                )

            [root_user2] => Array
                (
                    [uid] => 4
                    [owner] => root
                    [username] => user2
                    [email] => 
                    [num_users] => 0
                    [disable_all_notify_update] => 0
                )
.
.
.
  • In the above output, listusers provides the list of domains. You can iterate through listusers to perform actions.


Add a User

function adduser($username, $email, $num_users)
  • This function will allow you to ADD a User. To add a Reseller, $num_users should be more than 1.

Parameters :

  • $username is the user name to be added
  • $email is the email of the user.
  • $num_users (Optional) is the number of users a reseller can add it should be more than one. Empty in case of Regular User.


Return Values :

  • Result will be in array.
  • The output is stored in $result if the user was added successfully,
    • $result['done'] should be 1.
    • $result['error'] should be empty.
  • If the user was not added successfully,
    • $result['done'] should be 0.
    • $result['error'] should be an array with error message.
Example
$rsdk = new Remote_API($url, $api_key, $api_pass);

$res = $rsdk->adduser('username', 'your_email@domain.com', 15);

// Error
if(!empty($res['error'])){
	
        print_r($res['error']);

// No error
}else{
	print_r($res);
}
  • The output of code above in case of success will be :
Array
(
    [title] => Softaculous - Add User
    [done] => 1
    [error] => 
    [timenow] => 1361016929
    [time_taken] => 0.116
)
  • The error message will be available in $res['error'] in case of failure :
Array
(
    [0] => The username is already in use
)


Edit a User

function edituser($username, $num_users)
  • This function will allow you to edit Number of Users allowed to a Reseller.

Parameters :

  • $username is the user name to be edited
  • $num_users (Optional) is the number of users reseller is to be allowed. It should be more than one. Empty in case of Regular user.


Return Values :

  • Result will be in array.
  • The result is stored in $result if the user was edited successfully,
    • $result['done'] should be 1.
    • $result['error'] should be empty.
  • If the user was not edited successfully,
    • $result['done'] should be 0.
    • $result['error'] should be an array with error message.
Example
$rsdk = new Remote_API($url, $api_key, $api_pass);

$res = $rsdk->edituser('username');

// Error
if(!empty($res['error'])){
	
	$rsdk->r_print($res['error']);

// No error
}else{
	$rsdk->r_print($res);
}
  • The output of code above in case of success will be :
Array
(
    [title] => Softaculous - List User
    [done] => 1
    [error] => 
.
.
.

Delete a User

function deleteuser($username, $owner)
  • This function will allow you to delete a User.

Parameters :

  • $username is the user name to be deleted
  • $owner is the owner of user.(Optional)


Return Values :

  • Result will be an array.
  • The result is stored in $result and if the user was deleted successfully,
    • $result['done'] should be 1.
    • $result['error'] should be empty.
  • If the user was not deleted successfully,
    • $result['done'] should be 0.
    • $result['error'] should be an array with error message.
Example
$rsdk = new Remote_API($url, $api_key, $api_pass);

$res = $rsdk->deleteuser('username');

// Error
if(!empty($res['error'])){
	
	print_r($res['error']);

// No error
}else{
	print_r($res);
}
  • The output of code above in case of success will be :
Array
(
    [title] => Softaculous - List User
    [done] => 1
    [error] => 
.
.
.

General Functions

List Installed Script

  • This is to list all the scripts which are allowed to enduser to install. (Do not confuse with List Installations)
  • You can refer Softaculous List installed Script doc for the detailed explaination.
  • Below is the example of how to use Install Function of Softaculous in Remote.
Example
$rsdk = new Remote_API('http://192.168.17.131', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd'); // user details

$rsdk->list_installed_scripts();
print_r($rsdk->iscripts);

Install a Script

  • Installing a Script from Softaculous Remote.
  • You can refer Softaculous Install API doc for the detailed explaination.
  • Below is the example of how to use Install Function of Softaculous in Remote.
Example
include_once('remote_sdk.php');

$rsdk = new Remote_API('http://192.168.17.131', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd'); // user details

$data['softdomain'] = 'domain.com'; // OPTIONAL - By Default the primary domain will be used
$data['softdirectory'] = 'wp222'; // OPTIONAL - By default it will be installed in the /public_html folder
$data['admin_pass'] = 'pass';
$data['admin_email'] = 'admin@domain.com';
$data['softdb'] = 'wp222';
$data['dbusername'] = 'wp222';
$data['dbuserpass'] = 'wp222';
$data['site_name'] = 'Wordpess wp222';
$data['admin_username'] = 'admin';
$data['language'] = 'en';
$data['site_desc'] = 'WordPress API Test';

$res = $rsdk->install(26, $data); // 26 is the SCRIPT ID for Wordpress (Refer List Installed Script Function to get the list)
$res = unserialize($res);
if(!empty($res['done'])){
	echo 'Installed';
}else{
	echo 'Installation Failed<br/>';
	if(!empty($res['error'])){
		print_r($res['error']);
	}
}

Remove a Script

  • Removing a Script from Softaculous Remote.
  • You can refer Softaculous Remove API doc for the detailed explaination.
  • Below is the example of how to use Remove API Function of Softaculous in Remote.
Example
$rsdk = new Remote_API('http://192.168.17.131', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd'); // user details

$res = $rsdk->remove('26_37054', $data); (26_37054 is the installation id which can be fetched from List Installations function)

$res = unserialize($res);
if(!empty($res['done'])){
	echo 'Removed';
}else{
	echo 'Removing Unsuccessful<br/>';
	print_r($res['error']);
}

Upgrade a Script

  • Upgrading a Script from Softaculous Remote.
  • You can refer Softaculous Upgrade API doc for the detailed explaination.
  • Below is the example of how to use Upgrade API Function of Softaculous in Remote.
Example
$rsdk = new Remote_API('http://192.168.17.131', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd'); // user details

$data['softbranch'] = '382'; // Script ID of the script you want to upgrade. (Refer List Installed Script Function to get the list)

$res = $rsdk->upgrade('92_69417', $data);
$_res = unserialize($res);
	
if(!empty($_res['done'])){
	echo 'Upgraded';
}else{
        echo 'Upgrade Failed<br/>';
        print_r($res['error']);
}

if(!empty($_res['setupcontinue'])){
        echo $_res['setupcontinue'].' Please visit the following link to complete the upgrade process.';
}

Backup a Script

  • Taking a Backup of the Script from Softaculous Remote.
  • You can refer Softaculous Backup API doc for the detailed explaination.
  • Below is the example of how to use Backup API Function of Softaculous in Remote.
Example
$rsdk = new Remote_API('http://192.168.17.131', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd'); // user details

$data['backup_dir'] = 1;

$data['backup_db'] = 1;

$data['backup_datadir'] = 0;

$data['backup_wwwdir'] = 0;

$res = $rsdk->backup('26_37054', $data);

$res = unserialize($res);
if(!empty($res['done'])){
	echo 'Backing up the installation.';
}else{
	echo 'Backup Failed<br/>';
	print_r($res['error']);
}

Restore a Script

  • Restoring a Script from the Backup created using Softaculous Remote.
  • You can refer Softaculous Restore API doc for the detailed explaination.
  • Below is the example of how to use Restore API Function of Softaculous in Remote.
Example
$rsdk = new Remote_API('http://192.168.17.131', 'pirrehjhzrkgwztr', 'odxzhipr4nhntkrcx1zjvf4cxysgaffd'); // user details

$data['restore_dir'] = 1;
$data['restore_db'] = 1;
$data['restore_datadir'] = 0;
$data['restore_wwwdir'] = 0;

// wp.26_60832.2012-07-26_10-13-33.zip is the Backup Name. Refer Backup List Function
$res = $rsdk->restore('wp.26_60832.2012-07-26_10-13-33.zip', $data); 

$res = unserialize($res);
if(!empty($res['done'])){
	echo 'Restored';
}else{
	echo 'Restoration Failed<br/>';
	print_r($res['error']);
}

Support

You can always ask us if you have any queries. The support department can be accessed from here : https://www.softaculous.net/support/