Linux/Apache File Ownership/Permissions

erzoolander
erzoolander used Ask the Experts™
on
I'm setting up an Ubuntu server - and have everything working well.  I want to ensure, however, that I have the file ownership and permissions set properly.

The site is a Drupal 8 site, so the only files that need to be writeable by the web-user are located in /sites/default/files

Currently - everything in the site has the ownership of root.  Should ownership of everything in the public_html folder be changed to the apache username of www-data from root?

Then - for the files/directories that need to be writeable to by the CMS - should those then be set to something like 644 - with the directories being 755?

I'm a little new with the sysadmin stuff.  Any help would be appreciated!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
RETIRED
Top Expert 2006
Commented:
No need to change ownership from root.  The writable files and dirs should work perfectly at 644 and 755 respectively.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial