====== OpenGTS sur Debian ======
Notes d'installation. Pour tout commentaire ou suggestions, [[https://legoutdulibre.com|contactez-moi]].
1) Installation de paquets requis:
sudo apt install openjdk-7-jdk tomcat7 tomcat7-common libmail-java libmysql-java apache2 php5 mysql-server libmysql-java wget unzip ant ufw
Attention: bien noter le mot de passe SQL ($SQL_PASSWORD), devra être utilisé plus bas
2) Dans /etc/environment mettre:
GTS_HOME=/usr/local/gts
JAVA_HOME=./usr/lib/jvm/java-7-openjdk-amd64
CATALINA_HOME=/usr/share/tomcat7
ANT_HOME=/usr/bin/ant
et reboot
ou
echo ANT_HOME=/usr/bin/ant >> /etc/environment
echo GTS_HOME=/usr/local/gts >> /etc/environment
echo "JAVA_HOME="$(dirname $(dirname $(readlink \-f $(which javac)))) >> /etc/environment
echo CATALINA_HOME=/usr/share/tomcat7 >> /etc/environment
reboot
3) Liens symboliques pour lib Java, Tomcat et Java
sudo ln \-s /usr/share/java/mysql-connector-java.jar /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/mysql-connector-java.jar
sudo ln \-s /usr/share/java/javax.mail.jar /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/javax.mail.jar
sudo ln \-s $JAVA_HOME /usr/local/java
sudo ln \-s $CATALINA_HOME /usr/local/tomcat
4) Téléchargement et compilation
wget [http://downloads.sourceforge.net/project/opengts/server-base/2.6.3/OpenGTS_2.6.3.zip]
sudo unzip OpenGTS_2.6.3.zip \-d /usr/local
sudo ln \-s /usr/local/OpenGTS_2.6.3/ /usr/local/gts
cd /usr/local/gts
ant all
4.1) Vérifier l'installation
''$ bin/checkInstall.sh''
Example de sortie:
** Found 1 Error(s)!
******************************************************************************************
1) Tomcat contains non-'caadmin' owned file(s)
[Reason: Some files in the Tomcat folder are not owned by 'caadmin']
[Fix: Run 'chown -R caadmin:caadmin $CATALINA_HOME' to set the directory/file
ownership]
******************************************************************************************
-- Found 5 Warning(s):
1) Memory below recommended value
2) Optional '*mail.jar.jar' not found. (required for JavaMail support)
3) MySQL port may be accessible over Internet/Intranet!
4) Symbolic Link does not exist: /usr/local/java
5) Symbolic Link does not exist, or is invalid: /usr/local/tomcat
-- Recommendations:
- Highly recommend increasing memory to at least 4096 Mb for a production environment.
- Recommend closing MySQL port if external access is not required.
- Recommend creating /usr/local/java symbolic link to point to $JAVA_HOME:
ln \-s /usr/lib/jvm/java-7-openjdk-amd64 /usr/local/java
- Recommend creating /usr/local/tomcat symbolic link to point to $CATALINA_HOME:
ln \-s /usr/share/tomcat7 /usr/local/tomcat
5) Chargement de la BD
''bin/initdb.sh \-rootUser= \-rootPass=''
(utiliser root et $SQL_PASSWORD)
Exemple de sortie:
$ bin/initdb.sh -rootUser=root -rootPass=XXXXXXXXXXXXXXXXXXXX
Version: 2.6.3
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.3
Updating DMTP Version: 1.3.6
6) Bloquer le port MySQL de l'extérieur
-- à faire
7) Optionnel: configurer le courriel
7.1) aller dans custom.conf mettre les paramètres
7.2) Tester avec:
''/bin/checkInstall.sh -sendMail myemailaddress@example.com''
8) Création du compte admin
''/bin/admin.sh Account \-account=sysadmin \-pass=XXXXXXXXXXXXXX \-create''
Entry Point: org.opengts.db.tables.Account
Created Account-ID: sysadmin
9) Finaliser:
''ant track''
Copier track.war à /var/lib/tomcat7/webapps/
sudo cp build/track.war /var/lib/tomcat7/webapps/
sudo cp build/events.war /var/lib/tomcat7/webapps/
sudo service tomcat7 restart
NOTES:
Pour vérifier l'emplacement de TomCat:
# /usr/shar/tomcat7/bin/catalina.sh version