Web服务器上的文件夹权限

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.

我让Jenkins设置为大学PHP项目做测试和其他好东西。 我想做的是告诉Jenkins(通过部署工作)将源代码文件夹复制到我用nginx和php-fpm运行的Web文件夹。 p>

我真的 例如,对于大部分技术知识来说真的很陌生,所以我还在试图弄清楚如何设置这一切。 我有nginx和php-fpm作为 http strong>用户/组配置运行。 p>

我一直在阅读有关PHP-FPM池的内容,但我仍然很好奇 至于如何设置整个过程。 p>

我在哪里设置该文件夹的文件夹权限,以便我不必在任何地方使用sudo或root? 如何在没有用户:组问题的情况下在nginx中引用它? 与PHP相同? Jenkins可以直接运行 cp源/文件夹webserver / project code>,只需将其添加到http组,或者实际上不使用sudo吗? 是的,我知道,很多问题,以及对权限/安全性的很多怀疑。 p>

提前致谢! p>

PD:这是 在运行ArchLinux,nginx 1.0.10,PHP-FPM 5.3.8和Jenkins 1.439的RackSpace云服务器上。 p> div>

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