Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On my MAC, my webserver is

_www

So if I want to set my webserver to be my group, I can just write:

sudo chown -R my-username:_www .

When I SSH'ed into my shared hosting, I think my "webserver" might be "nobody"

drwxr-x--- 23 my-username nobody 4096 Apr 20 13:10 public_html/

Inside my public_html web folder, it looks like my group is the same as my username, i.e.

drwxr-xr-x  2 my-username my-username  4096 Apr 18 14:45 config/

If I want to make files readable and writeable by my webserver (like say, my "files" or "upload" folder) on shared hosting, should I just leave everything as it and set my folder to 755??

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

On your Mac, "_www" is the group used by the webserver software.

On your shared hosting "nobody" is the group used by the webserver software.

You don't want the general public visiting your site to be able to replace your web-content so leave the permissions as they are on public_html, config and other folders and subfolders.

If you are writing some PHP or similar dynamic code that runs on the webserver and which needs write permissions to save data, it may be best to create a folder outside of public_html (not within it) and change it's permissions to 775 with ownership my_username:nobody.

Hosting providers may provide you with a control panel that lets you install various features such as blogs, picture-galleries, file-upload facilities etc. If so, I would start by enabling one of those, which should take care of file permissions for you. Initially I'd use the hosting company's support email/phone-number for questions about those facilities.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.