Report this

What is the reason for this report?

Having a hard time getting permissions to create directories and files in www folder

Posted on May 22, 2013
aj

By aj

I followed the following guide here: https://www.digitalocean.com/community/articles/initial-server-setup-with-arch-linux and here: https://www.digitalocean.com/community/articles/how-to-install-lemp-nginx-mysql-php-stack-on-arch-linux

So now I have a LEMP stack which runs fine and I have my root account secured and a new username “adriano”. If I SFTP into the server using the username adriano, I am unable to create any files or directories. Trying to do a simple wordpress install doesn’t work because I need to be able to create a folder for it, and a wp-config.php file. Both of which, like I mentioned, I do not have permissions to do. Yes, the username “adriano” has been added to the sudoers file via visudo.

I’ve never been very good at UNIX permissions so I was wondering if maybe someone can help me out?

Also, since I am using nginx it does not seem like I have a www-data group or user and my www folder is /usr/share/nginx/

Thank you, AJ



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Change the ownership of /usr/share/nginx and all of its subdirectories/files to adriano and the group owning it to www-data: <br>sudo chown -R adriano:www-data /usr/share/nginx <br> <br>This will allow you to create files and allows nginx to read the files.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.