Autoinstaller API

From Sohowiki
(Difference between revisions)
Jump to: navigation, search
(6. Write the isp.conf.php file)
 
Line 1: Line 1:
==Here's the basic step by step for writing your own installer script==
+
Here's the basic step by step for writing your own installer script
  
===1. Ping our api to get latest build download link===
+
==1. Ping our api to get latest build download link==
  
  
Line 11: Line 11:
 
  $current_stable_info_array = unserialize($pubBuild);
 
  $current_stable_info_array = unserialize($pubBuild);
  
===2. Download build file===
+
==2. Download build file==
 
  $myfile = file_get_contents($current_stable_info_array['download_full']);
 
  $myfile = file_get_contents($current_stable_info_array['download_full']);
  
===3. Write file to server===
+
==3. Write file to server==
 
  <?php
 
  <?php
 
  $fp = fopen('/path/to/website/public_html/soho.tgz', 'w');
 
  $fp = fopen('/path/to/website/public_html/soho.tgz', 'w');
Line 21: Line 21:
 
  ?>
 
  ?>
  
===4. Extract downloaded build file===
+
==4. Extract downloaded build file==
 
  shell_exec('tar -xzvf /path/to/website/public_html/soho.tgz');
 
  shell_exec('tar -xzvf /path/to/website/public_html/soho.tgz');
  
===5. Create a database with its own username and password (with full privileges)===
+
==5. Create a database with its own username and password (with full privileges)==
 
Will leave this step up to you and your root-level coding magic.
 
Will leave this step up to you and your root-level coding magic.
  
Line 31: Line 31:
 
  IDENTIFIED BY 'passwordhere';
 
  IDENTIFIED BY 'passwordhere';
  
===6. Write the isp.conf.php file===
+
==6. Write the isp.conf.php file==
 
This is the config file that Soholaunch needs to run properly.
 
This is the config file that Soholaunch needs to run properly.
  

Latest revision as of 14:37, 22 October 2009

Here's the basic step by step for writing your own installer script

Contents

1. Ping our api to get latest build download link

# Pull data for current stable build
ob_start();
include("http://update.securexfer.net/public_builds/api-build_info-stable.php");
$pubBuild = ob_get_contents();
ob_end_clean();
$current_stable_info_array = unserialize($pubBuild);

2. Download build file

$myfile = file_get_contents($current_stable_info_array['download_full']);

3. Write file to server

<?php
$fp = fopen('/path/to/website/public_html/soho.tgz', 'w');
fwrite($fp, $myfile);
fclose($fp);
?>

4. Extract downloaded build file

shell_exec('tar -xzvf /path/to/website/public_html/soho.tgz');

5. Create a database with its own username and password (with full privileges)

Will leave this step up to you and your root-level coding magic.

CREATE DATABASE usergoeshere_whatever;
GRANT ALL PRIVILEGES ON usergoeshere_whatever.* to usergoeshere@localhost
IDENTIFIED BY 'passwordhere';

6. Write the isp.conf.php file

This is the config file that Soholaunch needs to run properly.

It goes here...

/path/to/website/public_html/sohoadmin/config/isp.conf.php

It look like this...

<?php exit; ?>

#########################################################
### SOHOLAUNCH V4.8 CONFIGURATION SETUP
#########################################################
this_ip=provx.soholaunch.com

db_server=localhost
db_name=usergoeshere_whatever
db_un=usergoeshere
db_pw=passwordhere

user_table=login
cgi_bin=/path/to/website/public_html/sohoadmin/tmp_content
doc_root=/path/to/website/public_html

dflogin_user=admin
dflogin_pass=admin

lang_set=english.php
lang_dir=/path/to/website/public_html/sohoadmin/language

template_lib=/path/to/website/public_html/sohoadmin/program/modules/site_templates/pages

map_obj=enabled
df_template_cat=Neutral
#########################################################

Done!

Personal tools