NS8: webserver allows to create a virtual host with the same FQDN as the main server FQDN

Here’s a bug found by @danb35 :

Hi @dnutan

You mean I have to get 2 (two) domains… UNACCEPTABE!

Change the way you do it…

Michel-André

Hardly, just use subdomains. Most of the modules (Nextcloud, Webtop, Dokuwiki) expect their own hostnames too, but it’s simple enough to set up cloud.domain, webtop.domain, wiki.domain, etc. Only one registered domain is needed. But it’s always been the case–at least with NS7–that the “main” or default virtual host has been a second-class citizen that isn’t nearly as configurable as any of the others. Therefore, I think it’d qualify as a “best practice” that the system’s primary FQDN should be one that’s reserved for administrative use–both with NS7 and with NS8.

Hi @danb35

My main web server uses my main domain.name.

I am quite sure that I am not the only one.

Michel-André

EDIT:
Why cluster-admin doesn’t use a sub-domain.
It looks like all other applications use sub-domain.
I do not see the logiic that only cluster-admin is different…

I expect–though the devs would be better able to answer this–that it’s to allow you to reach it without having a domain name at all.

So when you set up NS8, set it up with a different FQDN as its hostname (perhaps admin.domain, or something like that–the important thing would be that it isn’t just domain.tld or www.domain.tld). Set up your “main web server” as a virtual host with your main domain and www.domain as an alias. Mind you, this is the conclusion I’m reaching by trying to figure it out as I go along; there may be better advice from others–but it seems to be the best way to go as far as I can see.

Fi @danb35

How I will name my host-server ?

The installation/config of all appplications will propose the host-server FQDN as their URL?, or sub-domain?, or etc…

Easy solution, sub-domain for cluster-admin ???
Give the subdomain name as a parameter of the installation script.

Michel-André.

However you like, as long as it isn’t a name you want to serve other web content from. Which is what I’ve said twice already in this topic–I really don’t see that this should be difficult to understand or implement, particularly on a new server. But if that’s the intent, it should be clearly documented.

I imagine it depends on the app. Most of them that I’ve seen (e.g., DokuWiki, Nextcloud, WebTop, any of the virtual hosts for the web server app) ask for their own FQDN. A few (e.g., Prometheus) use a path within the main FQDN.

…which requires you access the cluster-admin pages using a domain name, and prevents you from accessing it using an IP address–which, again, I’ve already mentioned. Since creating the cluster could easily precede setting up DNS, this could be a problem. Easier solution yet is to do what I’ve already suggested three times.

I’m certainly no authority on NS8; as I already said, I’m trying to figure it out as I go. And I’m certainly not interested in arguing the point.

Indeed it is.
Card added: Trello

Thank you do reporting!

:dart:

This could be also a good idea, but as a user choice, not the default.

I agree.

1 Like

…and given that I’ve done this, is there a way to fix it (i.e., remove the virtual host created using the machine’s primary FQDN) and restore access to /cluster-admin/?

Yes, but I’m not able to give you the commands for a cut&paste.

You need to delete some keys from redis, but it depends on how you’ve configured it.
These are the involved keys: https://github.com/NethServer/ns8-traefik/blob/main/imageroot/actions/set-route/20writeconfig#L65-L78

This is the configuration reference: KV | Traefik | v2.4

Sadly not a so easy job.

Might be a case of “blow it away and reinstall” again–which isn’t such a big deal as this is a test system.

Probably I will shoot my feet but the webserver does not write to redis like this you can modify some flat file inside and restart the configure from the UI

/home/webserver1/.config/state

Or you could modify it with a configure action

You could retrieve the vhost list GitHub - NethServer/ns8-webserver: A webserver (nginx based) with php-fpm stack