At the end of the NS8 installation, the URL for the cluster-admin points to the https://servername-FQDN/cluster-admin. User admin can: login, change his password, create the cluster, install: LDAP, MariaDB/phpmyadmin, Nginx/WebServer, etc…
All is running well with NS8 except the link to Open SFTPgo WebAdmin and also the links Open SFTPgo WebClient for all applications that use this client…
The same thing happens with a newly created virtual host - the link is pointing to the servername(ns8) instead of the virtual host domain name.
Also, if I replace the servername(ns8) with the virtual host domain name, the right page is displayed “Allo le monde! depuis NS8”
According to different man pages, the servername is all the characters up to the first period “(.)” of the servername FQDN. Also, the servername FQDN must start with, and end with an alphabetic character.
PROBLEM:
NS8 is taking the servername instead of the domain name or the servername FQDN with many applications.
Where I went wrong, or where can I edit the links, or is it a bug, or else … ?
On Debian-11, I have to change the hostname with nmtui and now all pointers are now working.
The use of nmtui will change the content of the files: /etc/hostname and /etc/resolv.conf
As seen below, the “hostname” and the “hostname -f” have the same output which is not suppose to be the case.
hostname is the text string before the first dot of the FQDN.
domain name is text string after the first dot of the FQDN.
root@ns8:~# hostname -f
ns8.debian.toto-dev.org <============= "FQDN"
root@ns8:~#
root@ns8:~# hostname
ns8.debian.toto-dev.org <============= it should be only "ns8"
root@ns8:~#
root@ns8:~# hostname -d
debian.toto-dev.org <============= "domain name"
root@ns8:~#
root@ns8:~# dnsdomainname
debian.toto-dev.org
root@ns8:~#
root@ns8:~# cat /etc/hostname
ns8.debian.toto-dev.org <============= it should be only "ns8"
root@ns8:~#
Conclusion:
I think the way NS8 gets the hostname or domain name is not the proper way to do so.
Michel-André
EDIT:
With the proper hostname, to communicate at he end of the installation it displays: https://FQDN/cluster-admin
Between this and the other topic I linked, maybe NS8 should just ask for the desired/intended hostname (perhaps with a caveat that it shouldn’t be the FQDN you intend to serve your main web content from, see NS8: webserver allows to create a virtual host with the same FQDN as the main server FQDN). Because the auto-detecting seems very fragile, and it also seems to come up with inconsistent results. Have it as part of the install script maybe, or perhaps part of the create/join cluster pages.
Otherwise, the docs need to specify exactly how the hostname is to be set for NS8 purposes (and it needs to be something that can be done post-install, because folks who will be running this in a VPS environment won’t be able to set it at install time), because the information in several online guides wasn’t enough to get it done when I was working on it earlier.
The file should contain a single newline-terminated hostname
string. Comments (lines starting with a “#”) are ignored. The
hostname should be composed of up to 64 7-bit ASCII lower-case
alphanumeric characters or hyphens forming a valid DNS domain
name. It is recommended that this name contains only a single label, i.e.without any dots. Invalid characters will be filtered
out in an attempt to make the name valid, but obviously it is
recommended to use a valid name and not rely on this filtering.
HISTORY
The simple configuration file format of /etc/hostname originates from Debian GNU/Linux.
Can you explain the logic below ?
Michel-André
EDIT:
In /etc/hostname, if I insert only the server name i.e. ns8 (as it should be), SFTPgo will want to go to ns8/sftpgo/web/admin/login.
I am testing on a virtual machine on the LOCAL LAN, I am sure I am not the only one.
That is why I do not comment on how to obtain a certificate in such an environment.
I obtain a Let’s Encrypt certificate on my main NethServer and I upload it to NS8.
We need to retrieve the hostname of the server, we relie on hostname cli command. We could either use hostnamectl but it reflects too what is written in /etc/hosts bad or good
When called without any arguments, the program displays the current names:
hostname will print the name of the system as returned by the gethostname(2) function.
domainname will print the NIS domainname of the system. domainname uses the gethostname(2) function, while ypdomainname and nisdomainname use the getdomainname(2).
dnsdomainname will print the domain part of the FQDN (Fully Qualified Domain Name). The complete FQDN of the system is returned with hostname --fqdn (but see the warnings in section THE FQDN below). …
Technically: The FQDN is the name getaddrinfo(3) returns for the host name returned by gethostname(2). The DNS domain name is the part after the first dot.
Therefore it depends on the configuration of the resolver (usually in /etc/host.conf) how you can change it. Usually the hosts file is parsed before DNS or NIS, so it is most common to change the FQDN in /etc/hosts.
If a machine has multiple network interfaces/addresses or is used in a mobile environment, then it may either have multiple FQDNs/domain names or none at all. Therefore avoid using hostname --fqdn, hostname --domain and dnsdomainname. hostname --ip-address is subject to the same limitations so it should be avoided as well. … -f, --fqdn, --long
Display the FQDN (Fully Qualified Domain Name). A FQDN consists of a short host name and the DNS domain name. Unless you are using bind or NIS for host lookups you can change the FQDN and the DNS domain name (which is part of the FQDN) in the /etc/hosts file. See the warnings in section THE FQDN above and use hostname --all-fqdns instead wherever possible.