• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Question Wordpress and directory permissions

jms123

New Pleskian
We have multiple domains being managed by Plesk, some of them have wordpress which is managed within Plesk and some have wordpress which is managed outside of Plesk (but the domain is still managed within Plesk).

The issue is with wordpress managed outside of Plesk and updates failing.

As far as I can tell this is because the update process runs as apache and that user has no permissions to write to directories within the domains.

I don't want to chmod 777 everything so the only thing I can think of is to add the apache user to the psacln group and then chmod 775 the wordpress directories.

Couple of questions -

1) is this the best approach or is there a much easier way to do it

2) are there any consequences to adding apache to the psacln group ?

Thanks

Jon
 
We have multiple domains being managed by Plesk, some of them have wordpress which is managed within Plesk and some have wordpress which is managed outside of Plesk (but the domain is still managed within Plesk).

The issue is with wordpress managed outside of Plesk and updates failing.

As far as I can tell this is because the update process runs as apache and that user has no permissions to write to directories within the domains.

I don't want to chmod 777 everything so the only thing I can think of is to add the apache user to the psacln group and then chmod 775 the wordpress directories.

Couple of questions -

1) is this the best approach or is there a much easier way to do it

2) are there any consequences to adding apache to the psacln group ?

Thanks

Jon

Hello,
If your domain are managed by Plesk, I do not understand why your wordpress websites (managed outside of Plesk) do not use the same user:group than your wordpress websites managed by Plesk ?
In subscription, sites's files should be owned by : susbscription-user:psacln, WordPress folder permission should be 755 and files permissions 644.
It shouldn't be a problem to update wordpress with those settings.
 
Hi

They do use the same user:group combination (subscription-user, psacln) and that is the problem as far as I can tell.

When Plesk does not control wordpress when wordpress updates as far as I know the user it runs as is apache and the apache user does not have permissions to write to the wordpress directories because they have the "subscription-user, psacln" user/group settings.

Or have I got that wrong and wordpress is not running as apache ?
 
Apache can access and modify all files hat belong to group psacln, unless those files are read only.
 
Hi Peter

Thanks for that, clears a few things up.

The Wordpress directories are 755 so on the group settings that means no write permissions for apache which I think is the issue because the domains within plesk have a "subscription-user:psacln" owner/group setup.

So would just changing to 775 for the domains where wordpress is outside of Plesk's control fix the issue ?

Hope that makes sense.

Jon
 
Hi Peter

Thanks for that, clears a few things up.

The Wordpress directories are 755 so on the group settings that means no write permissions for apache which I think is the issue because the domains within plesk have a "subscription-user:psacln" owner/group setup.

So would just changing to 775 for the domains where wordpress is outside of Plesk's control fix the issue ?

Hope that makes sense.

Jon

Hello @jms123,

this is not related to apache user/group, because each subscription use his own php-fpm pool with Plesk (with subscription-user:psacln) and not apache mod_php. Apache2 user:group is www-data:www-data, but apache is able to access to your site files because httpdocs folder group is psaserv.
Changing permissions to 775 will not fix the issue. From the command line, you can apply proper permissions with :
Code:
cd /path/to/wordpress/folder 
find -type d -exec chmod 755 {} \; 
find -type f -exec chmod 644 {} \;
 
They already have those permissions so that will not fix it.

All I know is wordpress sites where there is a wordpress instance in Plesk work fine but wordpress sites that do not have an instance in Plesk but the domain is still managed by Plesk do not work.

I can't work out why.
 
Back
Top