I’ve been stuck on this for quite some time despite following plenty of guides and trying multiple combinations of file ownership/permissions to no avail. So I’m reaching out here in hopes someone might be able to help me.

I have a single droplet running CentOS serving up two websites. Following the DO guide, I created two directories (one for each website) and configured virtual hosts and set up WordPress on each site. My issue is when I attempt to update WordPress or some themes and plugins, I get errors that lead me to believe something with folder permissions is off. These errors are:

  • When attempting to update Wordpress: “Could not copy file.: wp-includes/SimplePie/Cache/Memcached.php”
  • When attempting to update theme: “Could not remove old theme”

I followed WordPress documentation and set 644 for files and 755 for directories. I’m beginning to wonder if one of the parent folders permissions is off? Below is permission info. Any information or suggestions would be greatly appreciated!

Directory/Files Owner/Group Permissions
var root/root drwxr-xr-x.
www apache/apache drwxr-xr-x.
website1.com apache/apache drwxr-xr-x.
public_html apache/apache drwxr-xr-x.
all files in public_html apache/apache -rw-r–r–.
all directories in public_html apache/apache drwxr-xr-x.

There is an identical website2.com directory with subdirectories.

Do these permissions look ok? Is there some other php config I need to set up?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hi @jplafata,

It’s possible your ownership is not correct and it’s not apache but something else. Can you try checking it out and seeing if that’s correct?

If you are unsure on where to check it. The Apache group and user should be displayed in the file /etc/httpd/envvars. In there you should see something like

export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data

Regards,
KFSys

Hi @jplafata,

Could you give us more details?

  • What is the link of the DO tutorial you followed?
  • What commands did you use to set permissions for your files/folders?
  • Sure! I followed the tutorials below to set up my server

    The command I used to set the file and directory permissions were:

    • For files - sudo find . -type f -exec chmod 644 {} +
    • For files - sudo find . -type d -exec chmod 755 {} +

    As a side note, I recently disabled SELinux just to test and it resolved all my issues. This obviously isn’t the permanent solution. Do you have any insight on this?

    by Etel Sverdlov
    This tutorial shows you how to set up a new directory, how to grant the correct permissions, how to add content to a new page, how to turn on virtual hosting, and how to, if needed, set up local hosts. Virtual Hosts are used to run more than one domain off of a single IP address and allows you to run multiple sites off of a single DigitalOcean droplet. This tutorial describes how to set up virtual hosts with Apache on Centos
Submit an Answer