Issue with public access to web server

April 23, 2015 540 views
Apache Getting Started Ubuntu

So, I am not use to setting up a web server so i'm sure there is an easy explanation for this that I don't know.

Basically, anytime I upload a new file via ftp, the www-data user can not view it until I do

chmod -R 775 /var/www

I have to do this every single time when I upload a file, is there anyway to make it so that they can read any file uploaded in this directory?

2 Answers

Use SFTP instead of FTP.

As Woet says, use SFTP yet you need to upload with the intended user for such website, not with root or any other user.

You need to check your folder has the right permissions and umask (which usually you don't need to mess with).

if you use site1 user to upload, make sure your site main folder and subfolders has permissions for site1 (user) and apache (user).

Google for default permissions if you have been messing around.

Have another answer? Share your knowledge.