Difference between revisions of "Installing LXW"

From ISoft Wiki
Jump to: navigation, search
m (Added the Note section)
(Configure config.json: Removing unnecessary data)
Line 37: Line 37:
  
 
===Configure config.json ===
 
===Configure config.json ===
An example of LKQ's config.json
+
An example of a config.json
  
<code>  
+
<code lang="json">  
  
 
  {
 
  {
         "update_url": "https://isupdate:UpD8Me@www.isoftdata.com:443/autoupdate/update.php",
+
         "update_url": "autoupdate URL here",
         "product_code": "8298525",
+
         "product_code": "valid product code here",
 
         "download_directory": "/var/www/lxw-release/updater/downloaded-all",
 
         "download_directory": "/var/www/lxw-release/updater/downloaded-all",
 
         "destination_directories": {
 
         "destination_directories": {
                 "default": "/var/www/lxw-release/updater/downloaded-latest"/*,
+
                 "default": "/var/www/lxw-release/updater/downloaded-latest",
 
         },
 
         },
 
         "extraction_directories": {
 
         "extraction_directories": {

Revision as of 12:09, 1 March 2013

The new version of ITrack LX, colloquially known as LXW, is the faster and sexier version of ITrack designed to run in the browser, primarily on handheld scanner devices.

Dependencies

Besides the regular version of MySQL used by ITrack Enterprise, LXW requires:

Installing the server-side code

This is the PHP code that talks to the database! It should be checked out somewhere that is not accessible via HTTP.

The directory to check out is https://svn.isoftdata.com/svn/Web/tinymvc-branches/lxw-release.

To configure the database connection, edit /lxw/configs/database.php.

Installing the client-side code

This is the code that is accessible via HTTP! Check it out to your Apache htdocs folder, or whatever other folder will get it served up to the tubes.

The directory to check out is https://svn.isoftdata.com/svn/Web/tinymvc-branches/lxw-release/lxw/client.

To configure the connection to the server-side code: edit line 15 of server/index.php to point it at the path where you checked out the server-side code.

To configure client application settings (which should all have reasonable defaults), you can edit the config.js file in the client path.

Setting Up the Auto-Updater

This is the process that will download updates for LXW and then install them.

https://svn.isoftdata.com/Web/javascript-trunk/isoft-updater-example/

  1. Transfer contents of this directory to the server hosting LXW. The standard directory for Linux based servers is /var/www/lxw/updater (This directory will not exist yet.)
  2. Configure config.json
  3. Run the .sh files
    1. install.sh
    2. run.sh
  4. Add updater to crontab

Configure config.json

An example of a config.json

{
       "update_url": "autoupdate URL here",
       "product_code": "valid product code here",
       "download_directory": "/var/www/lxw-release/updater/downloaded-all",
       "destination_directories": {
               "default": "/var/www/lxw-release/updater/downloaded-latest",
       },
       "extraction_directories": {
               "LXW-client.zip": "/var/www/html/lxw",
               "LXW-server.zip": "/var/www/lxw-release"
       }
}

After the updater is run properly then a new section will appear below this section and it will look like this.

"versions": {
"LXW-client.zip": "#####",
"LXW-server.zip": "#####"
}

Run .sh Files

Unfortunately as of February 25th 2013 you are unable to run the .sh files as they will be unable to find the config file. Instead you can run the contents of the files without any problem. Here is an example of each file as you would use it for LKQ.

install.sh

sudo npm install isoft-updater -g

run.sh

node /lib/node_modules/isoft-updater /var/www/lxw-release/updater/config.json

Add Updater to Crontab

The last bit to setting up the auto updater is the "auto" part. Here is how to access and edit the crontab.

crontab -e

This is what LKQ's crontab looks like for the autoupdater.

 12 21  *   *   *   node /lib/node_modules/isoft-updater /var/www/lxw-release/updater/config.json

This is the format that crontab uses.

*  *  *  *  *  command to be executed
-  -  -  -  -
|  |  |  |  |
|  |  |  |  +----- day of week (0 - 6) (Sunday=0)
|  |  |  +------- month (1 - 12)
|  |  +--------- day of month (1 - 31)
|  +----------- hour (0 - 23)
+------------- min (0 - 59)

Note

Removing the version section in config.json will cause it to redownload the latest update during the next scheduled update cycle or forced update. Can be used to test the process.

Testing

Browsing to the [the URL you would expect to correspond to the client-side files you installed]/server/index.php should show you a snide remark embedded in JSON.

Browsing to the regular URL should show you a screen asking you to identify your store number (assuming that your web server is configured to serve up index.html files when you browse to a directory).