nginxÔËÐÐ״̬ÔõôÉó²é
¿ÉÒÔͨ¹ýÒÔÏÂÒªÁìÉó²é nginx ÔËÐÐ״̬£ºnginx -t£º¼ì²éÉèÖÃÎļþÓï·¨ÊÇ·ñ׼ȷ¡£nginx -v£ºÏÔʾ nginx °æ±¾ºÍÆäËû±àÒëÐÅÏ¢¡£service nginx status£ºÉó²é nginx ЧÀ͵ÄÔËÐÐ״̬£¨ÊÊÓÃÓÚ linux ϵͳ£©¡£ps -ef | grep nginx£º²éÕÒÕýÔÚÔËÐÐµÄ nginx Àú³Ì¡£netstat -nlp | grep nginx£ºÉó²é nginx ¼àÌýµÄ¶Ë¿ÚºÍµØµã¡£
nginx ÔËÐÐ״̬Éó²é
ÔõÑùÉó²é nginx ÔËÐÐ״̬£¿
ʹÓÃÒÔÏÂÏÂÁîÖ®Ò»£º
nginx -t: ¼ì²é nginx ÉèÖÃÎļþÓï·¨ÊÇ·ñ׼ȷ£¬¶ø²»Æô¶¯ nginx¡£
nginx -V: ÏÔʾ nginx °æ±¾ºÍÆäËû±àÒëÐÅÏ¢£¬¶ø²»Æô¶¯ nginx¡£
service nginx status: Éó²éϵͳЧÀÍÖÐ nginx µÄÔËÐÐ״̬£¨ÊÊÓÃÓÚ Linux ϵͳ£©¡£
ps -ef | grep nginx: ²éÕÒËùÓÐÕýÔÚÔËÐÐµÄ nginx Àú³Ì£¬²¢ÏÔʾÆä״̬ºÍÆäËûÐÅÏ¢¡£
netstat -nlp | grep nginx: Éó²é nginx ÕýÔÚ¼àÌýÄÄЩ¶Ë¿ÚºÍµØµã¡£
ÏêϸڹÊÍ£º
nginx -t
´ËÏÂÁî¼ì²é nginx ÉèÖÃÎļþ£¨Í¨³£Î»ÓÚ /etc/nginx/nginx.conf£©µÄÓï·¨¡£ÈôÊÇÉèÖÃÎļþ׼ȷ£¬½«ÏÔʾÒÔÏÂÐÂÎÅ£º
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
µÇ¼ºó¸´ÖÆ
nginx -V
´ËÏÂÁîÏÔʾ nginx °æ±¾ÒÔ¼°ÓйØÆä±àÒëÑ¡ÏîºÍÆäËûÐÅÏ¢¡£
service nginx status
´ËÏÂÁîÊÊÓÃÓÚ Linux ϵͳ£¬ËüÏÔʾ nginx ЧÀ͵ÄÔËÐÐ״̬¡£Êä³öͨ³£ÈçÏÂËùʾ£º
nginx is running (pid 12345)
µÇ¼ºó¸´ÖÆ
ps -ef | grep nginx
´ËÏÂÁîÏÔʾϵͳÖÐËùÓÐÕýÔÚÔËÐÐµÄ nginx Àú³Ì¡£Êä³öÀàËÆÓÚ£º
root 12345 15122 15:02 ? 00:00:05 nginx: master process /usr/sbin/nginx -g daemon on; master_process on; root 12346 15125 15:02 ? 00:00:00 nginx: worker process
µÇ¼ºó¸´ÖÆ
netstat -nlp | grep nginx
´ËÏÂÁîÏÔʾ nginx ¼àÌýµÄ¶Ë¿ÚºÍµØµã¡£Êä³öͨ³£ÈçÏÂËùʾ£º
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN tcp 0 0 :::80 :::* LISTEN
µÇ¼ºó¸´ÖÆ
ÒÔÉϾÍÊÇnginxÔËÐÐ״̬ÔõôÉó²éµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡