Sub domain creation got messed up

Hi there,

Something really got messed up with creating sub-servers in my VM Pro installation!

I haven’t changed the server templates or anything else and the sub-server/sub-domain use the (modified) default server templates anyway, so I don’t know why this behaves differently now than a couple of weeks ago.

I just created a new server magento-webshop.ch and afterwards created the sub-domain demo.magento-webshop.ch which resulted in this file tree:

tree -L 3

.
|-- awstats
|-- base
|-- cgi-bin
| |-- awstats.pl
| |-- demo
| | |-- php4.cgi
| | -- php5.cgi | |-- lang -> /usr/share/awstats/lang/lang | |-- lib -> /usr/share/awstats/lib/lib | |-- php4.cgi | |-- php5.cgi | – plugins -> /usr/share/awstats/plugins/plugins
|-- domains
| -- demo.magento-webshop.ch | |-- base | |-- cgi-bin | |-- domains | |-- errors | |-- etc | |-- ftp | |-- homes | |-- htdocs | |-- logs | |-- perl | |-- ssl | – tmp
|-- etc
| |-- dav.digest.passwd
| |-- php.ini -> php4/php.ini
| |-- php4
| | -- php.ini | – php5
| -- php.ini |-- ftp |-- homes |-- htdocs | |-- awstats-icon -> /usr/share/awstats/icon | |-- demo | |-- errors -> ../errors | – icon -> /usr/share/awstats/icon
|-- logs
| |-- access_log
| -- error_log |-- mail |-- perl |-- ssl – tmp

The first part of the sub domain’s apache config looks like this:

ServerName demo.magento-webshop.ch
ServerAlias www.demo.magento-webshop.ch
DocumentRoot /var/www/virtual/magento-webshop.ch/htdocs/demo
ErrorLog /var/www/virtual/magento-webshop.ch/logs/error_log
CustomLog /var/www/virtual/magento-webshop.ch/logs/access_log combined
ScriptAlias /cgi-bin/ /var/www/virtual/magento-webshop.ch/cgi-bin/demo/
DirectoryIndex index.html index.htm index.php index.php4 index.php5

whereas the DocumentRoot should actually be /var/www/virtual/magento-webshop.ch/domains/demo.magento-webshop.ch/htdocs/

Strangely enough, VM creates two different directories

/var/www/virtual/magento-webshop.ch/domains/demo.magento-webshop.ch/htdocs/
and
/var/www/virtual/magento-webshop.ch/htdocs/demo

The latter path then goes into the Apache configuration, although nothing like that is specified in the template:

ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/htdocs
ErrorLog ${HOME}/logs/error_log
CustomLog ${HOME}/logs/access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5

This has been working without any problems a couple of weeks ago.

Any pointers as to where the problem could be would be very much appreciated.

Cheers, Nick

Hi Nick,

You might want to appraise us with your OS and version numbers. I can’t think of a good reason that the account creation would redirect to apache root straight out of the box. But you did say modified, what modifications did you make?

The bug as http://www.virtualmin.com/bugs/index.php?do=details&task_id=3505 covers the cause of this. Short version - it was created as a sub-domain instead of a sub-server.

Thanks for the pointer, Jamie.

Hi Dan,

I’m on Debian Sarge using Apache 2.2, PHP5, MySQL5, etc.

The "Directives and settings for new websites" are set like so:

ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/htdocs
ErrorLog ${HOME}/logs/error_log
CustomLog ${HOME}/logs/access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5

php_admin_value open_basedir "/var/www/virtual/${DOM}:/var/www/virtual/${DOM}/phptmp:/usr/share/php:/var/www/typo3:/var/www/virtual/typo3"

<Directory ${HOME}/htdocs>
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
</Directory>

<Directory ${HOME}/cgi-bin>
allow from all
</Directory>

“Users’ website subdirectory to create” has been changed from the default public_html to htdocs, because I was migrating from another control panel that used a different file tree.

The really strange thing is that this worked without any problems before so it might well be possible that any of the recent VM Pro upgrades introduced some sort of bug that is causing this problem.

Cheers, Nick

Hi Dan,

I’m on Debian Sarge using Apache 2.2, PHP5, MySQL5, etc.

The "Directives and settings for new websites" are set like so:

ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/htdocs
ErrorLog ${HOME}/logs/error_log
CustomLog ${HOME}/logs/access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5

php_admin_value open_basedir "/var/www/virtual/${DOM}:/var/www/virtual/${DOM}/phptmp:/usr/share/php:/var/www/typo3:/var/www/virtual/typo3"

<Directory ${HOME}/htdocs>
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
</Directory>

<Directory ${HOME}/cgi-bin>
allow from all
</Directory>

“Users’ website subdirectory to create” has been changed from the default public_html to htdocs, because I was migrating from another control panel that used a different file tree.

The really strange thing is that this worked without any problems before so it might well be possible that any of the recent VM Pro upgrades introduced some sort of bug that is causing this problem.

Cheers, Nick