0

I have a WordPress setup using HHVM & NGINX on Ubuntu 14.04 that can't moves files when uploaded.

Nginx is running as www-data.

Files are all owned by deploy:deploy. Where www-data is a member of deploy & deploy is a member of www-data as well.

If files are set to 777 upload works as expected. 775 is giving an error. Leads me to believe it is a permissions error.

Any idea what I've done wrong setting up groups and users?

peterh
  • 4,914
  • 13
  • 29
  • 44
  • 2
    "Is giving an error" means exactly what? Web servers usually give helpful log file entries for cases like this. – Sven Mar 20 '15 at 19:41
  • Did you restart the HHVM daemon after changing the user groups ? –  Mar 21 '15 at 05:49
  • possible duplicate of [What permissions should my website files/folders have on a Linux webserver?](http://serverfault.com/questions/357108/what-permissions-should-my-website-files-folders-have-on-a-linux-webserver) – AD7six Jun 12 '15 at 17:27

1 Answers1

-1

I also wrestled with this problem. Here's a basic solution to help point you in the right direction:


Step 1: find the default root folder of your web server

  • For example /var/www

Step 2: give the user www-data full ownership of web server folder. (Use -R to make change recursive.)

  • sudo chown -R www-data:www-data /path/to/webserver/root

Step 3: restart NGINX

  • sudo service nginx restart

Note: The above will solve your problem; though it exposes your server stack to number of potential vulnerabilities. Please check the links below for further info:

File Permissions

I strongly suggest you set permissions back to 755, to avoid any unnecessary security issues. Check out the Wordpress codex info on file permissions.

Linux permissions

Also, check the link below for further info on setting up users and groups. It provides a good breakdown of Linux permissions, privilege separation etc. Should cover all your needs...


You're definitely looking in the right area, the answer is much closer than you might think!

Perp1exed
  • 43
  • 1
  • 6
  • In principle I fully agree with you. That being said, Stewart's question is related to permissions and read/write errors with `Wordpress` running on `NGINX`. My answer shows a basic solution, but also refers to the Wordpress documentation on security; as well as a serverfault answer, that clearly explains `server`, `group` and `user` permissions for a secure stack running on `Ubuntu` or other `Debian-based` Linux distributions. I'll edit my answer to reflect this, thanks for pointing this out. – Perp1exed Jun 13 '15 at 04:37