--longname=1 giving odd results

when i am first installing virtualmin, i do so from a script that contains the following:

/usr/bin/sed --in-place --expression='s/^longname=0$/longname=1/;' /etc/webmin/virtual-server/config ;

then my script runs several of these commands:

virtualmin create-domain --domain XX.online --dir --unix --dns --web --ssl --pass passwordHere ;

however, in my /etc/httpd/conf/httpd.conf file, i “lose” the domain name suffix:

    ServerName XX.online
    ServerAlias www.XX.online
    DocumentRoot /home/XX/public_html
    ScriptAlias /cgi-bin/     /home/XX/cgi-bin/
    <Directory /home/XX/public_html>
    <Directory /home/XX/cgi-bin>

notice how some the above lines appears to have lost the domain suffix .online ??

i had all this working recently but maybe i have accidentally changed something?

i will try running the install procedure one more time to see if the issue repeats.

of course i could easily repair it in the editor (or set up a sed fix), but wanted to ask first.

SYSTEM INFORMATION
OS type and version RL 10.1
Webmin version 2.621
Virtualmin version 8.1.0
Webserver version Apache/2.4.63
Related packages SUGGESTED

You expect the suffix to show up in the path name? I have a trio of domains with the same name, different suffix. The name doesn’t appear in any of the paths. /home/ oooo for dot org, home/ooon for dot net,and home/oooc for dot com.

I get the same when using gui form

Maybe something has changed as I see a mixture of dot being in the path in domains I’ve created of the years.
I have not idea what your longname line does. :slight_smile:

Ok, its a switch to long name format sorry, maybe webmin needs a restart for the change to work.

P.S. Tried with longname=1 and restarted and still no dot in path. Maybe longname switch doesn’t do that, any docs on what it suppose to do?

Sorry I edit the wrong conf, didn’t go into virtual-server dir (did it manually not command line) and then it works, have you checked the config file has been changed to longname=1?

that is the first thing i checked. however, if longname was zero, i should think that ALL the names would be missing the domain name suffix, not just a handful of them.

its odd that the apachectl configtest; fails.

but again, i can manually fix it.

lets see if the issue happens again.

Mines OK, maybe that need to be sorted.
I notice your on RL 10.1, I will try a install on that, I don’t think that’s the issue though.

I just install VM on RH 10 and I’m getting the same issue as you when running those 2 lines of code as in OP.
I might try the same with RH 9.

1 Like

…thinkin’ this calls for a few sed lines…

sed --in-place --expression='s?/XX/?/XX.com/?' /etc/httpd/conf/httpd.conf ;

edit: or better yet:

/usr/bin/sed --in-place  --file=-   /etc/httpd/conf/httpd.conf  <<SED_SCRIPT  ;
s?/(DOMAINONE)/?/\1.online/?
s?/(DOMAINTWO)/?/\1.com/?
s?/(DOMAINTHREE)/?/\1.com/?
s?/(DOMAINFOUR)/?/\1.com/?
s?/(DOMAINFIVE)/?/\1.info/?
SED_SCRIPT

ok this is VERY interesting…

i have two identical domain names, dot-com and dot-info

the dot-com one drops the suffix for these:

DocumentRoot  /home/XX/public_html
ScriptAlias /home/XX/public_html
<Directory /home/XX/public_html>
<Directory /home/XX/cgi-bin>

but then second one (dot-info) is processed as expected, with the domain suffix in place.

strange…

Yeah I can’t get it working on clean installs of RH9 or RH10, but seems to be working on my current server. Very strange

1 Like

I’d encourage y’all to have a look around in the Virtualmin Configuration and Server Templates. Just about any behavior you want is configurable, if you don’t like the default behavior.

It didn’t drop the suffix. It added a suffix to avoid a clash. That’s the default behavior.

i am having trouble getting this to work.

now i am seeing these filenames (without the domain name suffix)

   DocumentRoot /home/zzzzz/public_html
   ScriptAlias /cgi-bin/ /home/zzzzz/cgi-bin/
   <Directory /home/zzzzz/public_html>

and i have ‘full domain name’ set:


i tried changing the value to “First part of domain” and back again thinking maybe something didnt get set right, but i continue to see the same directory names without the domain name suffix.

its behaves as if the “Full domain name” setting is no longer working.

EDIT:

i may just go into all the /etc/webmin/virtual-server/domains/ files and manually change all the /home/zzzzz/ to /home/zzzzz.com/ and also do so in the httpd.conf

It works. It does not change existing usernames. It only applies to new domains/users.

Changing all your existing users could potentially cause surprises/breakage. But, if you know you’re not relying on the path/username anywhere outside of the VirtualHost, you can certainly change it, if you like having the full domain name in the username and path.

joe - i am indeed creating new VS’s.

for 10+ years now, the first thing i do on a new installation is set the "domain name style in username’ to “Full domain name”.

and this gives me the desired result, where the FULL domain name is in the home directory:

/home/virtualmin.com/

however, on the newest installation, this setting seems to be ignored. now i am not seeing the full domain name in the home directory:

/home/virtualmin/

this seems to have started happening just in the past few days.

tomorrow i will try this again (using Google-VM) but i will ONLY install webmin/virtualmin and see if i get the same results.

it may be something else i messed up, which i have a habit of doing.

This seem to work.

This works too, might be better

I don’t know what to make of that. It worked for me.

But, I see the UI has actually changed in the new version we just released. So, I guess @Ilia or @Jamie made a change, and maybe there’s some broken behavior in those changes (though I just tested with the new version and it worked correctly).

ummmm i think there may be something wrong. Here is what i did this AM:

  1. new Google-VM, rocky-linux

  2. dnf update, etc etc

  3. my FAVORITE command:

sh -c "$(curl -fsSL https://software.virtualmin.dev/virtualmin-install.sh)"  \
                                         --                                  \
                                         --yes                               \
                                         --bundle    LAMP                    \
                                         --branch    stable                  \
                                         --hostname  host.edwardsmark.info   \
                                                                             ;
  1. “Domain name styles in username” changed to Full domain name

  2. created VS zzz.com

  3. examined results.

    ServerAlias www.zzz.com
    ServerAlias mail.zzz.com
    ServerAlias webmail.zzz.com
    ServerAlias admin.zzz.com
    DocumentRoot /home/zzz/public_html
# ls  /home/
mark  rsa-key-20221208  zzz

this appears to be easily reproduced.

workaround (hopefully):slight_smile:

/usr/bin/sed --in-place --expression='s/^longname=0$/longname=1/;'  /etc/webmin/virtual-server/config    ;   ## 2025-02-17
echo  'home_format=$DOM'  >>   /etc/webmin/virtual-server/config    ;   ## 2026-03-03

i will test this out. full credit goes to stefan1959 for his excellent suggestion.

EDIT: this appears to be an acceptable workaround.

1 Like