The server name and server domain is not very important as far as your webserver is concerned. You should however have your hostname set to something like 'myname' and domainname set to something like 'mydomain.com' - ie it forms 'myname.mydomain.com'. Don't include the hostname in the domainname.
I'd advise against calling your entire server 'www'.
The name to respond to (ie
www.whatever.com) is set in your apache config file.
If a web request arrives directed to that name, apache will respond. This doesn't have to (and usually shouldn't) match your hostname.
You will need your ISP to assign you a static IP or find a way to dynamically update whatever DNS server you are using to provide lookups for your domain.
The domain entry has a couple of name servers set in it. If you are on dynamic IP, that can't be something within the dynamic range (no-ip and zoneedit can probably help you out with that). People looking for your website will lookup your domain name and get sent to the name server assigned to it. It then hands back the relevant IP address (which will be the IP your ISP has given you).
The web browser then goes to that IP, and asks for a webpage for the name it used (eg
www.whatever.com'). Provided your router is redirecting traffic that arrives on port 80 to your server and server is running a webserver, it will respond. If the name used (eg
www.whatever.com) matches the config file, the webserver will hand back something useful.