Most of the howto’s or tutorials we came across about this problem all mention to install suphp and run php as a cgi through it. We weren’t happy with this solution, so we did something different.

Basically the problem is:

Plesk runs apache as “www-data:www-data” while the users are “username:psacln”. So, uploading via sftp or ftp will work fine, but when you go to install something from the control panel in Joomla, it will be installed as www-data:www-data. Obviously, this is a problem since joomla won’t be able to run it properly.

So, our fix was this:

  1. Install mod-itk

     # apt-get install apache2-mpm-itk
    
  2. Enter your VHOST directory

     # cd /var/www/vhosts/[DOMAIN]/conf
    
  3. Edit the vhosts file

     # nano vhost.conf
    
  4. Copy the following into the file, changing the user to your domain user.

     <IfModule mpm_itk_module>  
     AssignUserId DOMAINUSER psacln  
     </IfModule>
    
  5. Restart apache like this:

     # /etc/init.d/apache2 restart
    

Now you should have apache back up, and each time it runs it will be running as your domain user, not www-data. Problem solved, without the use of php-cgi. Sweet!

Comments

Comment by diastasi on 2009-10-29 13:14:38 -0500

Dont forget to run in SSH:

/usr/local/psa/admin/bin/websrvmng -a

or else Plesk will not include vhost.conf

cheers

Comment by Jeff Walters on 2009-12-31 12:12:41 -0500

Interesting Apache mod! It looks exactly like what I need to configure SugarCRM on Plesk, without the typical user/group problems (chmod 777 *). Did you test the typical Plesk features to make sure everything still works as usual? For example, the phpMyAdmin tool, web site, web based email client? Did they all work ok? I’m considering trying mod-itk, but I don’t have a server to test it on. How dangerous do you consider this mod?

Thanks,
Jeff Walters

Comment by wouter on 2010-09-08 03:37:07 -0500

Nice article, please keep in mind that running MPM may cause security issues since it requires root rights (for setuid())