Report this

What is the reason for this report?

Default file permission for web root (and new files)

Posted on September 23, 2015

What would be the best file permission to set to a web root folder (and all its content files / folders) and its new files? 755 is what suggesetd in this documentation (end of step one). But how to set it as a default permission for new files?

I have to execute this instruction to unsure my website and its static content can be delivered through http

chmod -R 755 /home/somsite/public_www

Everytime I create a new file (as a linux user or via FTP), I always need to execute this line once again because new files never have “read” permission for http requests.

Is there a way to tell server : “hey, all files in here, and all future files created can be read by anyone”?

I’m on ubuntu.



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.

Hi,

You can use the setfacl command with the d flag to set future file permissions.

sudo setfacl -Rdm g:groupnamehere:rex /path/to/your/files

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.