Networking, Programming and Graphics - Tutorials
ONLINEHOWTO.net Tutorials Category

Change DocumentRoot folder in Apache with Plesk

Type: Code Networking, Programming and Graphics - Tutorials
Networking, Programming and Graphics - Tutorials
Level: Intermediate Networking, Programming and Graphics - Tutorials Networking, Programming and Graphics - Tutorials 
Networking, Programming and Graphics - Tutorials
Date: 2007-Feb-01
Networking, Programming and Graphics - Tutorials
Visited: 7729 times
Networking, Programming and Graphics - Tutorials
Rating: Networking, Programming and Graphics - Tutorials
Networking, Programming and Graphics - Tutorials
Published: Tony Potter

This tutorial will show you how to change permanently the DocumentRoot folder when you have Linux server with running Plesk.
It is useful when you have CMS (Content management system) or specific website settings and the DocumentRoot folder must be moved.

Access your server with your favorite ssh, for example Putty.
Open your domain home directory and locate 'conf' folder. Enter inside and create one 'vhost.conf' file.
#touch vhost.conf
when the file is created edit it with text editor to add the DocimentRoot line as it is shown bellow.
#Here are some examples.
# FreeBSD with Plesk 8.0.1
DocumentRoot /usr/local/psa/home/vhosts/yourdomainname.tld/httpdocs/new_DocumentRoot_folder

#FreeBSD with Plesk 8.1
DocumentRoot /usr/local/www/vhosts/yourdomainname.tld/httpdocs/new_DocumentRoot_folder


#Fedora Plesk 8.1
DocumentRoot /var/www/vhosts/yourdomainname.tld/httpdocs/folder/new_DocumentRoot_folder
When you are ready and you have this vhost.conf file created you must include it into the httpd.include file inside the Virtual Host section.
<VirtualHost 192.168.0.0:80>
        ....
        Include %vhosts_DIR%/yourdomain.tld/conf/vhost.conf
</VirtualHost>
When you are ready restart the Apache from the Plesk Control Panel or command line in order the change will take effect.

Note: The same can be done for SSL connection, but this time the file must be called vhost._ssl.conf and to be included into the https section in 'httpd.iclude'
Rate this tutorial:                    
Post Comment

    • ( ashwini_singh321 [ at ] yahoo . co . in ),

      posted on 2009-Nov-01 | 10:41:48 PM
      What option on plesk should be enable so that i can change permission of file and folder through FTP. This save time because plesk is very slow. So i mainly use FTP. Any solution.
    • ( stephen [ at ] onlinehowto . net ),

      posted on 2009-Nov-08 | 12:15:45 PM
      Hello Ashwini,

      Well you can change permission vi ftp just out of the box. How to do it generally depends on the ftp client you use but in the command line the command for that is is chmod.

      Best regards,
      Stephen Think

    • posted on 2009-Nov-10 | 03:25:27 AM
      Also you may consider the SAFE_MODE option. If Apache runs with different users this could be a reason.
      In the new Parallels (new Plesk's name) this is very modern, specially when your ISP is not allowing CGI Apache mode.
Need a specific tutorial? Do not hesitate and submit a request!
Your e-mail: