Document toolboxDocument toolbox

ServiceMobility 3.14.0 Installation

This document describes the process of installing ServiceMobility on a new, clean, system. 

Setup Notes

General

 Prior to installing ServiceMobility please ensure that all prerequisites have been met.

Linux Setup Notes

If installing on a Linux OS, you must be logged in as the user that the background services will eventually be running under. This ensures that files created during the setup process will have the correct permissions when running as a background service.

Verify Java JDK is Installed

It is important to make sure the Java JDK and not just the standard JRE is installed.

You can verify the JDK is installed by running the following command:

javac -version

The Java version must be 1.8.0_45 or later.

Extract the ServiceMobility zip file contents

Linux Zip Extract Instructions

It is assumed that you are logged into the system as the user which the background services will be running as.

  1. Unzip ServiceMobility.zip contents into home directory of the user that background service will be running as

    cd ~
    unzip ServiceMobility.zip

Microsoft Windows Zip Extract Instructions

Notes

  • There is an issue with the default Microsoft Windows unzip not supporting long directory trees in zip files. Therefore, you must use the 7z.exe unzip utility that has been provided with the ServiceMobility distribution.
  • It is recommended that ServiceMobility be installed on separate drive from the OS. Therefore this guide assumes that ServiceMobility will be installed on D:
  1. Unzip ServiceMobility

    D:
    cd \
    tools\7z x ServiceMobility.zip

Create ServiceMobility Database

  1. Create a new SQL Server database named ServiceMobility
  2. Create a SQL logon used to access the ServiceMobility database
    1. (warning) This logon information will be required later in the setup process
  3. Execute the following scripts on the ServiceMobility database
    1. sql/ServiceMobility-SoR.sql to create the initial database structure
    2. sql/SeedData.sql to initialize the database with default values
    3. sql/SeedData-Templates.sql to initialize the databases default templates

Create an Entity in the ServiceMobility Database

  1. Edit sql/USA.sql file and update the @EntityName variable with the desired entity name. Spaces are not allowed.
  2. Execute the sql/USA.sql script on the ServiceMobility database to create the new entity
  3. This new entity will have default logon of admin@EntityName (where EntityName is the value entered in step 1) with a default password of Password1!

Execute the Setup Script

The setup script will assists with collecting specific parameters and updating the appropriate configuration files. The setup script can be executed multiple times to change any setting at a later time. 

  1. Start the setup script
    1. Linux

      cd ~/ServiceMobility
      node/linux64/bin/node middlewares/up_auth/bin/setup.js 
    2. Windows

      D:
      cd \ServiceMobility
      node/win64/node middlewares/up_auth/bin/setup.js
  2. Once started, the script will first verify required directory and files exist

    1. If any errors are reported 
      • Verify the ServiceMobility zip was extracted to the proper (specified) location
      • Verify you are running the setup script from the proper directory
      • Verify the currently logged user has access to the reported directory or file
  3. Enter SQL Server properties
    1. After entering all of the properties the script will verify connectivity to SQL Server
      1. If the Script reports an Invalid Logon
        • Validate the ServiceMobility database has been created
        • Validate the entered credentials have proper access to the ServiceMobility database
        • Validate firewall settings to ensure the server has access to SQL Server over the entered port
      1. If the setup script reports an ETIMEOUT error
        • Validate the entered Server name
          • Try and ping the server
        • Validate the port number
          • Try and telnet to the server with the specified port
        • Validate firewall settings to ensure the server has access to SQL Server over the entered port
      2. If any error is reported you will have to option to re-enter the SQL Server properties or continue
  4. Enter SMTP Settings (optional but recommended)

    • ServiceMobility uses email to send alerts to administrators when there is a system error, sending Customer's PDF invoices, password reset notifications, etc.
  5. Amazon S3 Settings
    • Amazon S3 settings must be specified if you are planning to use the ServiceMobility photo capture functionality
  6. ActiveMQ Settings
    • For larger systems ActiveMQ and ESB can be installed on different servers. This setting identifies where the ActiveMQ server is located. 
  7. ServiceScheduling Settings
    • If ServiceMobility is integrated with ServiceScheduling then these settings are required. 
  8. Linux only - Enter the user the ServiceMobility service should be run as.

After all of the properties have been entered the script will:

  • Save a copy of the entered settings in ServiceMobility-opts.json
  • Update all of the appropriate configuration files
  • Exit

Configure JBoss Fuse ESB

  1. Start ESB Karaf Console

    cd ~/ServiceMobility/jboss-fuse/bin
    karaf
    
  2. Execute the following Karaf console commands

    karaf@root> features:install wrapper
    karaf@root> wrapper:install -s AUTO_START -n KARAF -d Karaf -D "Karaf Service"
    karaf@root> features:uninstall mq-fabric
    karaf@root> shutdown
    1. (warning) The shutdown process make a minute or two - be patient. 

  3. Update the ESB Karaf configuration file
    1. Edit ~/ServiceMobility/jboss-fuse/etc/KARAF-wrapper.conf

      nano ~/ServiceMobility/jboss-fuse/etc/KARAF-wrapper.conf

       

    2. Locate the wrapper.java.maxmemory settings and set it to 2048

      # Maximum Java Heap Size (in MB)
      wrapper.java.maxmemory=2048

Install ESB as a Service

The following section provides instructions on how to install the JBoss FUSE ESB as a service on either Linux or Microsoft Windows.

Linux Specific Instructions

  1. Edit ~/ServiceMobility/jboss-fuse/bin/Karaf-service
  2. Locate the RUN_AS_USER parameter and set it to the user the service should be run as
  3. Execute the following shell commands

    cd ~/ServiceMobility/jboss-fuse/bin
    sudo ln -s $PWD/KARAF-service /etc/init.d/KARAF-service
    sudo chkconfig KARAF-service --add
    sudo chkconfig KARAF-service on
  4. Start the ESB Service

    service KARAF-service start
  5. Stopping the ESB Service ( (warning) do not execute at this time)

    service KARAF-service stop

Microsoft Windows Specific Instructions

  1. Execute the following command line statements

    D:
    cd \ServiceMobility\jboss-fuse\bin
    KARAF-service.bat install
    net start "KARAF"

Install ActiveMQ as a Service

Linux Specific Instructions

  1. Execute the following commands

    cd ~/ServiceMobility/jboss-a-mq/bin
    sudo ln -s $PWD/env /etc/default/activemq
    sudo ln -s $PWD/activemq /etc/init.d/activemq
    sudo chkconfig --add activemq
    sudo chkconfig activemq on
  2. Start the ActiveMQ service

    service activemq start
  3. Stopping the ActiveMQ Service can be accomplished with the following command ( (warning) do not run it at this time).

    service activemq stop
Notes

Startup settings, including memory options are configured in /etc/default/activemq 

Microsoft Windows Specific Instructions

  1. Install ActiveMQ as a Windows Service

    D:
    cd \ServiceMobility\jboss-a-mq\bin\win64
    InstallService.bat install
  2. Start the ActiveMQ Service

    net start "activemq"
  3. The ActiveMQ Service can be stopped with the following command ( (warning)do not run it at this time)

    net stop "activemq"

Linux Only - Configure Local TCP Forwarding Rules

For security reasons, Linux servers restrict binding to TCP ports below 1024 to services running as the root user. Running services as root it not a recommended practice. Therefore, to get around what appears to be a catch-22 problem is to simply create local port forwarding rules.

Node.js is expecting HTTP traffic on internal TCP port 3001 and secure HTTPS traffic on internal TCP port 3000. The following steps will guide you through setting up the TCP port forwarding rules.

  1. Edit /etc/rc.local

    sudo nano /etc/rc.local
  2. Add the following lines to the end of the file

    iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 3000
    iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80  -j REDIRECT --to-port 3001
  3. Save

Install Node.js as a Service

Linux Specific Instructions

  1. Execute the following shell commands

    cd ~/ServiceMobility/middlewares/up_auth
    bin/installService.sh
  2. Add the following to /etc/init/env.conf file

    # /etc/init/env.conf
     env NODE_ENV=production

Microsoft Windows Specific Instructions

  1. Execute the following command line statements

    D:
    cd \ServiceMobility\middlewares\up_auth
    bin\installService.bat
  2. Add the following global environment variable

    NODE_ENV=production

Verify Installation

In the URLs below, replace ${HOST} with the host name or IP address of the server that was just configured.

 

  • The ServiceMobility mobile application is accessed from the following URL

    https://${HOST}/mobility/index.htm

  • The ServiceMobility Management Application is accessed from the following URL

    https://${HOST}/nexus/index.html

  • The ServiceMobility REST APIs are accessed from the following URL

    https://${HOST}/seiapi/v3/...

Related Articles