0

How do I setup vsftp so that I could have folder where I upload files and those files are readable by www-data?

I have created ftp folder at /var/www/test. Made a user and added it to www-data group useradd usertest -d /var/www/test -g www-data and chowned that folder chown usertest:www-data /var/www/test. Then I made a subdir in /var/www/test, chowned it by chown www-data:www-data subdir/ and set permissions for it to 755. I am able to login into ftp, but I can't even upload a file.

0

you don't have to worry too much about the user if www-data or any user on your web/ftp server has read access.

if the upload works, and the directory are 755 and the files 644 you are good to go on that front.

if you don't want all local users to access those files, I would go through a group, create a group called ftpuploads have the ftp user and the www-data user be member of that group and your upload dir can now be

chgrp ftpuploads; chmod 750 $dir

now, on the webpart, you need your virtualhost to allow read access on that directory. do you want file index to be allowed? its now disabled by default

this questio/answer should help you with that

https://serverfault.com/questions/232949/apache-how-to-enable-directory-index-browsing-at-the-doc-root-level

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.