Modifying user home directory

Good afternoon! Is it possible to change user home directory name to FQDN? I mean, when I am adding virtual server, with domain name "example.test.com", virtualmin creates home directory, name "/home/example". Is it possible, that Virtualmin will create home directory, called "/home/example.test.com"? It is very important for me. Thanks.

Status: 
Active

Comments

Yep, that is possible. In fact, I have it set up exactly like you have in mind. :)

You can configure it in the Virtualmin Configuration -> Defaults for new domains : Home subdirectory. Set that to "From template" and the edit box to "$DOM".

(Deleted... Sorry, double-post due to server errors.)

Thanks a lot, thats it)

When I set the Home subdirectory to $DOM I get no such a file or directory errors when creating a new virtual server (I am using custom Apache settings in server templates).

I am trying to create a virtual server to /home/domain.com/ folder and to have website root at /home/domain.com/html and access and error logs at home/domain.com/html/logs/.

Any help would be really appreciated!

What is the error message you are getting exactly?

Performing other Apache configuration ..
.. configuration failed : Failed to copy /etc/php.ini to /home/domain.com/etc/php5/php.ini : cp: cannot create regular file `/home/domain.com/etc/php5/php.ini': No such file or directory

Setting up scheduled Webalizer reporting ..
.. Webalizer reporting failed! : Failed to open /home/domain.com/public_html/stats/.htaccess.webmintmp.2780 : No such file or directory at ../web-lib-funcs.pl line 1360, line 1.

Setting up AWstats reporting ..
.. AWstats reporting failed! : virtualmin-awstats::feature_setup failed : Failed to open /home/domain.com/cgi-bin/awstats.pl.webmintmp.2780 : No such file or directory at ../web-lib-funcs.pl line 1360, line 1.

Thank you!

Does the directory /home/domain.com actually get created at all? Or is it created, but empty?

It seems like the directory gets created, but it's empty.

Weird ... if you su to the domain's user, can you create sub-directories like etc or public_html ?

I have sent you email about the issue.

Ok, I fixed the issue .. there were several configuration problems on your system related to the home directory. Also, the additional templates you had created had invalid default Apache configurations, so I changed the default templates back to those that come with Virtualmin.

What home directory format are you trying to use exactly?

Thank you for your help Jamie!

I would like the home directory to have a subdirectory for each domain, no matter the what the domain type is (server or sub-server). For example:

home/firstdomain.com/ home/firstdomainsubserver.com/ home/seconddomain.com/

Was there something fundamentally wrong with the configuration or is it just impossible to set custom subfolders for log files and Webalizer files?

You don't do that layout in Virtualmin, sorry ... sub-servers are always under the parent server's home directory.

To clarify, I would like to also change the default admin user, so then the home folder structure would probably be something like this:

home/adminuser/firstdomain.com/ home/adminuser/firstdomainsubserver.com/ home adminuser/seconddomain.com/

Sorry, but that format isn't supported either ..

And in case the "domains" folder is hard coded to sub-servers then I would like the home folder structure to be one of the following:

home/domains/top-level-server.com/ home/domains/sub-server.com/ home/domains/sub-server-2.com/

or

home/adminuser/domains/top-level-server.com/ home/adminuser/domains/sub-server.com/ home/adminuser/domains/sub-server-2.com/

Or do I have to create a dummy top-level server with no website or any other services (for example: home/adminuser/) and the create all the actual domains as sub-servers (for example: home/adminuser/domains/sub-server.com/)?

You'd have to create a dummy top-level server (perhaps with no website or DNS zone), and then create all your real domains as sub-servers..

How does one exactly configure a top-level server without website, DNS zones and cgi-bin, etc, fcgi-bin, tmp and user folders?

I must admit that this sounds like a limitation for the software, not to be able to set the home folder structure as wanted even there is variables like $HOME and $DOM…

When creating a Virtual Server, you can disable all the features, such as "BIND DNS Domain" and "Apache Website". That won't prevent creation of all the directories, though it will disable many of them.

OK, I managed to create dummy top-lever server.

While creating a sub-server I get an error installing PHPMyAdmin. It complains about the directory.

What is the phpMyAdmin error exactly?