文章作者:luxianghao

文章来源:http://www.cnblogs.com/luxianghao/p/6107096.html 转载请注明,谢谢合作。

免责声明:文章内容仅代表个人观点,如有不当,欢迎指正。

---

近来由于工作需求,和nginx接触较多,现把关于nginx进程属主的问题总结如下:

规则
nginx启动进程可以在conf里指定user(user  work;)但是这个只有在用root启动的情况有意义,
如果是用其他用户启动的nginx master是没有意义的 nginx会忽略这个配置,如下nginx warning所述
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /home/work/app/nginx/conf/nginx.conf:1
 
结论
1,在非root账户下启动时,nignx的master和worker进程的owner都将是这个账户,
2,在root账户下启动时 nignx的master进程是的owner是root,worker的owner在conf已配置用户的情况下,owner是配置的用户,否则将是nobody,而且也可能导致nginx的一些文件的owner也是nobody
 
# ps -ef | grep nginx
work     26620 21666  0 19:18 pts/5    00:00:00 vim conf/nginx.conf
root     26901     1  0 19:19 ?        00:00:00 nginx: master process ./sbin/nginx
nobody   26902 26901  0 19:19 ?        00:00:00 nginx: worker process
nobody   26903 26901  0 19:19 ?        00:00:00 nginx: worker process
nobody   26904 26901  0 19:19 ?        00:00:00 nginx: worker process
nobody   26905 26901  0 19:19 ?        00:00:00 nginx: worker process
nobody   26906 26901  0 19:19 ?        00:00:00 nginx: worker process
nobody   26910 26901  0 19:19 ?        00:00:00 nginx: cache manager process
nobody   26911 26901  0 19:19 ?        00:00:00 nginx: cache loader process
root     26918 24078  0 19:19 pts/11   00:00:00 grep nginx
 
# ll
total 72
drwxrwxr-x 7 work   work 4096 Jul 15 11:55 _book
drwxr-xr-x 2 nobody work 4096 Jul 15 11:55 cache
drwx------ 2 nobody work 4096 Jul 15 11:55 client_body_temp
drwxrwxr-x 2 work   work 4096 Nov 27 19:18 conf
drwx------ 2 nobody work 4096 Jul 15 11:55 fastcgi_temp
drwxrwxr-x 2 work   work 4096 Jul 15 11:55 html
drwx------ 2 nobody work 4096 Jul 15 11:55 uwsgi_temp

最新文章

  1. 使用Hudson进行持续集成
  2. php程序员的水平 看看自己属于那个级别的
  3. ZOJ 2753 Min Cut (Destroy Trade Net)(无向图全局最小割)
  4. 【转载】Linux的进程间通信-信号量
  5. Netty 中文教程 Hello World !详解
  6. Mac系统配置多个git账号
  7. DDL 和DML 区别
  8. .Net 社区虚拟大会”(dotnetConf)
  9. HDU1087:Super Jumping! Jumping! Jumping!(DP)
  10. IOS本地化应用
  11. R语言笔记5--读数据
  12. 9.Linux系统引导流程
  13. Angular(2+) 国际化方案(ngx-translate)
  14. Unity Bolt插件 基本使用
  15. PL/SQL简单使用——导入、导出数据表
  16. hadoop小结
  17. Apache的域名配置
  18. MFC绘图小实验(1)
  19. @SafeVarargs注解
  20. mysql设置合适的索引长度

热门文章

  1. calendar.getTimeInMillis() 和 System.currentTimeMillis() 的区别
  2. uvm_factory——我们的工厂(三)
  3. Java MVC 增删改查 实例
  4. 通过StringBuilder的reverse()实现倒序
  5. HDU 4348 I - To the moon 可持续化
  6. Python list 列表和tuple元组
  7. JDBC连接数据库详解
  8. poi导出word模板项目实例(一个文件)
  9. Memcache查看列出所有key方法
  10. RedHat7搭建KVM虚拟机