• 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

Which Subdomain dir to use

S

shedii

Guest
When creating a subdomain in PLesk this dir created:
/var/www/vhosts/myhost/subdomains

but to use Rewrite in vhost.conf shouldn't subdomain directories be under httpdocs?

Also the main domain has separate directory for httpdocs/httpsdocs can subdomain have one directory for both? Or should they also be separated?
 
Plesk creates subdomains under domain.com/subdomains, whereas 4PSA's TotalDomains package puts it under the domain's httpdocs and httpsdocs directories.

Either way can work, but Plesk's way does pose a bit more of manual work.

The Plesk created subdomains should have it's own conf directory structure to hold it's vhost.conf and vhost_ssl.conf. You will probably have to create the ~/domain.com/subdomains/subdomname/conf directory yourself, and add the
Include statement manually into the main domain's httpd.include file, then run the /usr/local/psa/admin/bin/websrvmng -u --vhost-name=domain.tld and restart apache.

[Edit: Please see my post below for clarification of directory structure]

Subdomains can also have both httpdocs and httpsdocs as separate directories, Plesk still has some work to do on the subdomain arena, right now I would say they have the begining basics.
 
jamesyeeoc, I was hoping you would respond.

You will probably have to create the ~/domain.com/subdomains/subdomname.tld/conf directory yourself,

This part was unclear. Do I need to make this directory? And use the directory Plesk made ... ~/domain.com/subdomains/subdomname/conf
 
Depending on your server, the subdomain conf directory will be located in one of the following:

/home/httpd/vhosts/domain.tld/subdomains/subdomname/conf

or

/var/www/vhosts/domain.tld/subdomains/subdomname/conf

If it does not already exist, then create it. You would put your vhost.conf or vhost_ssl.conf files in this directory.

If the SSL directory does not already exist, then create that as well (if you need it).

/home/httpd/vhosts/domain.tld/subdomains/subdomname/httpsdocs

or

/var/www/vhosts/domain.tld/subdomains/subdomname/httpsdocs

This is all basic *nix OS and Apache stuff, as far as "if it don't exist and it's needed, then create it".

Oh, and to create these you will need to use SSH to connect to the server and login as the root user, or be able to SU to root privileges. (for any future readers who didn't know)
 
thanks jamesyeeoc! I was focusing to much on the example you gave the first time

~/domain.com/subdomains/subdomname.tld/conf

Just thought I would be sure. again thanks
 
Sorry, I made a typo. I'll correct it in the original post now... thanks.
 
In a previous post you stated
Here is what I do, I keep all subdomains under:

/home/httpd/vhosts/mydomain.com/httpdocs/subdomains/

and in the main domain's ~/conf/vhost.conf file I put:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteMap lowercase int:tolower
ServerAlias forums.mydomain.com
RewriteCond %{HTTP_HOST} ^forums.mydomain.com$
RewriteCond %{REQUEST_URI} !^/subdomains/forums/
RewriteCond %{REQUEST_URI} !error_docs
RewriteRule (.*) /subdomains/forums/$1
</IfModule>

I don't have a vhost.conf for either mydomain or subdomain. Here is what I want to do

http://mambo.mydomain.com/
http://mambo.mydomain.com/dev/
http://mambo.mydomain.com/test/
http://mambo.mydomain.com/qa/

Your ideas on this please
 
In a previous post....
Yes, but that's because I don't use the Plesk Control Panel to create the subdomains. If you use it, it will create the subdomains in /home/httpd/vhosts/domain.com/subdomains (ie. outside of the domain's docroot).

Your original post
When creating a subdomain in PLesk
indicated you would be using the Plesk CP to create subdomains. You asked:
shouldn't subdomain directories be under httpdocs?
Which is what I was answering, and in the case of using Plesk to create them, the answer is 'nope'.

Once you create the subdomain with Plesk, the 'mambo.mydomain.com' is already handled (not with rewrites), so the other ones you list should be no problem.
 
Back
Top