First things firts I make this guide because I sick all of this tutorials make no sense and probably not working.
All the tutorials are say you need to edit the hosts file, thats wrong editing this file is totally unnecessary. I tell you why.
All the stuff you put in the hosts file affects only your computer! This file is responsible for your local network for example the default line 127.0.0.1 localhost you don't need to write all the time the 127.0.... only localhost and your PC will redirect it to 127.0.0.1.
A little more complex example you have 2 PC on your local network, your PC IP address is irrelevant the other PC IP is 192.168.0.125 and you run a webserver on that PC. You got sick of write the whole IP every time. So you put in your hosts file the other PC IP address like 192.168.0.125 o.pc this will redirect to your other PC's webserver when you put o.pc in your webbrowser but only on your main PC
So the easyest way to make a public server if you have a static IP just use(get it from
here) that or if you want a domain name instead or you have a dynamic IP go to
noip.com register make a free domain name like myserver.ddns.org download the No IP client log-in and the application do the rest of the work. You probably need to portforward the ports what the server needs and you may need to add a realm to the DB like the original the only difference is the IP don't put 127.0.0.1, put your no-ip domain and should it work fine. For portforwarding help go to
portforward.com.
I did this multiple times and almost everytime works there is one case it not working when your home router behind an another router what your ISP installed. Trust me I am an IT guy