Summary:
Problem: Normally the domains point to www, public_html, or httpdocs folder. Change this to some other folder.
e.g., httpdocs/Somefolder.
Solutions:
1. Goto /var/www/vhosts/<domain>/conf
2. Create file vhost.conf
3. enter this line
DocumentRoot /var/www/vhosts/(yourdomain.com)/httpdocs/(path-to-new-document-root)
4. Save File
5. enter this command in your ssh terminal /usr/local/psa/admin/bin/websrvmng -a.
Full Description
How to change the default document directory in Plesk for a domain or subdomain.
Sometimes it’s tricky to get a package installation to install exactly how you want it.
Plesk uses:
/var/www/vhosts/(yourdomain.com)/httpdocs
as the default document directory from which to serve up pages. If it’s a subdomain you’ll find it in:
/var/www/vhosts/(yourdomain.com)/subdomains/(subdomain name)/httpdocs
This might not work for you for any number of reasons and you might need to set the default document directory to something different. All you need to do is create a vhost.conf file that tells Apache where to look. (Plesk is the control panel, Apache is the web server software bundled with it.)
The procedure is really simple but it’s a little different for subdomains than for the main domain. We’ll start with the main domain.
Use whatever text editor you like best. (I’m a huge fan of Notepad++ when stuck working on a Windows box but Notepad will work just as well.) Create a file called vhost.conf with a single line:
DocumentRoot /var/www/vhosts/httpdocs/(yourdomain.com)/httpdocs/(path-to-new-document-root)
Replace (yourdomain.com) with your domain and (path-to-new-document-root) with wherever you want Apache to read the files from.
FTP this file to:
/var/www/vhosts/(yourdomain.com)/conf
Now we need to tell Plesk to reload the configuration files. You’ll need console access to your server to do this. This is available from your Plesk control panel or if you have permission to SSH into the server you can use a program like Putty to logon to the server. Either way you need to execute the following command:
/usr/local/psa/admin/bin/websrvmng -a
Now if you type http://www.(yourdomain).com into your browser Apache will serve up files from your new directory.
If you’re setting a new document root for a subdomain you do pretty much the same thing. Create the vhost.conf file – again with a single line:
DocumentRoot /var/www/vhosts/(yourdomain.com)/subdomains/(subdomain name)/httpdocs/(path-to-new-document-root)
Again replacing (yourdomain.com) with your domain name, (subdomain name) with the subdomain you’re changing, and (path-to-new-document-root) with the path of the new document root directory.
FTP this file to:
/var/www/vhosts/(yourdomain.com)/subdomains/(subdomain name)/conf
Per the instructions listed above execute:
/usr/local/psa/admin/bin/websrvmng -a
to get Plesk to reload the configuration files. Finally – and this is important – for subdomains you also have to restart Apache. You do this by executing:
service httpd restart
from the command line or use your Plesk control panel to restart Apache under the System menu.
Now documents located at http://(subdomain name).(yourdomain).com will be served up from the new directory.