We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Plesk change vhost document root

vixiom
vixiom asked
on
Medium Priority
8,447 Views
Last Modified: 2008-08-11
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
       </Directory>
</VirtualHost>

// 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 :(
Comment
Watch Question

Top Expert 2008
Commented:
Yes,
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
       </Directory>
#<-----

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

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)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.