Hostname issue in Server

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Webmin version 2.202
Virtualmin version 7.20.2
Webserver version Apache 2.4.52

I have set my Server Hostname to : “s1.watermelonsystems.net” with my Server IP : “162.0.222.165”.

But the problem is that when I navigate : “s1.watermelonsystems.net” it redirects to one of my customer’s website.

I have checked DNS and all settings from my end but I am unable to resolve this issue.

your server is offline for me to have a look.

  • Does the redirect happen for both http and https?
  • Is there actually a redirection or just that your clients website is showing?

should it be online ? The hostname is a hostname & not a domain name ! So perhaps the only place that should work is hostname.tld:10000 or 200000 I still can not see why people expect the hostname to work as a domain there have been numerous threads on this forum where things don’t work as expected because of this idea that the host name also needs to be a domain name … it does not, it gives you more troubles than it’s worth trying to use the hostname as a domain

@wms In virtualmin you can set the default website and in your case above because there is no virtual server defined for s1.watermelonsystems.net then it is most likely showing your clients website because it is the default website/virtual server. If you only have one virtual server then this will also cause it to be the default website.

To set the default website/virtual server

  • Select the virtual server/domain/website you want as default using the dropdown in virtualmin
  • Web Configuration → Website Options → Default website for IP address
  • Set this to yes

1 Like

@wms,

If your domain is redirecting to another domain as described, it’s most likely because you have not enabled “Apache” or “Nginx” for the domain.

When you don’t setup a “Virtual Server” with one of these features, it’ll point the domain associated with the Virtual Server to the “default” (typically first added) domain that has the feature turned on.

@shoulders point allows you to “change” the default website served, however this only applies to the “default” website, and would not address a domain which lacks the feature being enabled to serve websites for it.

1 Like

The server is working but on MXTOOLBOX tool it shows offline.

When I enter Http so by default it changes to Https
There is some redirection

I am using it as a hostname. I have also set it from my VPS server provider’s admin panel.

I want to use hostname for my server so for multiple servers I can use different hostnames rather than getting new domains.

Thanks @shoulders.

I have set it

There is an option to enable your hostname as a virtual server. I can post it at the end of the day but it is in virtualmin config. maybe someone can post it.

1 Like

Virtualmin --> System Settings --> Virtualmin Configuration --> Configuration category: SSL Settings --> Setup Let's Encrypt SSL certificate for hostname

  • Yes, and keep visible = A virtual server will appear in your list of virtual servers and stay there allowing you to edit it as a normwal virtual server.
  • Yes = This just presents the domain while it is doing the Let’s Encrypt SSL handshakes and then hides it again.
  • No = no LE SSL Certificate.

So my server’s hostname has a SSL and I use the hostname to access my servers because I have a live site and a dev site so I find this method very useful. I dont have them visible as a virtual server as there is no need and is not recommended or at least not the preferred option.

Virtualmin services (10000) and Usermin services (20000) can be accessed via any domain on your server as they use Miniserv and not Apache.

1 Like

Thank you @shoulders ,

I followed the steps you shared and the issue is now solved.

Have a good day ahead!

Thanks for the guide @tpnsolutions,

For my next server I will keep this in mind.

Once again Thank you @shoulders for your support.

I followed this guide and SSL issues are also solved for hostname and now it’s working great!

Thanks everyone for helping me solve the issues on my server!

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