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.

1 Answer 1

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 question/answer should help you with that:

Apache: How to enable Directory Index browsing at the Doc Root level?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .