Apart of apache group, yet still can't upload to /var/www/

  • Posted January 27, 2013

I’ve been ignoring this issue for now by using root in filezilla, but how can i get my other users to make uploads and changes?


Submit an 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.

I’m having the same issue and haven’t been able to resolve it using any suggestions here or elsewhere. My user is part of the admin and www-data groups and /var/www/* is all owned by www-data, but I can’t upload or modify anything. Logging in as root works, but I’d like to avoid that. <br> <br>If it matters, I’m using Transmit, the Mac GUI.

@p_ingram3541: Run <pre>sudo chgrp www-data /path/to/dir <br>sudo chmod g+s /path/to/dir <br>cd /path/to/dir <br>sudo umask 002</pre> <br>Does that fix it?

Got a similar issue. I use winscp. I can add, delete and modify files and folders with my non-root user but any new files or folders I create/upload I cannot change ownership from my non-root user to www-data, I get permission denied. I have always have to open a terminal to chown which is a bit of a pain. Any way around this?

I created a symbolic link to /var/www/ to the home folder of the website. I only host one domain though. If I had more than one domain I would have to go the Virtual Host route.

If I’m not mistaken just goto the directory where you want to set it and do: <br> <br># umask 022 <br> <br>And you should be all set so that all new files created will be group writeable.

Well at least in my case I’m developing locally. my www directory is set to owner and group being root. <br>I’m going to change it to www-data like in Apache and I’m going to add my user to the www-data group :P <br> <br>how do you unmark stuff in linux? :S <br>I’m fairly new to this :S

By default when a file is created only the “owner” not the group has write permissions. <br> <br>If you have multiple users sharing a directory then each user that uploads a file will be the only owner of it so other members of that group will be unable to edit or delete that file. <br> <br>That is why you setup the umask for the directory which will automatically make each file that is created there writeable by both the owner and the group. Then any other user in the group can delete another user’s file or update it. <br> <br>It really depends on whether or not you want to allow that.

I’m fairly new to this <br>isn’t <br>chown -R user:group usr/share/nginx/www <br>chmod -R 775 usr/share/nginx/www <br> <br>enough? <br>

dont forget to umask or stickybit the parent directory as raiyu mentioned. this will avoid future problems where users upload files and the file owner and the group becomes the user and no one else will be able to edit them. umasking will make sure the newly created files will get the www-data as their group.

AH! how did i not notice that! thank you! i used <br> <br># sudo chmod -R 775 /var/www/ <br> <br>thank you!