Riding OpenGTS Server, GPS Tracking.


OpenGTS (“Open GPS Tracking System”) is an open source project (Open Source) code developed to provide GPS tracking services online. Be a “fleet” of vehicles or Mobile devices.

Link Project: http://opengts.sourceforge.net/

With many customers for free and embedded GPS for Android with App GPS2OpenGTS Link: https://play.google.com/store/apps/details?id=com.wiebej.gps2opengtsfree

Vehicular embedded tracker – TK100


Installation Procedure
Based on Debian and Red Hat

Installing dependencies for OpenGTS.
Debian and Ubuntu:
$ sudo apt-get update
$ sudo apt-get install apache2 php5 mysql-server libmysql-java ant unzip openjdk-6-jre

Start the server database
$ sudo su -
# /etc/init.d/mysql start

Red Hat, CentOS and Fedora:

# yum update -y
# yum install apache2 php5 mysql-server libmysql-java ant unzip java-1.6.0-openjdk -y

Start the server database
$ su -
# /etc/init.d/mysqld start

Creating directory to download files:

$ sudo su -
# mkdir ~/open_gts
# cd ~/open_gts

Downloading and installing Tomcat:

# wget http://mirrors.fe.up.pt/pub/apache/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.zip
# unzip apache-tomcat-6.0.36.zip
# cp -r apache-tomcat-6.0.36 /usr/local/
# cd /usr/local/apache-tomcat-6.0.35/
# export CATALINA_HOME=/usr/local/apache-tomcat-6.0.35
# cd /usr/local/apache-tomcat-6.0.36/bin
# chmod a+x *.sh

Downloading OpenGTS:

# wget http://heanet.dl.sourceforge.net/project/opengts/server-base/2.4.7/OpenGTS_2.4.7.zip
# unzip OpenGTS_2.4.7.zip
# cp -r OpenGTS_2.4.7 /usr/local
# cd /usr/local/OpenGTS_2.4.7
# export GTS_HOME=/usr/local/OpenGTS_2.4.7

Copying MySQL Java Connector for Java directory:

# cp /usr/share/java/mysql-connector-java-5.1.10.jar /usr/lib/jvm/java-6-openjdk/jre/lib/ext

Copying the Java Mail directory for Java:

# cd ~/open_gts

Download the JavaMail by the Oracle site:


NOTE: I downloaded the file javamail1_4_5.zip.

# unzip javamail1_4_5.zip
# cp javamail-1.4.5/mail.jar /usr/lib/jvm/java-6-openjdk/jre/lib/ext

Variables JAVA_HOME, and CATALINA GTS_HOME. Add to or “rc.local” “bachrc.”:
(Remember if amd version, 64-bit java changes the way)

export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk
export GTS_HOME=/usr/local/OpenGTS_2.4.7
export CATALINA_HOME=/usr/local/apache-tomcat-6.0.36

Creating links OpenGTS:

# cd /usr/local
# ln -s $JAVA_HOME java
# ln -s $CATALINA_HOME tomcat
# ln -s $GTS_HOME gts

Giving permission for your user to the directory GTS_HOME.

Note: In the command, “user.user” put the user who will start the server:

# chown -R user:user $GTS_HOME

Start the MySQL database in Debians-like:

# /etc/init.d/mysql start

Start the MySQL database on Red Hat-like:

# /etc/init.d/mysqld start

Setting the root password for mysql if it was not defined in the installation
# mysqladmin -u root password "senhadorootmysql"

Creating the user to use the gps MySQL database:

# mysql --user=root mysql -p

> CREATE USER 'gps'@'localhost' IDENTIFIED BY 'P45sword';
> quit

OpenGTS the server settings
Note: I’m using Vim, but can use Gedit or Nano just replace the “come” with “nano” and etc … :)

# cd $GTS_HOME
# vim webapp.conf


Configure “config.conf” the OpenGTS:

# vim config.conf


Giving permission to access logs:

# cd $GTS_HOME
# chmod -R 777 logs

Start Tomcat:

# /usr/local/apache-tomcat-6.0.36/bin/startup.sh

Change language to Portuguese, in:

# vim private.xml


Configuring clients: gtsdmtp, tk10x and Aspicore. for SMS communication.

# cd $GTS_HOME
# vim dcservers.xml

In dcservers.xml configuration file will be:


or the device you want to change the ports.

Compile the project OpenGTS:

# ant all

Compile / track / Track (Web access):

# cd $GTS_HOME
# ant track
# cp build/track.war $CATALINA_HOME/webapps/

Compile GPRMC (access devices for receiving the coordinates):

# cd $GTS_HOME
# ant gprmc
# cp build/gprmc.war $CATALINA_HOME/webapps/

Creating the database:

# cd $GTS_HOME
# bin/initdb.sh -rootUser=root -rootPass=senhadorootmysql

Starting OpenGTS server:
# bin/runserver.sh -s template

Command to stop the server if you need to change some configuration and recompile:

# bin/runserver.sh -s template -kill

start TK10x SMS server to receive client information tk10x.
# bin/runserver.sh -s tk10x

Command to stop the server
# bin/runserver.sh -s tk10x -kill

Note: If you want to start Aspicore just start adding Aspicore at the end of the command line instead of tk10x.

Command to check which estancias are running.
# $GTS_HOME/bin/psjava
Command to check if port 31272 is listening commands.
# netstat -a | grep 31272
changes the command according to the service port.

Creating the Global Administrator user that will manage everything:

Mode Login Sysadmin:
ID: sysadmin
passwd: senhadosysadmin

# bin/admin.sh Account -account:sysadmin -pass:sysadmin -create

Edit Administrator “sysadmin”: (Putting the password)
# bin/admin.sh Account -account=sysadmin -edit

Creating the “User” to access the account:

Login User Mode:
ID: sysadmin
login: acesso01
passwd: senhaacesso01

# bin/admin.sh User -account=sysadmin -user=acesso01 -create

Editing the “User” put password to access the account:

# bin/admin.sh User -account=sysadmin -user=acesso01 -edit

Creating the “Vehicle” Client ID:

# bin/admin.sh Device -account=sysadmin -device=test01 -create

Edit the “Vehicle 01”:
# bin/admin.sh Device -account=sysadmin -device=test01 -edit
Opening the browser: http://localhost:8080/track/Track

Editing Unique ID, with only administrator account on: http://localhost:8080/track/Track?page=dev.info


Configuring Tomcat to start automatically.

Create the link to the service
# ln -s /usr/local/apache-tomcat-6.0.36/bin/startup.sh /etc/init.d/tomcat

Give execute permission
# chmod 755 /etc/init.d/tomcat

Add the service to the rc.d
# update-rc.d tomcat defaults

Configuring the service to start automatically OpenGTS.
# cd $GTS_HOME

Create iniciaopengts.sh file with the command:
# touch iniciaopengts.sh

Edit the file iniciaopengts.sh
# vim iniciaopengts.sh

Put the contents below:
# Inicio #
# chkconfig: - 91 35
# description: Starts and Stops OpenGts
$GTS_HOME/bin/runserver.sh -s template
# Fim #

Creating the link to the service
# ln -s $GTS_HOME/iniciaopengts.sh /etc/init.d/OpenGts

Give execute permission
# chmod 755 /etc/init.d/OpenGts

Add the service to the rc.d
# update-rc.d OpenGts defaults

Checking the installation:

# $GTS_HOME/bin/checkInstall.sh

Checking the logs on the server:

# tail -f logs/w-gprmc.log

Log server network:

# tcpdump port 8080 -vvv and not host ip.host.cliente.x



No comments yet.

Leave a Reply