1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Wordpress Owner/Group/Permission Issues

Discussion in 'Plesk 9.x for Linux Issues, Fixes, How-To' started by sparkweb, Jan 24, 2011.

  1. sparkweb

    sparkweb Guest

    0
     
    I have a client running a Wordpress installation, and I'm, having trouble with it writing to files or uploading and writing images to the uploads folder from within the Wordpress installation due to ownership issues.

    My Plesk installation by default creates a folder's owner/group as the usersFtp/pcacln, where the usersFtp is whatever the user's FTP account is.

    In order to upload image files using the built-in Wordpress uploader, I had to set other/public permissions to r-w-x. Allowing both the owner and the group to write did not work, indicating that the Web server was not included in either owner or group. After uploading the images, they indeed were now assigned owner/group of apache/apache. So the WP installation is as expected using Apache as the owner.

    But this is an untenable and unsafe way to run a Web site. I can't have files that need to be writable with public write permissions, and I can't be switching permissions back and forth every time someone wants to upload an image, and as far as I understand, it's not safe to have Apache own the files.

    Does anyone have a reasonable solution to this problem?

    What happens if I change the pcacln group to Apache? Doesn't Plesk need this group for something?

    What if I assign both pcacln and apache to a single group and assign the files that group? (And does anyone know how to create groups? -- yes I can SSH and use command line to some extent --I am using Putty).

    Is it possible to use php's suexec, and how do I activate it?

    ------UPDATE------

    I have discovered that the answer may be to simply run php as fastcgi so that php runs as the domain/FTP user. It also appears this utilizes suexec.

    If this is so, anyone have any pointers on how to do this?


    THANKS B-)


    Thank YOU...
    :)
    Eric
     
    Last edited by a moderator: Jan 24, 2011
  2. sparkweb

    sparkweb Guest

    0
     
    I have the Answer

    If anyone else has this problem, whether it's Wordpress, Joomla, Drupal, or any other CMS, or any other dynamic site using php scripts for that matter which are trying to write to files or upload files to the server, here's the answer:

    http://wiki.mediatemple.net/w/DV:Run_PHP_as_FastCGI_and_resolve_Apache_permission_errors.

    What is comes down to is that the php script that is trying to write the files to the server does not have permission to do so because it is being executed by Apache as a module. When you set it up as FastCGi and use suexec the right way, Apache now runs php using the domain user. See the above thread.

    Cheers

    B-)
     
Loading...