Open GTS 2.3.9 Manual for Ubuntu 10.04 Lucid

Help
2012-01-20
2013-07-06
  • Petar Milenov
    Petar Milenov
    2012-01-20

    Ubuntu Server 10.04 Lucid - OpenGTS 2.3.9 Installation

    **First of all we install Ubuntu server only with SSH server only !!!

    sudo passwd root
    enter root password then login with root.

    I will use "pico" as editor.**

    Step 1.

    pico /etc/network/interfaces

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface (and make static ip network mine look like this)
    auto eth0
    iface eth0 inet static
            address 192.168.1.10
            netmask 255.255.255.0
            network 192.168.1.0
            broadcast 192.168.1.255
            gateway 192.168.1.1

    Step 2.
    CTRL+Q (y) and restart network

    /etc/init.d/networking restart

    Step 3.
    It's good to edin and hosts file

    pico /etc/hosts

    127.0.0.1       localhost.localdomain   localhost
    192.168.1.10   gps.gpstrack.tk     gps

    # The following lines are desirable for IPv6 capable hosts
    ::1     localhost ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters

    Step 4.
    This can be skipped if you don't know what you do.

    echo gps.gpstrack.tk > /etc/hostname
    /etc/init.d/hostname restart
    hostname
    hostname -f

    Step 5.
    Now we make update and safe upgrade.

    aptitude update
    aptitude safe-upgrade

    reboot

    Step 6.
    I don't like apparmor and recommend you to be disabled & removed

    /etc/init.d/apparmor stop
    update-rc.d -f apparmor remove
    aptitude remove apparmor apparmor-utils

    Step 7.
    Now install some pkg. that will need later :) (All in one line)

    aptitude install binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.6-dev libpcre3 libpopt-dev lynx m4 make ncftp nmap openssl perl perl-modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev g++ build-essential

    Step 8.
    MYSQL

    aptitude install mysql-server mysql-client libmysqlclient16-dev

    Because i use remote access and want my SQL server to listen at all interfacess we edit mysql config file.

    pico /etc/mysql/my.cnf

    #
    # Instead of skip-networking the default is now to listen only on
    # localhost which is more compatible and is not less secure.
    #bind-address           = 127.0.0.1

    /etc/init.d/mysql restart
    netstat -tap | grep mysql

    you will see something like this

    tcp        0      0 *:mysql                 *:*                     LISTEN      624/mysqld

    Step 9.
    APACHE/PHP5/etc….

    aptitude install apache2 apache2-doc apache2-mpm-prefork apache2-utils apache2-suexec libexpat1 ssl-cert
    aptitude install libapache2-mod-php5 libapache2-mod-ruby libapache2-mod-python php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

    Here i edin a little apache2. It's need to do this but i prefer to be like that.

    pico /etc/apache2/mods-available/dir.conf

    DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml

    Then execute this commands.

    a2enmod ssl
    a2enmod rewrite
    a2enmod suexec
    a2enmod include
    a2enmod dav_fs
    a2enmod dav

    /etc/init.d/apache2 restart

    Here i've disable ruby.

    pico /etc/mime.types
    #application/x-ruby                             rb
    /etc/init.d/apache2 restart

    Step 10.
    Install Perl modules:

    aptitude install libhtml-parser-perl libdb-file-lock-perl libnet-dns-perl libnetaddr-ip-perl libarchive-tar-perl

    Step 11.
    Add & Install repository and Java

    apt-get install python-software-properties
    add-apt-repository "deb http://archive.canonical.com/ lucid partner"
    apt-get update
    apt-get -y install sun-java6-fonts sun-java6-jre sun-java6-plugin sun-java6-jdk libmysql-java

    Step 12.
    Install ANT

    apt-get install ant

    Step 13.
    Install TOMCAT 6

    wget http://apache.hoxt.com/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz
    tar xvzf apache-tomcat-6.0.32.tar.gz
    sudo mv apache-tomcat-6.0.32 /usr/local/tomcat

    sudo pico ~/.bashrc
      
    And PASTE
      
    export JAVA_HOME=/usr/lib/jvm/java-6-sun
      
    sudo nano /etc/init.d/tomcat
    And PASTE
      
      
    # Tomcat auto-start
    #
    # description: Auto-starts tomcat
    # processname: tomcat
    # pidfile: /var/run/tomcat.pid
    export JAVA_HOME=/usr/lib/jvm/java-6-sun
    case $1 in
    start)
               sh /usr/local/tomcat/bin/startup.sh
               ;;
       stop) 
               sh /usr/local/tomcat/bin/shutdown.sh
               ;;
       restart)
               sh /usr/local/tomcat/bin/shutdown.sh
               sh /usr/local/tomcat/bin/startup.sh
               ;;
       esac  
    exit 0

    Step 14.
    Just execute this commands

      
    sudo chmod 755 /etc/init.d/tomcat
    sudo ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat
    sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat
      
      
    And EDIT tomcat users (don't forget to change "yourusername" & "yourpassword")
      
    pico /usr/local/tomcat/conf/tomcat-users.xml
      
    <tomcat-users>
         <role rolename="manager"/>
         <user username="yourusername" password="yourpassword" roles="manager"/>
    </tomcat-users>
      
    Step 15.
    Edit envirionmet to be loaded when restarting (i still have problems with some but i've write little down a solution)

    pico /etc/environment
      
    And PASTE

    JAVA_HOME="/usr/lib/jvm/java-6-sun"
    ANT_HOME="/usr/share/ant"
    CATALINA_HOME="/usr/local/tomcat"
    GTS_HOME="/usr/local/OpenGTS"
      
    REBOOT !!!

    Step 16.
    Install Javamail & mysql-java connector

      
    wget -c http://download.oracle.com/otn-pub/java/javamail/1.4.4/javamail1_4_4.zip
    unzip javamail1_4_4.zip
    cp -p ~/javamail-1.4.4/mail.jar $JAVA_HOME/jre/lib/ext/
    ln -s /usr/share/java/javamail.jar $JAVA_HOME/jre/lib/ext/
    wget -c http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.18.tar.gz/from/http://mysql.mirrors.ovh.net/ftp.mysql.com/
    cd XXXXXX
    cp mysql-connector-java-5.1.18-bin.jar $JAVA_HOME/jre/lib/ext/.

    Make some links  
    ln -s /usr/local/OpenGTS_2.3.9 /usr/local/OpenGTS
    cd /usr/local/OpenGTS_2.3.9

    Step 17.
    Then we and all files and deploy track.war file.

    ant all
    ant track.war
    ant track.deploy

    Step 18.
    cd /usr/local/OpenGTS_2.3.9/bin

    ./initdb.sh -rootUser=root -rootPass=MYSQL_ROOT_PASSWORD
    ./checkInstall.sh
    cp $GTS_HOME/build/track.war $CATALINA_HOME/webapps/. (IF NEED, because after command "ant track.deploy" file must be deployed)

    Step 19.
    And create admin account

    ./admin.sh Account -account=admin -create
    ./admin.sh Account -account=admin -edit
    ./admin.sh Account -list

    Step 20.
    Some other links

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

    This i i've write because like i say i have some problems with envrioments file.

    export GTS_HOME=/usr/local/OpenGTS_2.3.9/
    export JAVA_HOME=/usr/lib/jvm/java-6-sun

    Step 21.
    And then start server with support for TK10x devices at port 31272
    ./runserver.sh -p 31272 -s tk10x -i

    Now little add. "runserver.sh can be copied as different servers (for tk10x, etc…) and can be configured inside the file (port and device).
    Also ive add at the top of this file this two command lines

    export GTS_HOME=/usr/local/OpenGTS_2.3.9/
    export JAVA_HOME=/usr/lib/jvm/java-6-sun

    so my file start like this

    #!/bin/bash
    # ---------------------------------------------------
    # Project: OpenGTS - Open GPS Tracking System
    # URL    : http://www.opengts.org
    # File   : runserver.sh
    # ---------------------------------------------------
    # Device Parser Server Startup
    #  Valid Options:
    #    -s <server>    : server name
    #    -p <port>      :  listen port
    #    -i             :  interactive
    #    -kill          :  kill running server
    #  Examples:
    #     % runserver.sh -s <server> -p 31000 -i
    # ---------------------------------------------------
    export GTS_HOME=/usr/local/OpenGTS_2.3.9/
    export JAVA_HOME=/usr/lib/jvm/java-6-sun

    STEP XXX. Do this step when reconfigure your server. (edit private.xml etc….)

    ant track
    cp /usr/local/OpenGTS_2.3.9/build/track.war /usr/local/tomcat/webapps/.

    I hope this solution is helpful, and please forgive me for my english (of some errors).
    Also my linux skills are not excelent.
    If someone have recommends to make some changes i will edit this post.
    Best regards:
    Petar Milenov

     
  • Petar Milenov
    Petar Milenov
    2012-01-20

    Little addon:

    in /var/www
    create file named "index.php"
    and paste

    <?php
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://192.168.1.10/track/Track" );
    ?>

    rm index.html
    this will redirect you directly to OpenGTS web interface :)

     
  • pss78
    pss78
    2012-01-30

    **Hi Petar Milenov

    I installed OpenGTS от windows XP and everything works great!
    Now i try to install OpenGTS 2.3.7 on Linux Ubuntu 10.10 and meet challenges. Acting in accordance with the instructions (in gts archive). When i type ANT ALL it is the following error:**

    root@134-0-112-82:/usr/local/OpenGTS_2.3.7# ant all
    Buildfile: build.xml

    clean:
        Deleting directory /usr/local/OpenGTS_2.3.7/build

    custom.jar:
          Skipping General Custom build …

    customtrack.jar:
          Skipping Track Custom build …

    custom:

    prepare:
         Created dir: /usr/local/OpenGTS_2.3.7/build
         Created dir: /usr/local/OpenGTS_2.3.7/build/lib
          OS = Linux
          JavaHome = /usr/lib/jvm/jdk1.6.0_26/jre

    BUILD FAILED
    /usr/local/OpenGTS_2.3.7/build.xml:181: Execute failed: java.io.IOException: Cannot run program "java" (in directory "/usr/lib/jvm/jdk1.6.0_26/jre"): java.io.IOException: error=2, No such file or directory

    Total time: 0 seconds
    root@134-0-112-82:/usr/local/OpenGTS_2.3.7#

    **Can you help me?

    jdk1.6.0_26
    OpenGTS 2.3.7**

     
  • Petar Milenov
    Petar Milenov
    2012-01-30

    build.xml
    Line 180-183
    <!- display Java version "java -version" on stdout ->
        <exec executable="java" dir="${java.home}" failonerror="true">
            <arg value="-version"/>
        </exec>

    check $JAVA_HOME = /usr/lib/jvm/jdk1.6.0_26/jre PATH :)

    and why is  JavaHome = /usr/lib/jvm/jdk1.6.0_26/jre
    i think it must be JAVA_HOME upper case and "_"
    also linux take care about UPPER and lower case :)

    ….Cannot run program "java" (in directory "/usr/lib/jvm/jdk1.6.0_26/jre"):….
    Good Luck

     
  • Petar Milenov
    Petar Milenov
    2012-01-30

    i forgot to tell you that no need to be /usr/lib/jdk1.6.0_26/jre

    root@gps:~# cd $JAVA_HOME
    root@gps:/usr/lib/jvm/java-6-sun# ls -la
    total 68
    drwxr-xr-x 8 root root  4096 2012-01-09 14:37 .
    drwxr-xr-x 4 root root  4096 2012-01-09 14:47 ..
    drwxr-xr-x 3 root root  4096 2012-01-09 14:37 bin
    lrwxrwxrwx 1 root root    13 2012-01-09 14:37 COPYRIGHT -> jre/COPYRIGHT
    drwxr-xr-x 2 root root  4096 2011-12-15 20:43 ext
    drwxr-xr-x 3 root root  4096 2012-01-09 14:37 include
    drwxr-xr-x 7 root root  4096 2012-01-09 14:36 jre
    drwxr-xr-x 3 root root  4096 2012-01-09 14:37 lib
    lrwxrwxrwx 1 root root    11 2012-01-09 14:37 LICENSE -> jre/LICENSE
    drwxr-xr-x 4 root root  4096 2012-01-09 14:36 man
    -rw-r-r- 1 root root 33526 2006-12-07 03:20 README.html
    lrwxrwxrwx 1 root root    10 2012-01-09 14:36 .systemPrefs -> /etc/.java
    lrwxrwxrwx 1 root root    31 2012-01-09 14:37 THIRDPARTYLICENSEREADME.txt -> jre/THIRDPARTYLICENSEREADME.txt
    root@gps:/usr/lib/jvm/java-6-sun#

     
  • pss78
    pss78
    2012-01-30

    Thanks for the answers

    I have this:

    root @ 134-0-112-82: / usr/local/OpenGTS_2.3.7 # cd $ JAVA_HOME
    root @ 134-0-112-82: / usr/lib/jvm/jdk1.6.0_26 # ls-la
    total 18 944
    drwxr-xr-x 10 root root 4096 Jan 30 09:15.
    drwxr-xr-x 3 root root 4096 Jan 30 9:14 ..
    -r - r - r - 1 root root 3339 April 2011 May COPYRIGHT
    -r - r - r - 1 root root 40 May April 2011 LICENSE
    -r - r - r - 1 root root 115 May April 2011 README.html
    -r - r - r - 1 root root 183 173 April 2011 May THIRDPARTYLICENSEREADME.txt
    drwxr-xr-x 2 root root 4096 April 2011 May bin
    drwxr-xr-x 7 root root 4096 April 2011 May db
    drwxr-xr-x 10 root root 4096 April 2011 May demo
    drwxr-xr-x 3 root root 4096 May April 2011 include
    drwxr-xr-x 7 root root 4096 Jan 30 09:15 jre
    drwxr-xr-x 3 root root 4096 Jan 30 09:15 lib
    drwxr-xr-x 4 root root 4096 April 2011 May man
    -r - r - r - 1 root root 5238 Jan 30 09:15 register.html
    -r - r - r - 1 root root 6684 Jan 30 09:15 register_ja.html
    -r - r - r - 1 root root 4841 Jan 30 09:15 register_zh_CN.html
    drwxr-xr-x 9 root root 4096 April 2011 May sample
    -rw-r - r - 1 root root 19104040 May April 2011 src.zip

     
  • Petar Milenov
    Petar Milenov
    2012-01-30

    use

    export JAVA_HOME="/export JAVA_HOME="/usr/lib/jvm/java-6-sun"

    and try

    and all

     
  • pss78
    pss78
    2012-01-30

    I do not know there it take       /usr/lib/jvm/jdk1.6.0_26/jre   :))

     
  • Petar Milenov
    Petar Milenov
    2012-01-30

    use

    export JAVA_HOME="/export JAVA_HOME="/usr/lib/jvm/jdk1.6.0_26"

    and try

    and all

    sry wrong paste :) in privious replay

     
  • pss78
    pss78
    2012-01-30

    I'm install    jdk1.6.0_17   and    set    JAVA_HOME=/usr/lib/jdk1.6.0_17

    but error all the exact same

    root@134-0-112-82:/usr/local/OpenGTS_2.3.7# ant all
    Buildfile: build.xml

    clean:
        Deleting directory /usr/local/OpenGTS_2.3.7/build

    custom.jar:
          Skipping General Custom build …

    customtrack.jar:
          Skipping Track Custom build …

    custom:

    prepare:
         Created dir: /usr/local/OpenGTS_2.3.7/build
         Created dir: /usr/local/OpenGTS_2.3.7/build/lib
          OS = Linux
          JavaHome = /usr/lib/jvm/jdk1.6.0_17/jre

    BUILD FAILED
    /usr/local/OpenGTS_2.3.7/build.xml:181: Execute failed: java.io.IOException: Cannot run program "java" (in directory "/usr/lib/jvm/jdk1.6.0_17/jre"): java.io.IOException: error=2, No such file or directory

     
  • Petar Milenov
    Petar Milenov
    2012-01-30

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

    before this
    java -version
    you will see:

    java version "1.6.0_26"
    Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
    Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

    if u see this then:

    export GTS_HOME=/usr/local/OpenGTS_2.3.7/
    export JAVA_HOME=/usr/lib/jvm/jdk1.6.0.17/

    then:
    ant all

     
  • pss78
    pss78
    2012-01-31

    error persists, the problem may be that the command java-version works only in the directory $ JAVA_HOME / bin

    root @ 134-0-112-82: / usr/lib/jvm/jdk1.6.0_17/bin #. / java-version
    java version "1.6.0_17"
    Java (TM) SE Runtime Environment (build 1.6.0_17-b04)
    Java HotSpot (TM) Client VM (build 14.3-b01, mixed mode)

    But in another directory such as

    root @ 134-0-112-82: ~ # java-version
    -bash: java: command not found

    How can I fix this?

     
  • pss78
    pss78
    2012-01-31

    it all ok!         i am just additional  install       openjdk-6-jre-headless

     
  • altuin
    altuin
    2013-03-21

    Hello!
    Thanks for the tutorial!

    I receive Permission denied when trying to run:

     ./initdb.sh -rootUser=root -rootPass=password
    

    I am able to log into mysql by typing: 

     mysql -u root -p
    

    and entering the root password.

    Any ideas what to do next?
    Thanks in advance!

     
  • Petar Milenov
    Petar Milenov
    2013-03-21

    sudo chmod 777 *.sh

    then

    ./initdb.sh -rootUser=root -rootPass=password

     
  • altuin
    altuin
    2013-03-22

    Thank you, pmilenov!

     
  • altuin
    altuin
    2013-03-25

    I get this when trying to run ./checkInstall.sh

    root@test:/usr/local/OpenGTS_2.4.7/bin# ./checkInstall.sh
    -----
    ERROR: 'build/lib/tools.jar' not found!
    Possible reasons may include one or more of the following:
     - This command is not being run from the OpenGTS installation directory
     - The OpenGTS project has not been compiled properly
    Current directory = /usr/local/OpenGTS_2.4.7/bin
    -----
    -----
    ERROR: 'build/track/WEB-INF/classes' not found!
    Possible reasons may include one or more of the following:
     - This command is not being run from the OpenGTS installation directory
     - The OpenGTS project has not been compiled properly
    This condition may cause false errors/warnings to be reported!
    -----
    Current Directory: /usr/local/OpenGTS_2.4.7/bin
    -----
    Error: Could not find or load main class org.opengts.tools.CheckInstall
    

    The tools.jar file is located where it should be but the I cannot se any track folder present.
    Any ideas what to to next?

     
  • Petar Milenov
    Petar Milenov
    2013-03-25

    It's normal to give u this error :) Just forget about checkinstall.sh :) and continue with installation. This is not a fatal error you will see when ant and deploying.

     
  • altuin
    altuin
    2013-03-28

    Hello!

    I try to access the following in chrome:
    http://192.168.1.10:8080/track/Track

    I have a login screen that requires account, user and pass but i don't know what to enter in the account text box.
    Can you please help me?

     
  • Petar Milenov
    Petar Milenov
    2013-03-31

    Look at step 19

     
  • altuin
    altuin
    2013-04-15

    Hello Pmilenov!

    How do I execute the runserver.sh automatically?
    I was trying update-rc.d but that requires the script to be in /etc/init.d/

     
  • khaled
    khaled
    2013-07-06

    Hello!
    I try to access the following address
    http://192.168.1.10:31272/track/Track
    it doesn't work
    please help me quickly
    thnx