nginxЧÀÍÔõôÆô¶¯
ͨ¹ýʹÓÃÏÂÁî sudo service nginx start¡¢sudo systemctl start nginx »ò sudo /etc/init.d/nginx start Æô¶¯ nginx ЧÀÍ£¬Í¬Ê±È·±£ nginx ÒÑ×°Öã¬ÉèÖÃ׼ȷ£¬·À»ðǽ¿ª·ÅÐëÒª¶Ë¿Ú£¬²¢Ñé֤ЧÀÍÒÑÆô¶¯¡£
Nginx ЧÀÍÆô¶¯ÒªÁì
Ö±½ÓÆô¶¯
×î¼òÆӵķ½·¨ÊÇʹÓÃÒÔÏÂÏÂÁîÖ±½ÓÆô¶¯ Nginx ЧÀÍ£º
sudo service nginx start
µÇ¼ºó¸´ÖÆ
Systemd µ¥Î»Îļþ
ÔÚ Systemd ϵͳÖУ¬¿ÉÒÔͨ¹ýÆô¶¯ Systemd µ¥Î»ÎļþÀ´Æô¶¯ Nginx ЧÀÍ£º
sudo systemctl start nginx
µÇ¼ºó¸´ÖÆ
³õʼ»¯¾ç±¾
ÔÚijЩ½Ï¾ÉµÄ Linux ¿¯ÐаæÖУ¬¿ÉÒÔʹÓóõʼ»¯¾ç±¾Æô¶¯ Nginx ЧÀÍ£º
sudo /etc/init.d/nginx start
µÇ¼ºó¸´ÖÆ
ÆäËûÑ¡Ïî
-c£ºÖ¸¶¨ÉèÖÃÎļþ¡£Ä¬ÈÏÇéÐÎÏ£¬Nginx ʹÓà /etc/nginx/nginx.conf¡£
-g£ºÖ¸¶¨×é²ÎÊý¡£Ä¬ÈÏÇéÐÎÏ£¬Nginx ʹÓà daemon ×é¡£
-p£ºÖ¸¶¨Àú³Ì ID Îļþ¡£Ä¬ÈÏÇéÐÎÏ£¬Nginx ʹÓà /var/run/nginx.pid¡£
Ïêϸ°ì·¨
È·±£ Nginx ÒÑ×°Öá£ÈôÊÇÄúÉÐδװÖà Nginx£¬Çë²Î¿¼¹Ù·½Îĵµ¾ÙÐÐ×°Öá£
¼ì²é Nginx ÉèÖÃÊÇ·ñ׼ȷ¡£±à¼ÉèÖÃÎļþ /etc/nginx/nginx.conf ²¢Æ¾Ö¤ÐèÒª¾ÙÐиü¸Ä¡£
ʹÓÃÉÏÊöÒªÁìÖ®Ò»Æô¶¯ Nginx ЧÀÍ¡£
ÑéÖ¤ Nginx ÊÇ·ñÒÑÆô¶¯¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî¼ì²éЧÀÍ״̬£º
sudo service nginx status # »ò sudo systemctl status nginx # »ò sudo /etc/init.d/nginx status
µÇ¼ºó¸´ÖÆ
×¢ÖØ
Nginx ЧÀͱØÐèÒÔ root Óû§»ò¾ßÓÐÌáÉýȨÏÞµÄÓû§Éí·ÝÆô¶¯¡£
ÔÚÆô¶¯ Nginx ЧÀÍ֮ǰ£¬ÇëÈ·±£·À»ðǽÔÊÐí 80 ¶Ë¿Ú£¨Ä¬ÈÏ HTTP ¶Ë¿Ú£©»ò 443 ¶Ë¿Ú£¨Ä¬ÈÏ HTTPS ¶Ë¿Ú£©ÉϵĴ«ÈëÅþÁ¬¡£
ÒÔÉϾÍÊÇnginxЧÀÍÔõôÆô¶¯µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡