ÔõôÆô¶¯nginxЧÀÍ
ÒªÆô¶¯ nginx ЧÀÍ£¬ÇëÖ´ÐÐÒÔÏ°취£ºÈ·¶¨ nginx ÒÑ׼ȷװÖÃʹÓà sudo systemctl start nginx£¨linux/unix£©»ò net start nginx£¨windows£©Æô¶¯Ð§ÀÍÑé֤ЧÀÍÊÇ·ñÒÑÆô¶¯»á¼û http://localhost »ò http://your_server_ip_address È·ÈÏÊÇ·ñÀÖ³ÉÆô¶¯
ÔõÑùÆô¶¯ Nginx ЧÀÍ
ÒªÆô¶¯ Nginx ЧÀÍ£¬Çëƾ֤ÒÔÏ°취²Ù×÷£º
1. È·¶¨ Nginx ÒÑ׼ȷװÖÃ
Éó²é Nginx ×°ÖÃĿ¼£¨Í¨³£Îª /usr/local/nginx£©¡£
¼ì²é nginx ÏÂÁîÊÇ·ñ¿ÉÓãºnginx -v
2. Æô¶¯Ð§ÀÍ
Linux/Unix ϵͳ£ºÊ¹ÓÃÒÔÏÂÏÂÁ
sudo systemctl start nginx
µÇ¼ºó¸´ÖÆ
Windows ϵͳ£ºÊ¹ÓÃÒÔÏÂÏÂÁ
net start nginx
µÇ¼ºó¸´ÖÆ
Ïà¹ØÔĶÁÍƼö£º
nginxЧÀÍÔõôÆô¶¯
Ôõô¹Ø±ÕnginxЧÀÍ
3. Ñé֤ЧÀÍÊÇ·ñÒÑÆô¶¯
ʹÓÃÒÔÏÂÏÂÁî¼ì²é Nginx ״̬£º
sudo systemctl status nginx
µÇ¼ºó¸´ÖÆ
»ò
netstat -anp | grep nginx
µÇ¼ºó¸´ÖÆ
4. »á¼û Nginx ЧÀÍ
»á¼û http://localhost »ò http://your_server_ip_address¡£
ÈôÊÇÏÔʾ Nginx ĬÈÏÒ³Ã棬ÔòÌåÏÖЧÀÍÒÑÀÖ³ÉÆô¶¯¡£
ÆäËûÑ¡Ïî
ʹÓà Nginx ÉèÖÃÎļþ£º
sudo nginx -c /path/to/nginx.conf
µÇ¼ºó¸´ÖÆ
ʹÓÃÏÂÁîÐÐÑ¡Ï
sudo nginx -s reload # ÖØÔØÉèÖÃÎļþ sudo nginx -s stop # ×èֹЧÀÍ sudo nginx -s quit # Í˳öЧÀÍ
µÇ¼ºó¸´ÖÆ
×¢ÖØ£º
×÷Ϊ×î¼Ñʵ¼ù£¬½¨ÒéʹÓà systemctl »ò net start ÏÂÁîÆô¶¯Ð§ÀÍ£¬¶ø²»ÊÇÖ±½ÓʹÓà nginx ÏÂÁî¡£
ijЩϵͳ¿ÉÄÜÐèҪʹÓà root Óû§È¨ÏÞÆô¶¯Ð§ÀÍ¡£
ÒÔÉϾÍÊÇÔõôÆô¶¯nginxЧÀ͵ÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡