Change url of usermin

How to change url of usermin. I want to change usermin url from http://abc.com:20000 to webmail.abc.com

This is already built in to Virtualmin and configured by default. All you need to do is point webmail.domain.tld to the IP address of your Virtualmin server.

In the same way you could also use admin.domain.tld instead of domain.tld:10000

Have fun! :slight_smile:

You can setup subserver with htaccess redirect to correct address:20000 or you can edit apache configs for that domain. Those configs can be found under webmin > servers > apache webserver. There you click on config for selected domain and in sub panel click on icon which sais Edit Directives and there in that text file edit domani:20000 to anything you like

also after saving those edits make sure you restart apache to apply new settings.

Hi Calport

Thanks. Yes already built in to Virtualmin and configured by default.I didnt check sorry. When i open http://webmail.abc.com it goes to this http://abc.com:20000 that is correct. But url show this http://abc.com:20000 i want to show this url http://webmail.abc.com

This might be a quicker way to solve the problem:

You will have to apply this proxy idea to port 20000 and use it on webmail.domain.tld that you have already created as a virtual server.

You’re right, this is how I see it and I think there’s a discrepency between configuration and expected behavior. The webmail and admin sub-domain format makes no sense when there’s an Apache rewrite rule that sends them to https://domain.tld:20000 and :10000.

The regular URL and port is fine by me so I opted to get rid of webmail and admin DNS records, domain aliases and rewrite rules. But it’s reasonable to expect friendlier URLs when there are domain aliases and A records at work.

As @unborn suggested, the real fix is some kind of Apache proxypass or rewrite logic on the Webmin/Apache page. Or manually edit a host’s *.conf file or .htaccess. The challenge will be coming up with a clean URL in sub-domain format without the port number.

The simplest but least elegant solution is to edit existing rewrite rules in the host’s *.conf file. You’re still stuck with the port number but a webmail user might be less confused.

RewriteRule ^(.*) https://domain.tld:10000/ [R]
changes to
RewriteRule ^(.*) https://admin.domain.tld:10000/ [R]
and
RewriteRule ^(.*) https://domain.tld:20000/ [R]
changes to
RewriteRule ^(.*) https://webmail.domain.tld:20000/ [R]

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.