How to set up a clean web hosting directory layout in Plesk 11.5?

If you are using Plesk as a server control panel and took part in all updates starting with some Plesk 10 version, you will notice that your recent version (Plesk 11.5 currently) has a total mess with respect to the web hosting directory layout. That's because during some of these updates, Plesk migrated its hosting directory structure, and now the old and new ones are mixed.

The new Plesk web hosting directory layout

Say you have two subscriptions (subscribers being the same or different customers, or even you as an admin). Each subscription has one subdomain and one additional domain. Then the web hosting directory layout would be like this (using placeholder domain names here):

  • /var/www/vhosts/subscr1-maindomain.com/subscr1-maindomain.com/
  • /var/www/vhosts/subscr1-maindomain.com/sub.subscr1-domain.com/
  • /var/www/vhosts/subscr1-maindomain.com/subscr1-otherdomain.com/
  • /var/www/vhosts/subscr2-maindomain.com/subscr2-maindomain.com/
  • /var/www/vhosts/subscr2-maindomain.com/sub.subscr2-domain/
  • /var/www/vhosts/subscr2-maindomain.com/subscr2-otherdomain.com/

Plus, in /var/www/vhosts/system/ there will be a directory for each domain and subdomain, named with its domain name, and containing subdirectories conf/, logs/ and statistics/.

Recommendation for using this directory layout

One subscription per (sub)domain. We want a directory structure that is logical and consistent, so it's not acceptable to find directories for some but not all domains inside /var/www/vhosts/. The only solution I could come up with so far is creating a new subscription for every single domain and subdomain that you want to host. And then to name the document root directory for hosting the main domain of that subscription always htdocs rather than with the domain name.

Problem: if you have a domain-restricted Plesk licence. With this method, you will run into problem depending on your Plesk licence. For example, if you have the typical "10 domains" licence. Because in this setup, every subdomain is created as its own Plesk domain record, so taking up one of the 10 available domains. While creating Plesk subdomain records for cases where their parent domain is also hosted in Plesk would not take up anything from your licence. But in my view: cleanliness first 🙂 And it's another reason to move to a recommendable, free and open source web hosting control panel.

Removing old, legacy elements. The following elements of the directory structure are probably legacy ones from the earlier Plesk versions and can be safely removed. However, I did not test this, so rename them first and check if everything still works before removing them:

  • /var/www/vhosts/example.com/subdomains/
  • /var/www/vhosts/example.com/conf/ (a symbolic link)
  • /var/www/vhosts/sub.example.com/ (in cases where this contains only conf/, logs/, statistics/ for a domain or subdomain that is an add-on domain for a subscription with another main domain, and has its document root inside that main domain's directory)
  • /var/www/vhosts/httpsdocs/ (probably not needed, as the new place seems to be /var/www/vhosts/default/httpsdocs/)

Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.