PrerequisitesIn this article we will be installing the Open GPS Tracking System on Ubuntu / CentOS. we are using the Ubuntu server 14.04 in our test environment. There are number of its prerequisites that we will have to setup first before the OpenGTS installation.
1) System UpdateLogin to your ubuntu / centos server using the root or sudo credentials to update your system using the below commands receptively.
# apt-get update # yum update
2) LAMP SetupAs we mentioned earlier that OpenGTS is a web based application, that's why we will setup the LAMP stack as a prerequisite of OpenGTS. We will be using the Apache Web server and MySQL data base in our LAMP stack. Let's run the below commands to install the required packages. For Ubuntu:
# sudo apt-get install apache2 php5 mysql-server libmysql-java wget curl unzip antFor CentOS:
# yum install httpd php5 mysql-server libmysql-java wget curl unzip antIn Ubuntu you will be asked to configure the root password on MySQL data base, choose your appropriate password and press OK to proceed. While in CentOS you can run the below command to setup the root password.
# mysql_secure_installationTo start mysql and apache services on your ubuntu or centos server you can use the below commands. For Ubuntu
# /etc/init.d/mysql start # /etc/init.d/apache2 startFor CentOS
# /etc/init.d/mysqld start # /etc/init.d/httpd start
3) JAVA SetupTo setup the JAVA environment we will be using the JAVA OpenJDK version 7 and then configure its environment using the below commands. For Ubuntu / centOS:
# apt-get install openjdk-7-jdkWhen the installation is complete setup the JAVA_HOME environment variables using the below commands.
# export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
# echo "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64" >> ~/.bashrc
4) Tomcat SetupTo install and configure the Tomcat setup follow the link to Download Tomcat, then copy the linked URL and download it using the wget command on the server.
# wget -c http://apache.mirror.uber.com.au/tomcat/tomcat-7/v7.0.65/bin/apache-tomcat-7.0.65.zipRun the command below to extract the above downloaded zipped package.
# unzip apache-tomcat-7.0.65.zipNow copy the package into the '/usr/local/' directory from teh current directory.
root@open-gts:~# cp -a apache-tomcat-7.0.65 /usr/local/By using the below commands we will setup the CATALINA_HOME environment for the tomcat.
# export CATALINA_HOME=/usr/local/apache-tomcat-7.0.65/
# cd /usr/local
# ln -s $CATALINA_HOME tomcat # cd $CATALINA_HOME/bin # chmod a+x *.shWhen the Catalina Home environment has been setup, run the command as shown below to start tomcat.
# echo "export CATALINA_HOME=/usr/local/apache-tomcat-7.0.65" >> ~/.bashrc
5) Setup JAVA ConnectorTo setup the JAVA connector, there's as mysql java connector package is available that we we download from the this LINK Download the connector package using the below wget command.
# wget -c http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.37.zipThen extract the zipped package and copy its files into the 'ext' directory of the JAVA_HOME by using below commands.
# unzip mysql-connector-java-5.1.37.zip
# cd mysql-connector-java-5.1.37/
# cp mysql-connector-java-5.1.37-bin.jar $JAVA_HOME/jre/lib/ext
JAVA Mail SetupTo install the Java mail setup, we can download the latest Jar repository from this LINK Copy the link address and download it using the below wget command in the command line interface.
# wget -c https://maven.java.net/content/repositories/releases/com/sun/mail/javax.mail/1.5.2/javax.mail-1.5.2.jarCopy this Jar repository in to the '/ext/' directoy and then change its name using the commands as shown below.
# cp javax.mail-1.5.2.jar $JAVA_HOME/jre/lib/ext/
# mv $JAVA_HOME/jre/lib/ext/javax.mail-1.5.2.jar $JAVA_HOME/jre/lib/ext/javax.mail.jar
Installing OpenGTSWe are ready to go with installation of OpenGTS Tracking System. We will be using the curl command to get the latest available package of OpenGTS from this LINK by using the below command.
# curl -L http://sourceforge.net/projects/opengts/files/server-base/2.6.0/OpenGTS_2.6.0.zip > OpenGTS_2.6.0.zipThen extract the OpenGTS package into the '/usr/local/' directory using below command.
# unzip OpenGTS_2.6.0.zip -d /usr/localIts recommended to run the OpenGTS with a general user, for this purpose we will run the below command to change the ownership.
# chown -R gts:sudo /usr/local/OpenGTS_2.6.0/Then export the environment variables to set the OpenGTS home environment.
# export GTS_HOME=/usr/local/OpenGTS_2.6.0/
# echo "export GTS_HOME=/usr/local/OpenGTS_2.6.0" >> ~/.bashrc
1) Setup EnvironmentTo setup the environment variables with ANT and creating the symbolinks, run the following commands.
# echo "export ANT_HOME=/usr/share/ant" >> ~/.bashrc # source ~/.bashrc
# ln -s $JAVA_HOME /usr/local/java # ln -s $CATALINA_HOME /usr/local/tomcat # ln -s $GTS_HOME /usr/local/gts
2) OpenGTS ConfigurationsOpen the default configuration file of OpenGTS to configure some of its basic parameters. To so do use the following command and uncomment the below mentioned line in the configuration file.
# vim $GTS_HOME/config.confSave the configuration file changes, and then list the CATALINA_HOME folder to check if it linked to its folder or not.
# ls -l $CATALINA_HOMEIn case if its pointing to itself then you can run the command below unlink it.
# unlink /usr/local/apache-tomcat-7.0.65/apache-tomcat-7.0.65
3) OpenGTS CompilationFinally we are ready to compile the OpenGTS, to do first change you directory to the GTS-HOME and the run the command to compile it with 'ant all' command as shown.
# cd $GTS_HOME
root@open-gts:/usr/local/OpenGTS_2.6.0# ant allThe compilation process will takes a while to compile all the required data.
4) OpenGTS InitializationTo initialize the OpenGTS database , we will be using the below command to by providing the root credetials of our database.
root@open-gts:/usr/local/OpenGTS_2.6.0# bin/initdb.sh -rootUser=root -rootPass=******This be creating the new database with name and user 'gts' and grant him the privileges as shown below.
Version: 2.6.0 Database created: gts Privileges granted to user: gts Validating table columns ... --------------------------------------------------------------------------- Table 'Account' --- Creating table ... Table 'AccountString' --- Creating table ... Table 'User' --- Creating table ... Table 'UserAcl' --- Creating table ... Table 'GroupList' --- Creating table ... Table 'Device' --- Creating table ... Table 'Transport' --- Creating table ... Table 'UniqueXID' --- Creating table ... Table 'DeviceGroup' --- Creating table ... Table 'DeviceList' --- Creating table ... Table 'Driver' --- Creating table ... Table 'EventData' --- Creating table ... Table 'Geozone' --- Creating table ... Table 'Resource' --- Creating table ... Table 'Role' --- Creating table ... Table 'RoleAcl' --- Creating table ... Table 'StatusCode' --- Creating table ... Table 'SystemProps' --- Creating table ... Table 'EventTemplate' --- Creating table ... Table 'PendingPacket' --- Creating table ... Table 'Property' --- Creating table ... Table 'Diagnostic' --- Creating table ... --------------------------------------------------------------------------- Column validation completed successfully. --------------------------------------------------------------------------- Updating GTS Version: 2.6.0 Updating DMTP Version: 1.3.6
5) Testing InstallationTo test the installation of OpenGTS run the below command with the home directory of GTS_HOME as shown below.
root@open-gts:/usr/local/OpenGTS_2.6.0# bin/checkInstall.shafter executing the above command you might see some errors, warnings and recommendation taht you you can figure them out.
6) Creating New AccountTo create the new admin account run the below command by mentioning your account name and password.
root@open-gts:/usr/local/OpenGTS_2.6.0# bin/admin.sh Account -account=sysadmin -pass=****** -create Entry Point: org.opengts.db.tables.Account Created Account-ID: sysadmin
7) Install Track Java ServletTo install the Track Java Servelet followed by copying its webapp, use the below commands.
root@open-gts:/usr/local/OpenGTS_2.6.0# ant track
root@open-gts:/usr/local/OpenGTS_2.6.0# cp build/track.war $CATALINA_HOME/webapps/
Open OpenGTS Web InterfaceOpen your web browser and give the below URL to access the web interface on OpenGTS GPS Tracking system to start tracking your devices. http://your_servers_ip:8080/track/Track In case if you unable to login using your credentials, then stop the Tomcat services and then restart it again using below commands.
#$CATALINA_HOME/bin/shutdown.sh #rm -rf $CATALINA_HOME/webapps/track* #cp $GTS_HOME/build/track.war $CATALINA_HOME/webapps/ #$CATALINA_HOME/bin/startup.sh
Welcome to OpenGTS GPS TrackingWe have successfully setup OpenGTS, by using its web console now you can easily manage and track vehicles.
ConclusionIn this article you have learned the installation and configuration of OpenGTS Open GPS Tricking system including all of its required dependencies on Ubuntu. Hope you under each and every stept that we performed in the article. This was only the server side setup, in our next article we will show you its client side setup for OpenGTS Testing. Leave your valuable comments or suggestions if you face any issue or your recommendations. Thanks - https://linoxide.com
- July 11, 2017 @ 19:40:20 [Current Revision] by admin
- July 11, 2017 @ 19:40:20 by admin
There are no differences between the July 11, 2017 @ 19:40:20 revision and the current revision. (Maybe only post meta information was changed.)