Plesk: Unable to create subdomain

Earlier today my client asked me to fix his Plesk, it can't create a subdomain.
Plesk only shows some generic error message from its interface. Upon checking the Plesk logs, I found this:

Skeleton directory `/var/www/vhosts/.skel/0' does not exist

Pretty simple, it means that /var/www/vhosts/.skel/0/ directory was deleted.
The work around is to simply recreate those directories. You may just copy the default Plesk files from any of your domain:

-bash-3.2# cp -a /var/www/vhosts/my-existing-domain.com/httpdocs/ /var/www/vhosts/.skel/0/httpdocs/
-bash-3.2# cp -a /var/www/vhosts/my-existing-domain.com/httpsdocs/ /var/www/vhosts/.skel/0/httpsdocs/
-bash-3.2# cp -a /var/www/vhosts/my-existing-domain/cgi-bin /var/www/vhosts/.skel/0/cgi-bin/
-bash-3.2# cp -a /var/www/vhosts/my-existing-domain/error_docs/ /var/www/vhosts/.skel/0/error_docs
/

If you'll attempt to create the subdomain now, I'm sure it will still fail.
Because even though it failed initially, Plesk still created the subdomain but without having those default files since they did not exist (from the .sked/0/ directory).

To remove the subdomain, issue the command below:

/usr/local/psa/admin/sbin/subdomainmng --remove --subdomain-name=testsubdomain --vhost-name=yourdomain.com

Go back to Plesk. You should be able to create the subdomain now.

No comments:

Post a Comment