Starting from Open Source Mobile Device Management? here’s a quick install howto of H-MDM for testing.
We install with postgressql db password “topsecret”, you may change it to be more secure.
# Download dependencies
yum -y install nethserver-tomcat tomcat8 java-1.8.0-openjdk nethserver-postgresql unzip
# Enable and start tomcat8 instead of 7
systemctl disable tomcat --now
systemctl enable tomcat8 --now
signal-event firewall-adjust
config setprop tomcat status disabled
# Create DB and user with password topsecret
su - postgres -c psql
CREATE USER hmdm WITH PASSWORD 'topsecret';
CREATE DATABASE hmdm WITH OWNER=hmdm;
\q
# Download and unzip and prepare h-mdm and aapt
wget -nc https://h-mdm.com/files/hmdm-3.09-install-ubuntu.zip
wget -nc https://dl.google.com/android/repository/build-tools_r28.0.2-linux.zip
unzip -o build-tools_r28.0.2-linux.zip
mv -f android-9/* /usr/local/bin/
unzip -o hmdm-3.09-install-ubuntu.zip
cd hmdm-install
chmod +x hmdm_install.sh
# change tomcat path for installing to tomcat8
sed -i 's!/var/lib/tomcat8!/opt/tomcat8!' hmdm_install.sh
# run installer
./hmdm_install.sh
Then go through the installer, you just need to enter the postgresql password and your domain / IP address.
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:
Failed to connect to localhost:5432/hmdm as hmdm!
Please make sure you've created the database!
[root@testserver hmdm-install]# ./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: topsecret
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
Headwind MDM directory [/opt/hmdm]: /opt/hmdm
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): example.com
Project path on server or ROOT [/hmdm]: /hmdm
Tomcat virtual host [localhost]: localhost
Ready to install!
Location on server: /opt/hmdm
URL: http://joomla.local:8080/hmdm
Is this information correct [Y/n]? y
Tomcat config file created: /opt/tomcat8/conf/Catalina/localhost//hmdm.xml
Deploying hmdm-3.09.0004.war to Tomcat: /opt/tomcat8/webapps//hmdm.war
.................................
Deployment successful, initializing the database...
======================================
Headwind MDM has been installed!
To continue, open in your web browser:
http://example.com:8080/hmdm
Now just create a reverse proxy in web UI for “example.com” to http://localhost:8080
Browse to https://example.com/hmdm
and test H-MDM
You need a domain for the reverse proxy but it works at https://<NETH_IP>:8080/hmdm
too.
Sources: