读书人

nginx起动及检测nginx配置是否正确

发布时间: 2012-12-20 09:53:21 作者: rapoo

nginx启动及检测nginx配置是否正确

检查配置文件:

?

/data/app/nginx/sbin/nginx -t

nginx: [emerg] invalid number of arguments in "root" directive in /data/app/nginx/conf/nginx.conf:58

nginx: configuration file /data/app/nginx/conf/nginx.conf test failed

?

上面的结果说明nginx.conf:58行有问题

?

启动nginx

nginx的sbin目录下 ?运行./nginx?

ps -ef|grep nginx后显示

?

root ? ? 28775 ? ? 1 ?0 18:24 ? ? ? ? ?00:00:00 nginx: master process ./nginx

nobody ? 28776 28775 ?0 18:24 ? ? ? ? ?00:00:00 nginx: worker process

nobody ? 28777 28775 ?0 18:24 ? ? ? ? ?00:00:00 nginx: worker process

nobody ? 28778 28775 ?0 18:24 ? ? ? ? ?00:00:00 nginx: worker process

nobody ? 28779 28775 ?0 18:24 ? ? ? ? ?00:00:00 nginx: worker process

nobody ? 28780 28775 ?0 18:24 ? ? ? ? ?00:00:00 nginx: worker process

nobody ? 28781 28775 ?0 18:24 ? ? ? ? ?00:00:00 nginx: worker process

nobody ? 28782 28775 ?0 18:24 ? ? ? ? ?00:00:00 nginx: worker process

nobody ? 28783 28775 ?0 18:24 ? ? ? ? ?00:00:00 nginx: worker process

?

说明正常启动。

?

重启命令:

./nginx -s reload

读书人网 >开源软件

热点推荐