I had Virtualmin running perfectly on my Ubuntu 18.04 I set a new internal static IP (Before it was DHCP) with netplan as following:
network: version: 2 renderer: networkd ethernets: enp6s0: dhcp4: no addresses: [192.168.2.1/22] gateway4: 192.168.1.1 nameservers: addresses: [18.104.22.168,22.214.171.124]
After that I forwarded all the necessary ports in my router. The router had a submask 255.255.255.0 so I changed it to 255.255.254.0
Now: the ports
3306 are still reachable and the ports
20000 are closed now/ Err_Conn_Refused
(Checked with https://www.yougetsignal.com/tools/open-ports/)
Before the IP change, all these ports were open and running.
doesn't work either from a local network computer
Firewall seems to be OK, I tried to reinstall Virtualmin in the hope that it would reconfigure it correctly, no luck. I also tried to restore it and use dhcp again, but it's still the same error. I assigned 10 Gb ram to virtualmin, so it shouldn't be this either. Virtualmin is up and running, as far as I can understand.
As always,I did not look good enough at every single detail. But I think there are a lot of things that could be relevant to the problem that contains many details to look at. Apart of that:
The service Apache was not running all along.
I tried to start it and it gave an error. That's because I deleted the ssl cert files of some domains about 2 hours before I set up the static IP. Apache could not locate the SSL files and was therefore not able to start. edited the conf files and problem solved.