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'm running a certain script that is using a non-root user to do the following...

mkdir: cannot create directory `/srv/www/example.com/releases'
*** [err :: 12.23.45.789] : Permission denied

How would I allow user xyz to have permanent permissions to do so and still keep this web server secure? Also is it possible to make it recursive for all subfolders?

I know its probably chmod something but I'm not that linux savy, thanks.

share|improve this question

1 Answer 1

The standard way is to make the user a member of the web servers standard group.

On Debian based servers, the web service generally has a user id of www-data and a group id of the same name.

The www sub-folders should all generally belong to this user/group.

Adding a user to the www-data group should allow that use to create and modify folders and files as required.

Of course, this means that the user has access to all of the folders owned by www-data which may not be right.

It would help if you gave us the output of a ls -l command on /srv/www/example.com/, you can change the user/group names if you need to.

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.