• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8287
  • Last Modified:

Plesk change vhost document root

I'm running plesk reloaded on linux and I'm trying to get CakePHP (PHP version of Ruby on Rails) running on a virtual host. The only thing you need to do to get Cake running under a regular Apache install (which I have on my local mac) is to change httpd.conf's Document Root to be Cake's webroot (/cake/app/webroot) like so...

// code start

<VirtualHost *:80>
    ServerAdmin user@<domain>.com
    ServerName <domain>.com
    DocumentRoot /Library/WebServer/Documents/<domain>/cake/app/webroot
    ErrorLog /Library/WebServer/Documents/<domain>/logs/<domain>.com-error_log.log
    CustomLog /Library/WebServer/Documents/<domain>/logs/<domain>.com-access_log.log common
       <Directory /Library/WebServer/Documents/<domain>/www>
         Options Indexes ExecCGI FollowSymLinks MultiViews
         AddHandler cgi-script .cgi
         AllowOverride all
         Order allow,deny
         Allow from all

// code end

I know in Plesk that there's no httpd.conf file but rather a httpd.include file in each virtual host's conf directory with is generated by Plesk and that if you want to make any changes to your environment you create a vhost.conf file. My question is what goes in that vhost.conf file to change the document root? And how does Plesk know that it should be reading vhost.conf rather than httpd.include?

The frustrating thing is I've done something similar to change the PHP environment for one of my virtual hosts and I know you had to use something like "webservmng -vhost --something" to let it know to use the vhost.conf file. I only get my hands dirty with Apache/Unix commands about twice a year so it's like starting from scratch each time :(
1 Solution
websrvmng --reconfigure-vhost --vhost-name=domain.com

> what goes in that vhost.conf file to change the document root?

try to use the DocumentRoot directive
DocumentRoot /path/to/your/new/root
     <Directory  /path/to/your/new/root>
         # do you really need all options?
         Options Indexes ExecCGI FollowSymLinks MultiViews
         AddHandler cgi-script .cgi
         # are you using .htaccess files? if not, set it from all to none
         AllowOverride all
         Order allow,deny
         Allow from all
vixiomAuthor Commented:
Awesome, that worked thanks so much.

I actually had to use /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.com

--reconfigure... threw an error.

Don't know why I couldn't find simple info like that on Google or the Plesk site (my hosting tech help also didn't live up to their name)

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now