Avoide creation of Admin user of subdomain in the virtualmin

SYSTEM INFORMATION

Ubuntu Linux = 18.04.6
Webmin version = 2.021
Virtualmin version = 7.7
All installed packages are up to date

It would be good to know what issues you have … but I guess you are creating the subdomain as a top level server which will create a new admin user, to have the same admin user create the subdomain as a subserver of a top level domain like so


then the admin user will be the same

@jimr1 Thank you for replying

the thing that used to have a PHP built website with the domain name of the abc.live, two years back i faced flash player issue in it and after taking its full backup of the website, i used abc.live for the WordPress website, now i want to restore the backup of the PHP based abc.live website on the subdomain of the main domain “abc.live”, i need to create 12 subdomains to make the PHP built website fully active but for every subdomain it creates admin user that is already in use of the main-domain, how can i avoid the creation of the admin user of the subdomain? please reply

I don’t understand. Virtualmin creates a different user for every top-level server (regardless of the name of the domain), unless you explicitly tell it to do otherwise.

And, if you don’t want to create new users, and you want all domains to be owned by the same user, you should make them Sub-servers instead of top-level Virtual Servers. A Sub-server is a full-featured server that is owned by an existing virtual server user. A Sub-server can have mail, website, new databases, etc. they just all belong to the top-level server.

And, to be clear: A website must have some user. You can’t host a website safely without giving it its own user. Virtualmin cannot create virtual hosts without some user owning it…if you want a new user, create a Virtual Server and if you want it owned by an existing Virtualmin Virtual Server user, create a Sub-server.

can you please Explain me the basic difference between the following and when to Create them ?

top level server
sub-server
Alias
subdomain

Waiting for the reply

as I said before a sub server uses the same admin as it’s parent server so you will not get new admin users

I just did! But, I guess I’ll try again.

You want a new user. This creates a user, website, database, mail config, etc. and it puts the domain owner user home in /home/domainname.

You do not want a new user. This creates a new website, database, mail config (if you choose), etc. and it puts the data in /home/top-level-domainname/domains/sub-server-domainname

This is a website that serves existing content. It does not get a new user. It just points a new domain name at an existing website hosted on the system. It can optionally have separate mail, though (“Alias, with own email”).

There is no such thing in Virtualmin. A subdomain is a name. It is not an account type. Any of the server types above can be named with a subdomain name. It is just a name.

Thank you for the explanation, Joe.

As I mentioned earlier, I want to restore the backup of the PHP-based website abc.live on a subdomain. The path for the files is already set in thousands of PHP files, and it cannot be changed. Therefore, I want to place those files in the same root path directory that is specified in all the respective files. This way, when I try to access them, they will open without any errors.

I can see the “create new subdomain” option, and I have already created two subdomains under abc.live. This process creates a subdomain folder in the public_html folder of the main domain, which is exactly what I want because the same path is specified in the PHP files of abc.live that I want to restore.

However, the subserver you mentioned earlier requires the files to be placed in the “/home/top-level-domainname/domains/sub-server-domainname” directory, which is completely different from the root directory I want to use.

Please let me know how I can proceed in this situation.

what php program does that ? normally a php script would read the path from a config file or it would use the global variable $_SERVER['DOCUMENT_ROOT'] in order to workout where it’s files are located

/var/www/abc/public_html/urdu

don’t use

it will give you more trouble, only use the sub server option

but the sub server creates the “domain” folder outside the pulic_html folder and places the new subdomain folder in it

the php abc.live document root will not match with it, it is only possible with the creation of subdomain, & i please tell me how creation of subdomain will put me in more trouble

Joe told me ages ago that was discontinued (sub-domain) however I just tested it and it works you may need to make sure you tick the ssl checkbox as well

Sounds like yet another PHP tail wagging the dog.

How many sub-directories are you going to have to create to satisfy this monster? Does it just “name” them on the fly? abc.live/sub1 abc.live/sub2 etc dynamic naming.

If the PHP “program” is expecting all these subdirectories to exist it has the responsibility to create them (and should be doing so).

If the subdirectories are not dynamic (not created by the PHP “program” but were originally a design fault. and are fixed names and few in number then why not simply create them under abc.live/
No need to involve Virtualmin.(though the File Manager might help)
They are not individual sub-servers or any kind of server. They don’t need separate mail or separate database or separate users the admin of abc.live is admin of the whole site including all and any subdirectories.

@Stegan thanks for the reply

Subdomains.Root Domain Document Root
admin.urdu.rnn.live /public_html/admin.urdu/public
aimg.urdu.rnn.live /public_html/admin.urdu/public/NewsFiles/AuVideo
avfile.urdu.rnn.live /public_html/admin.urdu/public/AvFiles
avimg.urdu.rnn.live /public_html/admin.urdu/public/AvFilesImage
bulletins.urdu.rnn.live /public_html/admin.urdu/public/bulletins
geimg.urdu.rnn.live /public_html/admin.urdu/public/others
gimg.urdu.rnn.live /public_html/admin.urdu/public/GalleryImages
nimg.urdu.rnn.live /public_html/admin.urdu/public/NewsFiles/Images
pimg.urdu.rnn.live /public_html/admin.urdu/public/PageFiles
urdu.rnn.live /public_html/urdu/public

@Stegan
the list that i have just provided is of subdomain that are linked to the main domain urdu.rnn.live

@Stegan the rnn.live is now occupied since last 2 years which is why i cannot restore the backup on the rnn.live domain, please guide me how can i make this PHP based website active again, ???

this PHP website was previously manged by the cpanel whel it was active on the main domain

@danyaalshahid.sr Ah I now see the problem is a little more complex.

The error definitely lies with the way that PHP has been written (I would normally say change the PHP but that is not really an option here as it is old code and probably the coder has long gone)
I assume from your list above that in the PHP code it is looking for eg. admin.urdu.rnn.live and expecting to find it there and not in /public_html/admin.urdu/public where the code actually should be (below the document root not above it)

Although the creation of directories below is a very straightforward task (as I outlined above) the creation of directories above is a bigger challenge.

However perhaps not impossible. I have a similar domain.club that required a v2.domain.club with no mail,db,users but was under the “ownership” of the same admin as domain.club it contains code (not PHP) that references code modules and the db of domain.club. I set this up as a “sub-server” in Virtualmin parlance of the parent domain making sure that I answered the questions as appropriate. It sort of works ok but I can talk to the site’s coder team.
As I believe @joe has pointed out here/elsewhere a “sub-server” has the same “owner” as the parent.
their actual location then would be: /home/domain.club/domains/v2.domain.club but that could be changed