• The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

How to change the document directory for a phisical hosting

S

surfweb

Guest
Hello, I'm a newbie of Plesk forum.

I installed Plesk 8.1.1 in my server and has one virtual domain(Phisical hosting) in the server of RedHat Enterprise4.

It seems to be very easy to create a new domain through control panel but the document directory is determined to
/var/www/vhosts/mydomain.com/httpdocs automatically.

Now I want to have the additional domain like mydomain2.com under mydomain.com and configure the document directory to /var/www/vhosts/mydomain.com/httpdocs/mydomain2/

In this case, http://www.mydomain2.com/index.html must go to /var/www/vhosts/mydomain.com/httpdocs/mydomain2/index.html

then how may I do?

First I could do it by editting below file,
/var/www/vhosts/mydomain2.com/conf/httpd.include

DocumentRoot /var/www/vhosts/mydomain.com/httpdocs/mydomain2

but I knew that Pleask rewrited this file to /var/www/vhosts/mydomain2.com/httpdocs/
for the document directoty.

Any advice would be appreciated.

Thank you.
 
Having a separate domain with the DocumentRoot within another domain is not possible in Plesk by design.

But, you can create a 'webuser' for a domain in Plesk which default DocumentRoot will be in /var/www/vhosts/DOMAIN.COM/webusers/USERNAME.

Or you can create a subdomain in Plesk for a given domain. In this case its DocumentRoot will be in /var/www/vhosts/DOMAIN.COM/subdomains/SUBDOMAINE_NAME/httpdocs/

The webusers and subdomains are currently the only possibilities to have "something more" within the original domain's virtual host.

Also, as you know, when creating a domain in Plesk the area /var/www/vhosts/DOMAIN.COM/ becomes a private home dir for the FTP user of the domain. So putting DocumentRoot of another domain to the DocumentRoot of the given one (e.g. by manual editing httpd.include files) brakes the the general security.


From the other hand, I will try to guess what you really need. You want the second domain B to point to the specific URL on another domain A. The best solution for this, I think, is to setup domain B not as a Physical Hosting, but as a Forwarding to the URL on domain A. This is a standard and old feature in Plesk. After such forwarding is setup, then all requests for domain B will be pointed to the needed URL on domain A.

Sincerely,
Lych.
 
Thank you for the detail advice.

> From the other hand, I will try to guess what you really need.

Well, I'm going to host 30 domains on one server. All sites need frequent updates by logging into ftp.

In a current Plesk phisical hosting, I must login to each 30 individual ftp accounts everytime when I update the site so I want to put those domains under the one main domain(mymaindomain.com) and manage another 29 domains with one time ftp login.

If the document directory for another 29 domains are able to be configured to
/var/www/vhosts/mymaindomain.com/httpdocs/mydomain2/
/var/www/vhosts/mymaindomain.com/httpdocs/mydomain3/
/var/www/vhosts/mymaindomain.com/httpdocs/mydomain4/
.
.
/var/www/vhosts/mymaindomain.com/httpdocs/mydomain29/

I can update/upload files for all 30 domains by loggin into one ftp account of mymaindomain.com, just down the directory in ftp for another domains.

By the way,
/var/www/vhosts/mydomain2.com/conf/httpd.include file descibes as follows,

# ATTENTION!
# DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN IMPROPER PLESK
# FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU REQUIRE CUSTOM
# MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM THEM IN THE
# FOLLOWING FILE(S):
# /var/www/vhosts/mydomain2.com/conf/vhost.conf
# /var/www/vhosts/mydomain2.com/subdomains/<subdomain-name>/conf/vhost.conf

Does it mean that the document directory can be changed by adding the file of vost.conf and writing something in this file?

In addition I found below url,
http://download1.swsoft.com/Plesk/Plesk8.2/Doc/plesk-8.2-unix-administrators-guide/17359.htm

but I could not understand what it meant.

Server is RedHat Enterprise4.

Thank you.
 
Yes, vhost.conf file is used to add custom configuration to the default VirtualHost configuration of the given domain. And I though about it.

The main problem here is that you will need to not only setup new "DocumentRoot" path in vhost.conf, but also probably to override other VirtualHost configuration defined in httpd.include. Because few Apache directives in httpd.include are applied for the specific directories, which assume that the DocumentRoot should be default. Take a look on all paths mentioned in httpd.include and then try to override them in vhost.conf file if you feel it is needed.

Also, the default domain's VirtualHost configuration in httpd.include defines an FTP user. If files in altered DocumentRoot are not readable by that user then accessing this domain will cause something error like "Permission denied" in browser.
But when you edit files under a specific FTP user then all files are created with this FTP user as owner. In your case, if you setup what you propose, all files of all domains will have the same FTP user as owner, but the default users defined in httpd.include are different, which could cause the problems. So you will have to try overriding the usernames too in vhost.conf.


But as for me, I do not think such work is defensible. I think it is much more convenient to use an FTP client which stores login info for each account and does not require you to type the login/password each time. E.g. Far manager. It is a more correct way, and you do not have to mess up with the vhost.conf files.
 
Hi,

I've encountered similar problems with Helm on my old Windows hosting account. URL Forwarding works for redirecting www.domain2.com to www.domain1.com/domain2folder but the address bar changes to the www.domain1.com/domain2folder url.

To keep www.domain2.com in the address bar, you'll need to create an index.htm file in www.domain1.com/domain2folder/index.htm with a framed redirect in it. Seems to be the only wat for this to work but your problem with logging into one FTP account to manage all domains is a tricky one.

The best solution is to change to cPanel software which lets you set a seperate document root for all add-on domains. Another solution which will be available soon is Encompass for Windows.
 
Fran,

This is topic about Plesk for Linux. Could you please inform me what relation these mentioned by you Windows products to this topic have?
 
Back
Top