Show pageOld revisionsBacklinksAdd to bookExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ===== 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/ 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 ==== <code bash> ubuntu@h-mdm:~$ sudo apt update ubuntu@h-mdm:~$ #### sudo apt install openjdk-8-jdk aapt tomcat8 postgresql ubuntu@h-mdm:~$ apt install aapt postgresql tomcat9 unzip ubuntu@h-mdm:~$ wget https://h-mdm.com/files/hmdm-3.31-install-ubuntu.zip ubuntu@h-mdm:~$ unzip hmdm-3.31-install-ubuntu.zip </code> === 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> 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 $ psql postgres=# CREATE USER hmdm WITH PASSWORD 'password'; postgres=# CREATE DATABASE hmdm WITH OWNER=hmdm; postgres=# \q </code> == check database == <code> # Bisogna specificare -h localhost, altrimenti effettua # una peer authentication, che fallisce perché non esiste # hmdm negli utenti di sistema psql -U hmdm -W -h localhost </code> === Installazione === <code> ubuntu@h-mdm:~/hmdm-install$ sudo ./hmdm_install.sh Please choose the installation language (en/ru) [en]: en PostgreSQL database setup ========================= Make sure you've installed PostgreSQL and created the database: # CREATE USER hmdm WITH PASSWORD 'topsecret'; # CREATE DATABASE hmdm WITH OWNER=hmdm; PostgreSQL host [localhost]: localhost PostgreSQL port [5432]: 5432 PostgreSQL database [hmdm]: hmdm PostgreSQL user [hmdm]: hmdm PostgreSQL password: password File storage setup ================== Please choose where the files uploaded to Headwind MDM will be stored If the directory doesn't exist, it will be created ##### FOR TOMCAT 9, USE SANDBOXED DIR: /var/lib/tomcat9/work ##### ### La propone già lui, evidentemente testa la versione ### Headwind MDM directory [/var/lib/tomcat9/work]: /var/lib/tomcat9/work Web application setup ===================== Headwind MDM requires access from Internet Please assign a public domain name to this server Protocol (http|https) [http]: http Domain name or public IP (e.g. example.com): android.giano.comune.verona.it ### 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 Tomcat virtual host [localhost]: localhost Ready to install! Location on server: /var/lib/tomcat9/work URL: http://android.giano.comune.verona.it/hmdm Is this information correct [Y/n]? Y Tomcat config file created: /var/lib/tomcat9/conf/Catalina/localhost//hmdm.xml Deploying hmdm-3.31.4-os.war to Tomcat: /var/lib/tomcat9/webapps//hmdm.war .................. Deployment successful, initializing the database... ====================================== Headwind MDM has been installed! To continue, open in your web browser: http://android.giano.comune.verona.it/hmdm </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 ==== 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) Quando ho finito ho cliccato su home (O) e mi ha chiesto se volevo confermare mdm come launcher. La registrazione è a buon fine se il pallino è verde sotto ''status'' nella dashboard. Premere sulla terza icona a dx (un simbolo di download) per sincronizzare il telefono. projects/mdm.txt Last modified: 2022/03/10 09:19by sscipioni