Problems with web hosted elsewhere

SYSTEM INFORMATION
OS type and version RHEL9.1
Webmin version 2.021
Virtualmin version 7.5

I have some clients that just use my service for DNS and email as their website is hosted elsewhere.

This appears to mean that I can’t use either admin.domain or webmail.domain as Vmin is most likely redirecting to admin.@ where the @ is pointing to the external web server.

The admin. and domain. are both pointing to my server in DNS, but @ isn’t.

How to get around this as I need to be able to offer webmail at a minimum.

Since you control DNS, this is easy to do.

Create subdomains admin and webmail; point the A records of these to the IP address of your Virtualmin server.

That’s all there is to it. Virtualmin will take care of everything else.

Visit admin.domain.tld for Webmin & Virtualmin
Visit webmail.domian.tld for Usermin.

I already have that, so relevant records are.

@ - wix.com
www. - wix.com
admin - myserverIP
webmail - myserverIP

So, Vmin sees a request for admin.domain.com and then applies a redirect to the @ DNS record and adds the port number, in this case that works out to be wix.com:20000 - which isn’t going to work as my Vmin isn’t at wix.com .

The only way I can access is to use https://serverIP:20000

Not elegant and DNS records don’t handle port numbers.

Please test this out. My interpretation may be wrong, but the problem is there.

Everything is configurable, including automatically created DNS records and redirects.

Ah, is that what happens? Might there be a way to nevertheless keep port 10000 for the virtualmin server while we let Wix have 80 and 443? I will take a look and come back to you if I find anything good.

As Joe said, it’s all configurable.

Thanks Joe, my DNS is separate, changimg the redirect is what I need.

For me, it’s the hours I will spend trying to find it. Any help appreciated.

Hours? That can’t be right.

It’s in: Server Templates->Website for domain->Redirect …

WOW – I continually am impressed with Virtualmin !!! For years I have noticed the port 10000 redirect in httpd.conf and the few times I needed to change it, I fired up VIM and just made the change :slight_smile:

Great to know the GUI has it too – and of course often easier and safer than editing httpd.conf directly !!

Most changes in Server Templates apply to virtual servers created after the change. They are “templates”. You can change existing redirects in the GUI, but it’ll be in the Apache Website section of the virtual server itself, not in Server Templates.

For those that may follow.

Virtualmin, select the domain, select Services, then Edit Directives.

Look for the lines:
RewriteCond %{HTTP_HOST} =webmail.domain.com
RewriteRule ^(?!/.well-known)(.*) https://domain.com:20000/ [R]

Change the 2nd line only to:
RewriteRule ^(?!/.well-known)(.*) https://mail.domain.com:20000/ [R]

I then did the same thing for the line that rewrites the redirect for admin.domain.com

It doesn’t have to be mail. but I thought it was a good choice as the DNS record for it points to the correct server.

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