nginx进程属主问题讨论
2024-09-03 13:22:57
文章作者: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
最新文章
- 使用Hudson进行持续集成
- php程序员的水平 看看自己属于那个级别的
- ZOJ 2753 Min Cut (Destroy Trade Net)(无向图全局最小割)
- 【转载】Linux的进程间通信-信号量
- Netty 中文教程 Hello World !详解
- Mac系统配置多个git账号
- DDL 和DML 区别
- .Net 社区虚拟大会”(dotnetConf)
- HDU1087:Super Jumping! Jumping! Jumping!(DP)
- IOS本地化应用
- R语言笔记5--读数据
- 9.Linux系统引导流程
- Angular(2+) 国际化方案(ngx-translate)
- Unity Bolt插件 基本使用
- PL/SQL简单使用——导入、导出数据表
- hadoop小结
- Apache的域名配置
- MFC绘图小实验(1)
- @SafeVarargs注解
- mysql设置合适的索引长度
热门文章
- calendar.getTimeInMillis() 和 System.currentTimeMillis() 的区别
- uvm_factory——我们的工厂(三)
- Java MVC 增删改查 实例
- 通过StringBuilder的reverse()实现倒序
- HDU 4348 I - To the moon 可持续化
- Python list 列表和tuple元组
- JDBC连接数据库详解
- poi导出word模板项目实例(一个文件)
- Memcache查看列出所有key方法
- RedHat7搭建KVM虚拟机