Вы находитесь на странице: 1из 10

Ubuntu Server 10.04 Lucid - OpenGTS 2.3.

9 Installat ion 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 availa ble on your system # and how to activate them. For more information, s ee 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 netmask network broadcast gateway

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 localhost.localdomain gps.server.com gps localhost

# The following lines are desirable for IPv6 capabl e 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.server.com > /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 disab led & 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 l ibarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.6-dev libpcre3 libpopt-dev lynx m4 make nc ftp nmap openssl perl perl-modules unzip zip zlib1 g-dev autoconf automake1.9 libtool bison autotools -dev g++ build-essential Step 8. MYSQL aptitude install mysql-server mysql-client libmysql client16-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 les s secure. #bind-address = [...] /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-p refork apache2-utils apache2-suexec libexpat1 sslcert aptitude install libapache2-mod-php5 libapache2-mo d-ruby libapache2-mod-python php5 php5-common php5 -curl php5-dev php5-gd php5-idn php-pear php5-imag ick 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 no need to do th is but i prefer to be like that. pico /etc/apache2/mods-available/dir.conf DirectoryIndex index.html index.htm index.shtml in dex.cgi index.php index.php3 index.pl index.xhtml Then execute this commands. a2enmod a2enmod a2enmod a2enmod a2enmod a2enmod ssl rewrite suexec include dav_fs dav

/etc/init.d/apache2 restart Here i've disable ruby. pico /etc/mime.types #application/x-ruby /etc/init.d/apache2 restart Step 10. Install Perl modules: aptitude install libhtml-parser-perl libdb-file-lo ck-perl libnet-dns-perl libnetaddr-ip-perl libarch ive-tar-perl rb

Step 11. Add & Install repository and Java apt-get install python-software-properties add-apt-repository "deb http://archive.canonical.co m/ lucid partner" apt-get update apt-get -y install sun-java6-fonts sun-java6-jre su n-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 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 "your username" & "yourpassword") pico /usr/local/tomcat/conf/tomcat-users.xml <tomcat-users> <role rolename="manager"/> <user username="yourusername" password="yourpa ssword" roles="manager"/> </tomcat-users> Step 15. Edit envirionmet to be loaded when restarting. And PASTE sudo pico ~/.bashrc And PASTE in the end of file. 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/jav amail/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/l ib/ext/ wget -c http://dev.mysql.com/get/Downloads/Connect or-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/j re/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_PAS SWORD ./checkInstall.sh cp $GTS_HOME/build/track.war $CATALINA_HOME/webapp s/. (IF NEED, because after command "ant track.dep loy" 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 ln ln ln /usr/local -s $JAVA_HOME java -s $CATALINA_HOME tomcat -s $GTS_HOME gts

Step 21. And then start server with support for TK10x device s at port 31272 (example) ./runserver.sh -p 31272 -s tk10x -i Now little add. "runserver.sh can be copied as dif ferent servers (for tk10x, etc...) and can be conf igured inside the file (port and device). Also i've add at the top of this file this two comm and 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> : [optional] listen port

# -i : [optional] interactive # -kill : [optional] kill running serve r # 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/lo cal/tomcat/webapps/. STEP YYY. Do this step if you have only OpenGTS server and n o other sites, or you don't have some control pane l. cd /var/www pico index.php AND PASTE this code. <?php Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://website.com:8080/track/Tr ack" ); ?>

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 w ill edit this post.

Best regards: Petar Milenov admin@gpstrack.tk Special thx to: Martin Flynn OpenGTS Dev Staff