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.

I am trying to create a local website on my Mac. I found that the default folder is /Library/WebServer/Documents/; so anything which I will paste here should be published. However, when I start copying my web files and folders in this file, i need to periodically use chmod. This makes me feel that I am doing something wrong.

Here is my question: if I frequently need chmod or sudo to do anything in these folders, does it mean that I should have pointed Apache to some other location on my drive where I have more 'natural' access?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

It's working right. Under standard Unix filesystem permissions rules, files don't automatically adopt the settings of the folder they're copied into; I believe they are typically owned by the account doing the copying, with the permissions set to that user's umask.

To make sure that Apache doesn't serve up sensitive system files, Apache's httpd process runs as a special user account, _www. So when you copy files into /Library/WebServer/Documents/, you need to make sure they are either owned by, or at least readable by, _www.

share|improve this answer

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.