Your virtualmin is a server and is part of the domain, it is not the domain itself.
The website for mydomain.com is setup in virtualmin as a virtual server and is different to your server hostname.
When you configure stuff in Virtualmin, it configures the services directly and so in a sense configures Webmin aswell, so you dont need to worry about this.
Redirects can be done in htaccess files or in virtualmin
Virtualmin → Web Configuration → Website Redirects
The port I will leave to you as I dont know how to do that.
This is covered by the docs. From the download page:
“If your system does not have a fully qualified hostname, the script will ask you to provide one. The name of the system can be anything you want, but it must be fully qualified and should not match a name you’ll be hosting mail for. For example, if you have domain virtualmin.com you might name the server srv1.virtualmin.com or ns1.virtualmin.com. What name you choose is unimportant, but it must be fully qualified, it must not match a domain you’ll be managing in Virtualmin, and it must resolve, for several mail operations to work correctly.”
Or the longer install docs:
“If your system does not have a fully qualified domain name (FQDN), the installer will stop and ask you to choose one. This is mandatory because many services rely on having a fully qualified domain name in order to function. Mail, in particular, but some Apache configurations and many of the Virtualmin-created configuration files, also require a valid fully qualified domain name to function correctly. A fully qualified domain name is one of the form “srv1.virtualmin.com”, or simply “virtualmin.com” (but do not use a name you’ll be hosting in Virtualmin). We recommend you choose a name that is not one for which you will be receiving mail, in order to simplify later configuration. A good choice is to use a name server designator, such as “ns1.virtualmin.com”. Some customers also choose something like “host1.virtualmin.com” or “primary.virtualmin.com”. Any of these would be valid and would satisfy the install script and the services that rely on this option. The install script will add this name to /etc/hosts, which will satisfy all local services. It is even better if this name resolves correctly when looked up from outside of the system–this requires the name be added to your DNS zone for the second level domain. If the Virtualmin server you are installing will be the authoritative name server for this zone, you can later use Webmin to add a record for this name to the zone.”
I don’t know how we can make that more clear?
You should not name your server the same name as something you’ll be hosting in Virtualmin. It can be literally any other fully qualified domain name.