• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Filesystem for subdomains

DieterWerner

Regular Pleskian
When I add a subdomain to an existing domain, Plesk doesn't create the needed filesystem.
Do I something wrong?
 
What do you mean by "filesystem"? You mean the vhost template files?

I just tested it on Plesk 17.8.11 MU#52 and when I create a subdomain then the directory for the subdomain is created and the vhost template files are copied into it.
 
What do you mean by "filesystem"? You mean the vhost template files?

I just tested it on Plesk 17.8.11 MU#52 and when I create a subdomain then the directory for the subdomain is created and the vhost template files are copied into it.
I see only the dirs:
- css
- img
- test

and the files:
- favicon.ico
- index.html
 
Yes, this is exactly what it is supposed to do. This is the default vhost template (as defined in Tools & Settings => Virtual Host Template).

Which other files or directories did you expect and why?
 
Yes, this is exactly what it is supposed to do. This is the default vhost template (as defined in Tools & Settings => Virtual Host Template).

Which other files or directories did you expect and why?
At least:
- cgi-bin
- httpdocs
- logs
- tmp
 
- httpdocs: This folder only exists for a main domain. A subdomain does not need a separate httpdocs folder, as the document root of a subdomain is already specified when you create a subdomain ("Document root"). By default the document root has the same name as the subdomain but of course you can select your own name and path if you like

- logs: This directory is in /var/www/vhosts/system/name.of.subdomain/logs, hard-linked to /var/www/vhosts/name.of.maindomain/logs/name.of.subdomain/

- tmp: This directory is not needed

- cgi-bin: In my environment, the cgi-bin directory is created inside the subdomain document root, but only if you check the "CGI support" checkbox when you create the subdomain

=> So all in all, everything is working as expected. I don't see any issue here.
 
You _do_ have the same directory structure inside the document root. Your website only cares about the structure inside the document root, it doesn't (or shouldn't, if done properly) care where the document root is physically located on the server.

We have thousands of customers who do exactly what you want to do: They have a staging subdomain like "staging.mydomain.tld" and a live website on "mydomain.tld". And no one of them ever had an issue with the physical path of the document root.

If you really insist to have a /httpdocs folder for each of your subdomains then do what I suggested in my previous reply: When you create a subdomain, example "sub1.mydomain.tld" then you specify the document root as "/sub1.mydomain.tld/httpdocs" (instead of only "/sub1.mydomain.tld").
 
If you really insist to have a /httpdocs folder for each of your subdomains then do what I suggested in my previous reply: When you create a subdomain, example "sub1.mydomain.tld" then you specify the document root as "/sub1.mydomain.tld/httpdocs" (instead of only "/sub1.mydomain.tld").
That's exactly what I did but the index.html doesn't appear - browser say: can't find ...
and:
I need the cgi-bin dir above of the document root (similar to the parent domain)
 
Last edited:
Without going into details as to why, what you can do is to simply create a subdomain as if it was a regular domain.

So, create example.com, then create subdomain.example.com in exactly the same way as you did example.com (in the same way you'd create an example2.com domain if you had it).

This will give you complete separation between the domain and the subdomain.
 
Last edited:
Without going into details as to why, what you can is to simply create a subdomain as it was a regular domain.

So, create example.com, then create subdomain.example.com in exactly the same way as you did example.com (in the same way you'd create an example2.com domain if you had it).

This will give you complete separation between the domain and the subdomain.
That's great and it seems to work - thanks for the hint.

Edit:
All tests were successful - perfect, I'm thrilled.
The method should became a part of the plesk doku.
 
Last edited:
Back
Top