nginxÖØÆôʧ°ÜÔõô°ì
nginx ÖØÆôʧ°ÜµÄÔµ¹ÊÔÓɼ°½â¾öÒªÁ죺ÉèÖÃÎļþ¹ýʧ£º¼ì²énginxÉèÖÃÎļþ£¬È·±£Ó﷨׼ȷ¡¢Ö¸ÁîÓÐÓ᣿ª·Å¶Ë¿Ú³åÍ»£º¼ì²é¶Ë¿ÚÊÇ·ñ±»Õ¼Ó㬹رÕÕ¼ÓÃÀú³Ì»ò¸ü¸Änginx¶Ë¿ÚÉèÖá£Àú³ÌÕýÔÚÔËÐУºÊÖ¶¯ÖÕÖ¹»òʹÓÃserviceÏÂÁî×èÖ¹nginxÀú³Ì¡£È±ÉÙÒÀÀµÏװÖûò¸üбØÐèµÄnginxÒÀÀµÏÈçopenssl¡¢zlib¡¢pcre¡£ÎļþȨÏÞÎÊÌ⣺¸¶ÓënginxÓû§¶ÔÎļþºÍĿ¼µÄ¶ÁдȨÏÞ¡£ÄÚ´æ×ß©»ò¸ß¸ºÔØ£º¼à¿ØnginxÀú³ÌµÄÄÚ´æºÍcpuʹÓÃÇéÐΣ¬Éý¼¶nginx°æ±¾»òÖØÐÂÉèÖÃworkerÀú³Ì¡£ÍⲿÒòËØ£º¼ì²é·À
nginx ÖØÆôʧ°ÜµÄ½â¾öÒªÁì
nginx ÖØÆôʧ°Ü¿ÉÄÜÊÇÓɶàÖÖÔµ¹ÊÔÓÉÒýÆðµÄ£¬±¾ÎĽ«Ïêϸ̽ÌÖÕâЩԵ¹ÊÔÓɼ°ÆäÏìÓ¦µÄ½â¾öÒªÁ죺
1. ÉèÖÃÎļþ¹ýʧ
ÎÊÌ⣺nginx ÉèÖÃÎļþÖб£´æÓï·¨¹ýʧ»òÎÞЧָÁî¡£
½â¾öÒªÁ죺×Ðϸ¼ì²é nginx ÉèÖÃÎļþ /etc/nginx/nginx.conf£¬È·±£Ó﷨׼ȷÇÒËùÓÐÖ¸ÁÓÐÓ᣿ÉÒÔ½èÖú nginx Óï·¨¼ì²éÆ÷ÑéÖ¤ÉèÖá£
2. ¿ª·Å¶Ë¿Ú³åÍ»
ÎÊÌ⣺ָ¶¨µÄ nginx ¶Ë¿Ú£¨Ä¬ÈÏ£º80/443£©Òѱ»ÆäËû³ÌÐòÕ¼Óá£
½â¾öÒªÁ죺ʹÓà netstat -anp | grep :80 »ò netstat -anp | grep :443 ÏÂÁî¼ì²é¶Ë¿ÚʹÓÃÇéÐΡ£¹Ø±ÕÕ¼Óö˿ڵÄÀú³Ì»ò¸ü¸Ä nginx ¶Ë¿ÚÉèÖá£
3. Àú³ÌÕýÔÚÔËÐÐ
ÎÊÌ⣺nginx Àú³ÌÈÔÔÚÔËÐУ¬ÎÞ·¨ÖØÐÂÆô¶¯¡£
½â¾öÒªÁ죺ÊÖ¶¯ÖÕÖ¹ nginx Àú³Ì£¨kill -9 [nginx Àú³ÌºÅ]£©»òʹÓà service nginx stop ÏÂÁÆä×èÖ¹¡£
4. ȱÉÙÒÀÀµÏî
ÎÊÌ⣺nginx ȱÉÙ±ØÐèµÄÒÀÀµÏî¡£
½â¾öÒªÁ죺ƾ֤ϵͳ°æ±¾ºÍ×°Ö÷½·¨£¬×°Öûò¸üÐÂÐëÒªµÄ nginx ÒÀÀµÏͨ³£ÐèҪװÖà openssl¡¢zlib ºÍ pcre¡£
5. ÎļþȨÏÞÎÊÌâ
ÎÊÌ⣺nginx Îļþ»òĿ¼ûÓÐÊʵ±µÄȨÏÞ¡£
½â¾öÒªÁ죺ȷ±£ nginx Óû§¾ßÓÐ¶Ô nginx ÉèÖÃÎļþ¡¢ÈÕÖ¾ÎļþºÍÔÝʱĿ¼µÄ¶ÁдȨÏÞ¡£Í¨³£ÐèÒªÖ´ÐÐ chown -R nginx:nginx /etc/nginx ºÍ chmod -R 755 /tmp/nginx¡£
6. ÄÚ´æ×ß©»ò¸ß¸ºÔØ
ÎÊÌ⣺nginx Àú³Ì±¬·¢ÄÚ´æ×ß©»òϵͳ¸ºÔعý¸ß¡£
½â¾öÒªÁ죺ʹÓà top »ò htop ÏÂÁî¼à¿Ø nginx Àú³ÌµÄÄÚ´æºÍ CPU ʹÓÃÇéÐΡ£ÈôÊDZ¬·¢×ß©£¬¿ÉÒÔʵÑéÉý¼¶ nginx °æ±¾»òÖØÐÂÉèÖà worker Àú³Ì¡£
7. ÍⲿÒòËØ
ÎÊÌ⣺·À»ðǽ×èÖ¹ÁË nginx ¶Ë¿Ú»á¼û»òÆäËûÍⲿÒòËØ¡£
½â¾öÒªÁ죺¼ì²é·À»ðǽ¹æÔòÊÇ·ñÔÊÐí nginx Á÷Á¿Í¨¹ý¡£ÁíÍ⣬ȷ±£Ã»ÓÐÆäËûÇå¾²²½·¥£¨ÈçÈëÇÖ¼ì²âϵͳ£©×èÖ¹ nginx Æô¶¯¡£
ÒÔÉϾÍÊÇnginxÖØÆôʧ°ÜÔõô°ìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡