Howto install H-MDM

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:

https://androidaapt.com/

4 Likes

Wasn’t there something else using port 8080? I know Collabora wanted that port, but I had to change it to 8082 because of a conflict.

Yes but just tomcat. It’s a tomcat app so it shouldn’t matter.

https://wiki.nethserver.org/doku.php?id=network_ports

Thank you for the HowTo! I tried to install it and the installation went through…

What I would like to ask is how can/should the Android client access the server from outside?

I would like to use my Linux-Firewall and forward the port 8080, is this possible?

Is it safe to forward the port into the green zone to the MDM-Server or is it better to put the MDM-Server in the DMZ?

Thanks for testing!

I didn’t test connection with mobile phones but I assume via https. Maybe @h-mdm can help?

Yes but if you use the reverse proxy you use https and don’t need extra firewall config.

I’d prefer DMZ for webservers in production

A post was merged into an existing topic: Open Source Mobile Device Management?