php-fpm用nginx用户组,更改掉nginx默认的用户和用户组

更改掉nginx默认的用户和用户组

cd /application/nginx/conf/

grep "user " nginx.conf

sed -i 's/#user  nobody/user  nginx nginx/g' nginx.conf

grep "user " nginx.conf

../sbin/nginx -t

../sbin/nginx -s reload

ps -ef |grep nginx

[root@LNMP conf]# cd /application/nginx/conf/

[root@LNMP conf]# grep "user " nginx.conf

#user  nobody;

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

[root@LNMP conf]# sed -i 's/#user  nobody/user  nginx nginx/g' nginx.conf

[root@LNMP conf]# grep "user " nginx.conf

user  nginx nginx;

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

###########

[root@LNMP conf]# ../sbin/nginx -t

nginx: the configuration file /application/nginx-1.6.2/conf/nginx.conf syntax is ok

nginx: configuration file /application/nginx-1.6.2/conf/nginx.conf test is successful

[root@LNMP conf]# ../sbin/nginx -s reload

[root@LNMP conf]# ps -ef |grep nginx

nginx     1520  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1521  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1522  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1523  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1524  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1525  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1526  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1527  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1528  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1529  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1530  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1531  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1532  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1533  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1534  1519  0 09:06 ?        00:00:00 php-fpm: pool www

nginx     1535  1519  0 09:06 ?        00:00:00 php-fpm: pool www

root      8467     1  0 09:45 ?        00:00:00 nginx: master process /application/nginx-1.6.2/sbin/nginx

nginx     8686  8467  0 11:23 ?        00:00:00 nginx: worker process

root      8690  8626  0 11:23 pts/1    00:00:00 grep nginx

#####################################

方法二:在编译的时候指定用户和组

[root@LNMP conf]# /application/nginx/sbin/nginx -V

nginx version: lvnian/2.2.22

built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)

TLS SNI support enabled

configure arguments: --user=nginx --group=nginx --prefix=/application/nginx-1.6.2 --with-http_stub_status_module --with-http_ssl_module

[root@LNMP conf]#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值