projects:mdm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
projects:mdm [2020/12/04 08:12] – created igorprojects:mdm [2022/03/10 09:19] (current) – [gestione app] sscipioni
Line 1: Line 1:
 ===== mobile device management (MDM) ====== ===== mobile device management (MDM) ======
 +
 +==== gestione app ====
 +
 +  * https://gianomdm.comune.verona.it/hmdm/
 +
 +scaricare apk o xapk da https://m.apkpure.com/it/
 +
 +{{ :projects:mdm1.png?400 |}}
 +
 +
 +
 +{{ :projects:mdm2.png?400 |}}
 +
 +
 +caricare su gianomdm il package 
 +
 +{{ :projects:mdm3.png?400 |}}
 +
 +
 +
 +{{ :projects:mdm4.png?400 |}}
 +
 +
 +
 +{{ :projects:mdm5.png?400 |}}
 +
 +
 +
 +{{ :projects:mdm6.png?400 |}}
 +
 +
 +assegnare il package al gruppo di test, ad esempio 'supervigili'
 +
 +{{ :projects:mdm7.png?400 |}}
 +
 +
 +successivamente, dopo i test, assegnare il package al gruppo 'vigili'
 +
 +{{ :projects:mdm8.png?400 |}}
 +==== intro ====
 +
  
 Sito di riferimento: https://h-mdm.com/ Sito di riferimento: https://h-mdm.com/
  
 +Focal (20.04) install per default Tomcat9
 +https://qa.h-mdm.com/5022/how-to-install-headwind-mdm-on-ubuntu-20-04
 +
 +Le credenziali di Postgres e del portale sono nella macchina alla posizione:  /root/accesso-credenziali.txt
 +
 +
 +Accesso portale comune di Verona: https://android.giano.comune.verona.it/hmdm
 +utente: admin
 +password: eur...
 ==== Installazione server ==== ==== Installazione server ====
  
 <code bash> <code bash>
 ubuntu@h-mdm:~$ sudo apt update ubuntu@h-mdm:~$ sudo apt update
-ubuntu@h-mdm:~$ sudo apt install openjdk-8-jdk aapt tomcat8 postgresql +ubuntu@h-mdm:~$ #### sudo apt install openjdk-8-jdk aapt tomcat8 postgresql 
-ubuntu@h-mdm:~$ sudo apt install unzip+ubuntu@h-mdm:~$ apt install  aapt postgresql tomcat9 unzip
  
-ubuntu@h-mdm:~$ wget https://h-mdm.com/files/hmdm-3.30-install-ubuntu.zip +ubuntu@h-mdm:~$ wget https://h-mdm.com/files/hmdm-3.31-install-ubuntu.zip 
-ubuntu@h-mdm:~$ unzip hmdm-3.30-install-ubuntu.zip +ubuntu@h-mdm:~$ unzip hmdm-3.31-install-ubuntu.zip 
 </code> </code>
  
-=== Preparazione database ===+=== tomcat9 === 
 + 
 +La versione di Tomcat 9.0.31 sembra abbia problemi con l'https. Non dovremmo risentirne (siamo dietro un reverse proxy e usiamo qui solo http, ma ho comunque applicato la modifica consigliata dai produttori di hmdm:
  
 <code bash> <code bash>
 +VERSION=9.0.40
 +wget https://archive.apache.org/dist/tomcat/tomcat-9/v${VERSION}/bin/apache-tomcat-${VERSION}.tar.gz
 +tar -zxf apache-tomcat-${VERSION}.tar.gz
 +cd apache-tomcat-${VERSION}
 +chmod a+x bin
 +chmod a+x lib
 +chmod -R a+r bin
 +chmod -R a+r lib
 +chmod a+x bin/*.sh
 +systemctl stop tomcat
 +systemctl stop tomcat9
 +mv /usr/share/tomcat9/bin /usr/share/tomcat9/bin~
 +mv /usr/share/tomcat9/lib /usr/share/tomcat9/lib~
 +cp -r bin /usr/share/tomcat9
 +cp -r lib /usr/share/tomcat9
 +systemctl start tomcat9
 +systemctl status tomcat9
 +
 +curl -I  http:/ip_macchina:8080/
 +   HTTP/1.1 200 
 +</code>
 +
 +
 +=== Preparazione database ===
 +
 +<code>
 # su - postgres # su - postgres
 $ psql $ psql
-postgres=# CREATE USER hmdm WITH PASSWORD 'Topsecret1234';+postgres=# CREATE USER hmdm WITH PASSWORD 'password';
 postgres=# CREATE DATABASE hmdm WITH OWNER=hmdm; postgres=# CREATE DATABASE hmdm WITH OWNER=hmdm;
 postgres=# \q postgres=# \q
 </code> </code>
  
 +== check database ==
  
 +<code>
 # Bisogna specificare -h localhost, altrimenti effettua  # Bisogna specificare -h localhost, altrimenti effettua 
 # una peer authentication, che fallisce perché non esiste # una peer authentication, che fallisce perché non esiste
 # hmdm negli utenti di sistema # hmdm negli utenti di sistema
 psql -U hmdm  -W -h localhost  psql -U hmdm  -W -h localhost 
 +</code>
  
-ubuntu@h-mdm:~$ sudo ./hmdm_install.sh +=== Installazione ===
  
 +<code>
 ubuntu@h-mdm:~/hmdm-install$ sudo ./hmdm_install.sh ubuntu@h-mdm:~/hmdm-install$ sudo ./hmdm_install.sh
 Please choose the installation language (en/ru) [en]: en Please choose the installation language (en/ru) [en]: en
Line 46: Line 127:
 PostgreSQL database [hmdm]: hmdm PostgreSQL database [hmdm]: hmdm
 PostgreSQL user [hmdm]: hmdm PostgreSQL user [hmdm]: hmdm
-PostgreSQL password: topsecret+PostgreSQL password: password
  
 File storage setup File storage setup
Line 53: Line 134:
 If the directory doesn't exist, it will be created If the directory doesn't exist, it will be created
 ##### FOR TOMCAT 9, USE SANDBOXED DIR: /var/lib/tomcat9/work ##### ##### FOR TOMCAT 9, USE SANDBOXED DIR: /var/lib/tomcat9/work #####
 +### La propone già lui, evidentemente testa la versione ###
  
-Headwind MDM directory [/opt/hmdm]: /opt/hmdm+Headwind MDM directory [/var/lib/tomcat9/work]: /var/lib/tomcat9/work
  
 Web application setup Web application setup
Line 62: Line 144:
  
 Protocol (http|https) [http]: http Protocol (http|https) [http]: http
-Domain name or public IP (e.g. example.com): 94.230.76.87 +Domain name or public IP (e.g. example.com): android.giano.comune.verona.it 
-Port (leave empty for default ports 80 or 443): 8080+### Ho lasciato vuoto come scritto, per abilitare la porta 80, ma l'ha messa lo stesso sulla 8080 ### 
 +Port (leave empty for default ports 80 or 443): 
 Project path on server or ROOT [/hmdm]: /hmdm Project path on server or ROOT [/hmdm]: /hmdm
 Tomcat virtual host [localhost]: localhost Tomcat virtual host [localhost]: localhost
  
 Ready to install! Ready to install!
-Location on server: /opt/hmdm +Location on server: /var/lib/tomcat9/work 
-URL: http://94.230.76.87:8080/hmdm+URL: http://android.giano.comune.verona.it/hmdm
 Is this information correct [Y/n]? Y Is this information correct [Y/n]? Y
- +Tomcat config file created: /var/lib/tomcat9/conf/Catalina/localhost//hmdm.xml 
-Tomcat config file created: /var/lib/tomcat8/conf/Catalina/localhost//hmdm.xml +Deploying hmdm-3.31.4-os.war to Tomcat: /var/lib/tomcat9/webapps//hmdm.war 
-Deploying hmdm-3.30.1-os.war to Tomcat: /var/lib/tomcat8/webapps//hmdm.war +..................
-............................+
 Deployment successful, initializing the database... Deployment successful, initializing the database...
  
Line 80: Line 162:
 Headwind MDM has been installed! Headwind MDM has been installed!
 To continue, open in your web browser: To continue, open in your web browser:
-http://94.230.76.87:8080/hmdm +http://android.giano.comune.verona.it/hmdm 
-Loginadmin:admin+</code> 
 + 
 +Entrato ho cambiato la password di admin  
 + 
 +Il pushing dei messaggi (se si seleziona MQTT) ha bisogno della porta ''31000 (TCP)'' aperta. 
 +Inoltre, dietro NAT, modificare ''/etc/hosts'' 
 + 
 +<code> 
 +IP_PRIVATO android.giano.comune.verona.it 
 +</code> 
 + 
 +Per verifica, controllare i log dopo il riavvio di tomcat: se non compare qualcosa come 
 + 
 +<code> 
 +2020-12-03 09:27:02 [ERROR] com.hmdm.notification.guice.module.NotificationMqttTaskModule : Failed to create MQTT broker service 
 +java.io.IOException: Failed to bind to server socket: mqtt://94.230.76.87:31000 due to: java.net.BindException: Cannot assign requested address (Bind failed) 
 +</code> 
 + 
 +l'MQTT è impostato correttamente. Ad ogni modo la configurazione di questo bind è in ''/var/lib/tomcat9/conf/Catalina/localhost/hmdm.xml'' 
 + 
 +<code xml> 
 +<!-- MQTT notification service parameters --> 
 +    <Parameter name="mqtt.server.uri" value="mdm.csgalileo.org:31000"/> 
 +</code> 
 + 
 + 
 +==== Troubleshooting ==== 
 + 
 +If the QR code icon in the configurations list has been vanished and is not working any more: 
 +  * Open the configuration details, "MDM settings" tab, and make sure "Headwind MDM Launcher" is set as the main app, and the "Component" is com.hmdm.launcher.AdminReceiver 
 + 
 + 
 + 
 +==== Client ====
  
-Entrato ho cambiato la password di admin in Eurolandia2012+In https://h-mdm.com/quick-start/ c'e' un breve video molto esaustivo, ma in sintesi per effettuare l'enrollement del telefono, partire da un device resettato (android 7 o superiore).
  
 +  * Fare tap 7 volte sulla schermata iniziale
 +  * Configurare il wifi
 +  * Fare lo scan del QR-COde (il telefono si scarica i pacchetti necessari autonomamente e presenta la schermata dello scanner)
 +  * L'applicazione si installa
 +  * Assegnare i permessi che chiede
 +  * Inserire l'ID del device (che nella pagina del barcode presentata dal server è in basso in una textbox)
  
-=========== 
  
-Entrato nel telefono senza registrarsi a google o altro account. +Quando ho finito ho cliccato su home (O) mi ha chiesto se volevo confermare mdm come launcher.
-Aperto chrome andato su https://h-mdm.com/download/+
  
-Scaricato l'apk Android application (launcher) 
  
-seguito istruzioni in https://h-mdm.com/quick-start/+La registrazione è a buon fine se il pallino è verde sotto ''status'' nella dashboard.
  
-Come server Url ho dato  http://94.230.76.87:8080/hmdm+Premere sulla terza icona a dx (un simbolo di download) per sincronizzare il telefono.
  
-Quando ho finito ho cliccato du home (O) e mi ha chiesto se volevo confermare mdm come launche. 
  
-Dopo di che il pallino verde è apparso+ 
  • projects/mdm.1607065935.txt.gz
  • Last modified: 2020/12/04 08:12
  • by igor