Web服务器上的文件夹权限

I have Jenkins set up doing tests and other nice stuff for a college PHP project. What I would like to do is telling Jenkins (through a deploy job) to copy the source code folder to a Web folder I have running with nginx and php-fpm.

I’m really, really new to much of this technical knowledge, for instance, so I’m still trying to figure out how to set all this up. I have nginx and php-fpm running as http user/group configuration.

I’ve been reading about PHP-FPM pools, but I’m still curious as to how to set up the whole process.

Where do I set folder permissions for that Web folder so that I don’t have to use sudo or root everywhere? How do I reference it in nginx without user:group problems? Same as PHP? Can Jenkins simply run a cp source/folder webserver/project by adding it to the http group, or in fact, without using sudo at all? Yes, I know, a lot of questions, and a lot of doubts about permissions/security.

Thanks in advance!

PD: This is on a RackSpace Cloud Server running ArchLinux, nginx 1.0.10, PHP-FPM 5.3.8 and Jenkins 1.439.

Assuming jenkins is run as a user different from http, the easiest way to achieve this would be to add that user to http group and ensure that the relevant webserver folder has write permission for http group. (drwxrwxr-x or similar).

You should set the right file permissions using chmod: http://www.unixref.com/guides/chmodGuide.html