Wordpress installation problem, no permissions to write (Ubuntu / NGINX).

March 11, 2015 1.2k views
WordPress LEMP PHP DigitalOcean Server Optimization Linux Basics Ubuntu

Here's my setup:

  • Fresh Ubuntu 14.04 64x installation.
  • Fresh NGINX / MYSQL / PHP5-FPM / PHPMYADMIN installation.
  • Installed POSTFIX and VSFTPD.
  • umask has been changed to 002.
  • the owner/group of the wordpress directory is myusername:myusername.
  • myusername is also in the www-data group.
  • All directories inside of wordpress are 775 with files being 664.

Regardless of the above, wordpress still cannot write config. This is a more underlining permisssion issue apparently, but I can't figure out why. My solution are to chown -R the wordpress folder www-data:www-data and just go from there, however for security and work flow reasons that's highly undesirable.

php is also running on www-data, and when I change the unix name/group to my username, any and all files can also write, but from what I read this is also highly undesirable.

I'd like a solution that doesn't require me to do either of those. Any help would be appreciated.

1 Answer

This question was answered by @sierracircle:

I have had a lot of success using this method:

I use the method he describes to mount the /var/www folder in my user home folder as www. That way I have access to it, and anything I create gets the proper permissions for www-data, while still giving my user access.

Took me all of 5 minutes to set up, and has been working for me for the last few weeks with no problem.

View the original comment

Have another answer? Share your knowledge.