系统教程 · 2024年11月12日

怎么查看nginx是否启动

如何查看 是否启动

确认 Nginx 是否启动有多种方法:

1. 使用命令行

  • Linux/Unix:
systemctl status nginx

登录后复制

  • Windows:
netstat -ano | findstr 80

登录后复制

2. 检查端口

Nginx 默认监听在端口 80。使用以下命令检查此端口:

  • Linux/Unix:
lsof -i:80

登录后复制

  • Windows:
netstat -nao | find "ESTABLISHED" | findstr 80

登录后复制

3. 查看系统日志

Nginx 启动时会在系统日志中写入消息。使用以下命令查看日志:

  • Linux/Unix:
grep nginx /var/log/syslog

登录后复制

  • Windows:
eventvwr.msc

登录后复制

4. 使用第三方工具

有许多第三方工具可以帮助您监控 Nginx 的状态,例如:

  • Nagios
  • Zabbix
  • Icinga

以上就是怎么查看是否启动的详细内容,更多请关注GTHOST其它相关文章!