Report this

What is the reason for this report?

Issue with public access to web server

Posted on April 23, 2015
Nexx

By Nexx

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?



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.

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.

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.