Virtualmin not creating user's home directory correctly.

I'm using a CentOS 6 VPS on ByteSized, installed from this template: http://download.openvz.org/template/precreated/centos-6-x86_64.tar.gz

My basic install process is to install using that image, update root password, enable remi and epel repo's, yum update, then finally install Virtualmin using the automated install process.

Modify the following... Home directory base = /home Home subdirectory = ${USER}/domains/${DOM}

I leave the default settings in Virtual server template details (Apache website)...

These are the errors when creating the Virtual server: Performing other Apache configuration .. .. configuration failed : Failed to copy /etc/php.ini to /home/duni/domains/duni.io/etc/php5/php.ini : cp: cannot create regular file `/home/duni/domains/duni.io/etc/php5/php.ini': No such file or directory

Setting up scheduled Webalizer reporting .. .. Webalizer reporting failed! : Failed to open /home/duni/domains/duni.io/public_html/stats/.htaccess.webmintmp.27979 : 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/duni/domains/duni.io/cgi-bin/awstats.pl.webmintmp.27979 : No such file or directory at ../web-lib-funcs.pl line 1360, line 1.

I can confirm that a /home/duni directory is never created.

#

Virtualmin seems awesome but getting virtualhosts created correctly with a clean install is failing and making me wonder why? :)

Status: 
Active

Comments

Why are you changing the "Home subdirectory" option though? I think that is the cause of the problem .. it can only be set to something like ${USER} or ${DOM}. Setting it to a directory a few levels down won't work, as those parent directories won't be created ...

deleting dupe post that didn't use  

Appreciate the quick response... I've just reinstalled once more, I've left the home and home subdirectory unchanged this time. I've modified the Virtual server template details (Apache website) as such...

ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/domains/${DOM}/public_html
ErrorLog /var/log/virtualmin/${DOM}_error_log
CustomLog /var/log/virtualmin/${DOM}_access_log combined
ScriptAlias /cgi-bin/ ${HOME}/domains/${DOM}/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory ${HOME}/domains/${DOM}/public_html>
Options -Indexes +IncludesNOEXEC +FollowSymLinks
allow from all
AllowOverride All
</Directory>
<Directory ${HOME}/domains/${DOM}/cgi-bin>
allow from all
</Directory>

Creating the virtual server now results in...

[root@bitlength duni]# ls -a
.  ..  .bash_logout  .bash_profile  .bashrc  cgi-bin  etc  fcgi-bin  homes  logs  public_html  tmp

So I'm still unsure where domains/duni.io/... is :)

The errors are:

Setting up scheduled Webalizer reporting ..
.. Webalizer reporting failed! : Failed to open /home/duni/domains/duni.io/public_html/stats/.htaccess.webmintmp.22292 : 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/duni/domains/duni.io/cgi-bin/awstats.pl.webmintmp.22292 : No such file or directory at ../web-lib-funcs.pl line 1360, line 1.

Re-starting DNS server ..
.. failed : Failed to start BIND : Starting named: Error in named configuration: zone localhost.localdomain/IN: loaded serial 0 zone localhost/IN: loaded serial 0 zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0 zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0 zone 0.in-addr.arpa/IN: loaded serial 0 zone duni.io/IN: NS 'bitlength.thalia.duni.io' has no address records (A or AAAA) zone duni.io/IN: not loaded due to errors. _default/duni.io/IN: bad zone [FAILED]

If I kill off the NS server bitlength.thalia.duni.io in the zone and leave gandi's 3 DNS servers BIND checks out okay after, not sure why I'm seeing this at any rate.

Ah, I think some of the confusion is in changing the defaults... by default, the primary domain for a given account is in /home/username.

That is, if the first domain that you're creating for an account is "duni.io" -- the DocumentRoot for that domain would be /home/duni/public_html.

If you were to create additional domains within that account, they would be placed into /home/duni/domains.

So, by changing the Server Templates so that the DocumentRoot is "DocumentRoot ${HOME}/domains/${DOM}/public_html", that's actually preventing it from working properly.

My recommendation would be to not change the default Apache website Server Template, and to use the default.

Gotcha. Didn't realize that was the case between the default and sub-domains.

Any ideas how to avoid the DNS issue without having to modify the zone later? Obviously if I manually add this record to the duni.io zone the problem is mitigated but I'm wondering why it wouldn't create it?

INFO - Checking for fully qualified hostname...
INFO - Hostname OK: fully qualified as bitlength.thalia.duni.io

bitlength.thalia.duni.io. IN A 94.242.209.152

Hmm, are you asking why it doesn't create a DNS record based on the hostname of your server during the instalaltion?

At installation time, no Virtual Servers are created, so it's not possible to add that record to an existing zone.

At the moment, it's necessary to manually add your hostname as a DNS record once you create a Virtual Server with that domain name.

However, for a release sometime down the road -- it may be possible, when creating a Virtual Server, to detect when the servers hostname can be added to the DNS zone. I'll talk to Jamie about that :-)

Thanks for the support, much appreciated.