Welcome to Headwind MDM Q&A, where you can ask questions and receive answers from other members of the community.

Please do not post bug reports, missing feature requests, or demo inquiries. If you have such an inquiry, submit a contact form.

0 votes

I have installed the remote control module on the same server where Headwind MDM is installed.

Now I'm getting error 404 when trying to open /web-admin/ subdirectory. The error is returned by the Tomcat server. Headwind MDM works without issues.

How to fix the issue?

by (37.5k points)

1 Answer

0 votes

The page /web-admin/ should be managed by nginx (base server for Headwind Remote), not by Tomcat.

When Headwind Remote is installed on the same server with Headwind MDM, nginx works as a proxy for Tomcat, see this diagram:

If you see Tomcat's response 404, it means that nginx is not accessible on port 443. 

The most probable reason for that is the port redirection (443 -> 8443) by iptables, which is the default option of Headwind MDM installer.

To check whether iptables redirect the traffic, run the command:

iptables-save

There is an active port redirection, if you see the output like this:

-A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443

-A OUTPUT -o lo -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443

Remove the redirection by running the commands:
iptables -t nat -D PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443
iptables -t nat -D OUTPUT -o lo -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443
This should resolve the issue. If it doesn't, try restartng Headwind Remote by running commands:
cd /opt/remote-control
bash ./install.sh
Make sure iptables are not started at boot (another default option of Headwind MDM installer).
Run the command
crontab -l
If you see the line
@reboot /opt/hmdm/iptables-tomcat.sh
Remove it from crontab (or comment it out by # character) by using the command
crontab -e
by (37.5k points)
...