ServiceMobility 3.16.0 Installation - Linux
Linux Setup Notes
You must be logged into the Linux server 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 service.
General
- This document describes the process of installing ServiceMobility on a new, clean system. For upgrading an existing ServiceMobility installation see: Upgrading ServiceMobility
- Prior to installing ServiceMobility please ensure that all prerequisites have been met. See: ServiceMobility Hardware and Software Requirements
- It is important to make sure the Java JDK is install and not the standard JRE. You can verify the JDK 1.8.0_45 or later is installed by running the following command
javac -version
Install Red Hat A-MQ
Unpack the Red Hat A-MQ Distribution
cd ~ unzip jboss-a-mq-6.2.1.redhat-090.zip
Install Red Hat FUSE ESB
ServiceMobility 3.15.0 requires RedHat FUSE ESB version 6.2.0
Unpack the Red Hat FUSE ESB Distribution
cd ~ unzip jboss-fuse-6.2.0.redhat-133
Install Node.js
ServiceMobility 3.15.0 requires Node.js 6.1.0+.
Follow the instructions on the Node.js web site (https://nodejs.org/en/download/) for downloading and installing Node.js
Install ServiceMobility
Unpacking
Unpack the ServiceMobility.zip contents into the home directory of the user that the background Linux service will be running as. e.g.
cd ~ unzip ServiceMobility.zip
Creating the Initial Database
- Create a new SQL Server database named
ServiceMobility
- Create a SQL logon used to access the ServiceMobility database
- The logon information will be required later in the setup process
- Execute the following scripts on the
ServiceMobility
databasesql/ServiceMobility-SoR.sql
to create the initial database structuresql/SeedData.sql
to initialize the database with default valuessql/SeedData-Templates.sql
to initialize the databases default templates
- Create an initial Entity in the ServiceMobility Database
- Edit
sql/USA.sql
file and update the@EntityName
variable with the desired entity name. Spaces are not allowed. - Execute the
sql/USA.sql
script on theServiceMobility
database to create the new entity - This new entity will have default logon of
admin@EntityName
(where EntityName is the value entered in step 1) with a default password ofPassword1
!
- Edit
Configure ServiceMobility
The ServiceMobility setup script can be executed at any time to make changes to a new or existing configuration.
When the setup script first starts, it will verify the required directories and files exist. If any errors are reported verify the following:
- Verify that ServiceMobility was extracted to the proper 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
Execute the setup script
cd ~/ServiceMobility node middlewares/up_auth/bin/setup.js
- Enter SQL Server connection properties
- After entering all of the properties the script will verify connectivity to SQL Server
- 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
- 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
- If any error is reported you will have to option to re-enter the SQL Server properties or continue
- If the Script reports an Invalid Logon
- After entering all of the properties the script will verify connectivity to SQL Server
- 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.
- Amazon S3 Settings
- Amazon S3 settings must be specified if you are planning to use the ServiceMobility photo capture functionality
- ActiveMQ Settings
- For larger systems ActiveMQ and ESB can be installed on different servers. This setting identifies where the ActiveMQ server is located.
- ServiceScheduling Settings (optional)
- If ServiceMobility is integrated with ServiceScheduling then these settings are required
- 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
- Save a copy of the entered settings in
Configure JBoss Fuse ESB to run as a Linux Service
Start ESB Karaf Console
cd ~/ServiceMobility/jboss-fuse/bin karaf
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
The shutdown process make take a couple of minutes - be patient
Edit Karaf configuration file
nano ~/ServiceMobility/jboss-fuse/etc/KARAF-wrapper.conf
Locate the
wrapper.java.maxmemory
settings and set it to2048
. . # Maximum Java Heap Size (in MB) wrapper.java.maxmemory=2048 . .
- Edit
~/ServiceMobility/jboss-fuse/bin/Karaf-service
- Locate the
RUN_AS_USER
parameter and set it to the user the service should be run as 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
Start the ESB service
service KARAF-service start
Stopping the ESB Service
To stop the ESB service, execute the following command ( do not execute at this time)
service KARAF-service stop
Install ActiveMQ as a Service
ActiveMQ startup settings, including memory options are configured in /etc/default/activemq
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
Start the ActiveMQ service
service activemq start
Stopping the ActiveMQ Service can be accomplished with the following command do not run it at this time
service activemq stop
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.
Edit
/etc/rc.local
sudo nano /etc/rc.local
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
- Save
Install Node.js as a Service
Execute the following shell commands
cd ~/ServiceMobility/middlewares/up_auth bin/installService.sh
Add the following to /etc/init/env.conf file
# /etc/init/env.conf env 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