Same FQDN can be set to different virtualhosts

nethserver V7
Module nethserver-virtualhosts

Playing with the module nethserver-virtualhosts, I saw that you can set the same domain name to different virtualhosts. You do not have a validator to check if the FQDN is not already attributed to a virtualhost.

I mean about that

Virtual host names (FQDN)
    The list of Fully Qualified Domain Names that are associated to the virtual host. Values must be separated with a "," (comma).
3 Likes

I think somebody should file a bug about this :hugging:

done https://github.com/NethServer/dev/issues/5303

3 Likes

A fix is ready for testing!

yum --enablerepo=nethserver-testing update nethserver-virtualhosts

I was thinking how to solve this bug, nice code…not tested yet…a bit busy at work

1 Like

what is wrong ?

[root@NS7DEV2 ~]# yum --enablerepo=nethserver-testing update nethserver-virtualhosts
Loaded plugins: changelog, fastestmirror, nethserver_events
stephdl                                                                                                                                                                                     | 2.9 kB  00:00:00     
Loading mirror speeds from cached hostfile
 * base: mirror.in2p3.fr
 * epel: mirrors.ircam.fr
 * extras: miroir.univ-paris13.fr
 * nethforge: mirror1.nethserver.org
 * nethserver-base: mirror1.nethserver.org
 * nethserver-updates: mirror1.nethserver.org
 * updates: mirror.in2p3.fr
No packages marked for update

[root@NS7DEV2 ~]# rpm -qa nethserver-virtualhosts
nethserver-virtualhosts-1.0.2-1.ns7.noarch

I cannot find your testing version

yum clean all --enablerepo=*

then the rpm is available

tested nethserver-virtualhosts-1.0.3-1.3.g8c19de1.ns7.noarch

I can see that a virtualhost is created by default, I did not understand what it means

[root@NS7DEV2 ~]# db vhosts show
default=vhost
    Description=Default virtual host
    FtpPassword=
    FtpStatus=disabled

I can see that now a message is displayed when you try to share the same domain name between vhosts.

I saw also that the key name of the vhost is not tested, you can reuse the same key name.

The fix has been released.

I also noticed the same thing, but this is a different issue. Honestly I didn’t want to open another issue for the web interface :smiley: