【开源GPS追踪】 之 服务器端opengts安装
国内大多数GPS追踪/定位 平台都是基于opengts 二次开发的,opengts 是一款开源的gps 跟踪软件。
下面摘自百度百科:
OpenGTS ™(“GPS跟踪系统”)是第一个可用的开源项目,专门提供基于网络的 GPS 跟踪服务。 迄今为止,OpenGTS™已被下载并投入了使用于95个国家。车辆和跟踪资产类型包括出租车,送货面包车,卡车/拖车,农用设备,个人车辆,服务车辆,集装箱,船舶,全地形车,专人跟踪,手机等。 虽然OpenGTS ™设计以填补需求入门级船队跟踪系统为主,它也是非常高度可配置和可扩展性以及规模较大的框架。
====================================================================================================
安装opengts:
需求:一台具有公网ip 的电脑,这里我使用的virtwire 的廉价VPS。 系统采用的是Ubuntu,尝试在centos上安装,在安装jave jdk 的时候遇到点问题,由于对Centos 和Java 都不是很熟悉,就在网上查找,发现一篇在Ubuntu上安装的教程,按部就班安装,一切OK。
最小配置:硬盘 2GB ,内存64MB
下面是具体教程步骤:
install opengts in ubuntu system:
# sudo apt-get update
Install required software packages:
$ sudo apt-get install apache2 php5 mysql-server libmysql-java wget curl unzip ant
Provide mysql password during installation.

Start Mysql and apache2 services:
$ sudo /etc/init.d/mysql start
如果上面安装遇到一些奇怪的问题,请安装下面的工具
|
Had the same issue with mysql-server-5.6 and this solution hs helped me: launchpad: Bug #392051: [Karmic] logger command not found Basically, the program It can be recreated by reinstalling the package
or
|
$ sudo /etc/init.d/apache2 start
Install openjdk: 安装jdk6 为好,后面对应7的需要修改成6
$ sudo apt-get install openjdk-6-jdk
openjdk-7-jdk
Download and install Apache Tomcat version 7-x-x.
$ wget -c http://apache.mirror.uber.com.au/tomcat/tomcat-7/v7.0.65/bin/apache-tomcat-7.0.65.zip
上面这个链接已经失效了,请到 http://download.csdn.net/detail/duanfei255/9572008
Extract tomcat package and copy everything to /usr/local/ directory.
$ sudo unzip apache-tomcat-7.0.65.zip
$ sudo cp -av apache-tomcat-7.0.65 /usr/local/
Define CATALINA_HOME environment and run the startup script.
$ export CATALINA_HOME=/usr/local/apache-tomcat-7.0.65/
echo "export CATALINA_HOME=/usr/local/apache-tomcat-7.0.65/" >> ~/.bashrc
$ cd /usr/local
$ sudo ln -s $CATALINA_HOME tomcat
$ cd /usr/local/apache-tomcat-7.0.65/bin
$ chmod a+x *.sh
$ ./startup.sh
$ sudo ln -s $CATALINA_HOME /usr/local/tomcat

Define JAVA_HOME environment:
$ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
$ echo "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64" >> ~/.bashrc
$ sudo ln -s $JAVA_HOME /usr/local/java
Configure JAVA mail setup and Java Connector:
First Download and setup mysql Java connector, extract package and copy mysql java connector to $JAVA_HOME/jre/lib/ext folder
$ cd /tmp/ && wget http://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.37.tar.gz
上面这个链接也有问题,下载地址http://download.csdn.net/detail/duanfei255/9572009
$ tar -xvf mysql-connector-java-5.1.37.tar.gz
$ cd mysql-connector-java-5.1.37
$ sudo cp mysql-connector-java-5.1.37-bin.jar $JAVA_HOME/jre/lib/ext
Now download and configure Java mail setup and copy that downloaded .jar file to $JAVA_HOME/jre/lib/ext folder.
$ cd /tmp/ && wget https://maven.java.net/content/repositories/releases/com/sun/mail/javax.mail/1.5.4/javax.mail-1.5.4.jar
$sudo cp javax.mail-1.5.4.jar $JAVA_HOME/jre/lib/ext/
Rename javax.mail-1.5.4.jar to javax.mail.jar:
$ mv $JAVA_HOME/jre/lib/ext/javax.mail-1.5.4.jar $JAVA_HOME/jre/lib/ext/javax.mail.jar
Download OpenGTS:
$ cd /tmp && wget http://ncu.dl.sourceforge.net/project/opengts/server-base/2.6.0/OpenGTS_2.6.0.zip
Extract package to /usr/local folder:
$ sudo unzip OpenGTS_2.6.0.zip -d /usr/local/
Set up GTS_HOME environment:
$ export GTS_HOME=/usr/local/OpenGTS_2.6.0/
$ echo "export GTS_HOME=/usr/local/OpenGTS_2.6.0" >> ~/.bashrc
$ sudo ln -s $GTS_HOME /usr/local/gts
Change ownership for user currently logged in before running next command:
$ sudo chown -R unixmen:sudo /usr/local/OpenGTS_2.6.0/
Now change directory to $GTS_HOME and run following command:
&& ant all
If everything goes smooth, output will be something like below.

Define database user name and password (Note that we are still in $GTS_HOME).
$ bin/initdb.sh -rootUser=root -rootPass=password
Sample output:

Run ant track command which will create a file named track.war, we have to copy that file to $CATALINA_HOME/webapps folder.
$ ant track
Sample output:

$ cp $GTS_HOME/build/track.war /usr/local/apache-tomcat-7.0.65/webapps/ Before moving ahead stop and restart apache tomcat again $ $CATALINA_HOME/bin/startup.sh$ $CATALINA_HOME/bin/startup.sh
Open browser and type http://<ip_address>:8080/track/Track

Oops, we have not create a sysadmin account required to login the server, let us create it first.
$ cd $GTS_HOME/bin$ ./admin.sh Account -account=unixmen -pass=unixmen -create
Sample output

Now Provide these credentials and login

A welcome screen will appear:

Now installation and configuration part is over at this stage, configure your GPS tracking devices and you can use them with Open GTS.
Conclusion
Track application configuration
- Login to track application as sysadmin
- Use System Admin – System Accounts to create new account ‘acct’ with a password of your choice
- Logout and login as user ‘acct’
- In Administration – Vehicle Admin add new device ‘dev’. Optionally edit it and set Unique ID to ‘dev’.
- You should see your device location on the map in Mapping – Vehicle Map right after the first packet from your phone is sent in and accepted.
In the command line edit $GTS_HOME/webapp.conf. There is a section ‘GPS2OpenGTS configuration’ there. Set or uncomment these 2 lines:
#gprmc.parm.account=acct
#gprmc.parm.device=dev
Rebuild and redeploy track and gprmc applications:
cd $GTS_HOME
ant track && ant track.deploy && ant gprmc && ant gprmc.deploy
or
ant track
ant gprmc
cp those two in ...(add later)
For debugging purposes you may also try calling the URL with a browser or curl like:
http://username.jvmhost.net:YOUR_TOMCAT_HTTP_PORT/gprmc/Data?acct=acct&dev=dev&gprmc=$GPRMC,172413,A,3848.8028,N,08957.3521,W,0,000.0,171111,,*16
As per my knowledge very fewer documentations related to OpenGTS installation are available, but official documentation will be sufficient to configure it. One problem which was faced by me during installation process is that OpenGTS show error when it was configured with latest version of Apache Tomcat.

It is recommended that you should use Apache tomcat version 7.0.x for that purpose. Although this practical guide was tested in Mint Linux 17 , but I believe that it will also work with Ubuntu 14.04/15.10.
change the map provider(recomand google map)
cd $GTS_HOME
vi private.xml
than ant track
ant track
everything ok, ant pass, copy track.war to tomacat/webapps
sudo cp $GTS_HOME/build/track.war /usr/local/apache-tomcat-7.0.65/webapps/
reboot computer...
start tomacat
$CATALINA_HOME/bin/startup.sh
if use google map, should change the map.google.com to map.google.cn in code base(google.com is blocked by greet wall)
fix gprmc.war bug(may better ways)
when i use gprmc.war, sometime there is a error location in the map with wrong time and location!
this may be a error caused by gprmc.war interpreted error,this error occur very random.
fixed method:
add a line in gprmc only accept the point in china!--this can not eliminate the random error,but can reduce remarkable!
if(latitude >54 || latitude <3 || longitude >136 ||longitude <73)
return; // not in china
*****before**
/*create/insert new event record*/
重新编译
ant clean
ant all安装
复制 track.war 到tomat目录下的 webapps 下
cd $GTS_HOME
cp build/gprmc.war $CATALINA_HOME/webapps/.
或者用 ant 安装
cd $GTS_HOME
ant gprmc.deploy
设备端软件
我们这里设备端是Android系统的手机。软件用的是GPSLogger。位于:
https://github.com/mendhak/gpslogger。它支持OPENGTS的GPRMC上传。
修改地图提供者
默认地图提供者是:openLayers 。现在需要改成 google 。需要修改配置文件 $GTS_HOME/private.xml 。
vim $GTS_HOME/private.xml
找到包含 google 的标签 MapProvider。修改:
<MapProvider name="googleMaps"
active="${Domain.MapProvider.active=false}"
class="org.opengts.war.maps.jsmap.GoogleMaps"
key="${Domain.MapProvider.key=***PLACE_AUTHORIZATION_KEY_HERE***}"
rtPropPrefix="Domain.MapProvider.">
把 active=”${Domain.MapProvider.active=false}” 改成:active=”${Domain.MapProvider.active=true}”
注意,原代码中用的是 maps.google.com 域名,被天朝限制了。需要把它替换成: www.google.cn
vim $GTS_HOME\src\org\opengts\war\maps\jsmap\GoogleMaps.java
把其中的 maps.google.com 替换成 www.google.cn
Have fun!!
【开源GPS追踪】 之 服务器端opengts安装的更多相关文章
- 【开源GPS追踪】 之 为何费力不讨好
GPS追踪,在X宝上一搜一大堆,价格几十到几百层次不齐,为何还要自己开发? 1 对我来说,就是手头有这些硬件资源(GPRS GPS MCU)以及软件资源(VPS),算闲的蛋疼,其实不然,本人工作也很忙 ...
- 【开源GPS追踪】 之 手机端安卓版
GPS追踪,后台是利用的是开源的Opengts,可以通过web方式浏览位置信息.这里介绍一款手机端软件go Tracker. 这款软件是在Google app 上找到的,目前还没有找到源码,用了几天有 ...
- 【开源GPS追踪】 之 服务器硬伤
前面就说过了,目前GPS 追踪的原理都是通过GPRS将数据发送到一个服务器上,如果回看数据就从服务器上去数据,服务器在整个系统中具有举足轻重的地位. 如果服务器坏了,整个系统几千台设备可能也就无法工作 ...
- 【开源GPS追踪】 之 硬件开源
根据设定目标: 使用GPS 采集经纬度,然后通过GPRS模块/wifi 发送到服务器显示,WIFI不常有,所有就使用GPRS模块! 对于GPS模块,没有特殊要求,只要输出格式符合NMEA协议即可,为了 ...
- Linux环境下SVN服务器端的安装与配置
最近尝试了下在Linux(CentOS6.5)环境下安装与配置SVN服务器端,安装过程中碰到了一些问题,参看了网友们分享的一些心得,并通过自己实际的操作,最终安装与配置成功!总的来说网上的说法芸芸,大 ...
- 开源文档管理系统LogicalDOC测试报告---安装篇
开源文档管理系统LogicalDOC测试报告---安装篇 分类: Linux2011-06-22 15:40 7436人阅读 评论(3) 收藏 举报 文档管理测试mysql数据库installerja ...
- 利用cocoapods管理开源项目,支持 pod install安装整个流程记录(github公有库)
利用cocoapods管理开源项目,支持 pod install安装整个流程记录(github公有库),完成预期的任务,大致有下面几步: 1.代码提交到github平台 2.创建.podspec 3. ...
- Linux下Memcache服务器端的安装
最近在研究怎么让Discuz!去应用Memcache去做一些事情,记录下Memcache安装的过程. Linux下Memcache服务器端的安装服务器端主要是安装memcache服务器端,目前的最新版 ...
- C#中导出EXCEL服务器端不用安装OFFICE
在实际开发过程中,有时候服务器端没安装OFFICE,你和服务器管理员去商量安装个OFFICE的时候,管理员很倔犟的不给你安装的时候,这个时候就可以考虑我这个方法是实现导出EXCEL了.如果你导出的EX ...
随机推荐
- centos/redhat破解账号密码
说明:1.个人觉得centos系统和redhat系统差不多,界面都差不多一样. 2.下面方法用于开机root密码忘了,其他人篡改root密码等等 下面是破解账号密码(图解) 之后要等久点 效果: 方法 ...
- ubuntu下配置反向代理
1. 环境 ubuntu:Ubuntu 13.04 x86-64 apache2: 2.2.22-6ubuntu5.1 amd64 2. 配置 2.1 配置应用 增加监听端口 打开/etc/apac ...
- 20165206 实验一 Java开发环境的熟悉
20165206 实验一 Java开发环境的熟悉 一.实验内容及步骤 实验一 Java开发环境的熟悉-1 建立有自己学号的实验目录. 通过vim Hello.java编辑代码. 编译.运行Hello. ...
- pycaffe训练的完整组件示例
pycaffe训练的完整组件示例 为什么写这篇博客 1. 需要用到pycaffe 因为用到的开源代码基于Caffe:要维护的项目基于Caffe.基本上是用Caffe的Python接口. 2. 训练中想 ...
- es6 新增数据类型Symbol
es6在string number boolean null undefined object之外又新增了一种Symbol类型. Symbol意思是符号,有一个特性—每次创建一个Symbol值都是不一 ...
- js拷贝
现在有一个对象 var obj = { name: '隔壁老王', age: 60, sex: 'male' } 我们现在想把obj里的每一个属性拷贝到一个空对象var obj1 = {}中,那么需要 ...
- php第二天 开始连接数据库
php连接数据库有三种方法,分别是mysqli面向对象,mysqli面向过程,pdo. 1.查了资料,最终选择则了mysqli面向过程的方式,运行效率应该要高一些. 代码如下 <?php $se ...
- BZOJ2119 股市的预测 字符串 SA ST表
原文链接https://www.cnblogs.com/zhouzhendong/p/9069171.html 题目传送门 - BZOJ2119 题意 给定一个股票连续$n$个时间点的价位,问有多少段 ...
- CF552 E. Two Teams
题意:给出一串n个数 为1-n的乱序 一共有两个教练 教练一的队伍是1队 二是二队 教练一选择 当前队列中剩余人数的最大序号 将其和左边k个人 和右边k个人 变为一队 如此反复直到所有人 ...
- 013 mysql中find_in_set()函数的使用
在工作中遇见过,对于新知识,在这里写一写文档. 1.作用 举个例子,也许不理解,在看完后面的SQL示例,再来看就明白了: 有个文章表里面有个type字段,它存储的是文章类型,有 1头条.2推荐.3热点 ...