例如:
nginx: [emerg] bind() to 0.0.0.0:8004 failed (98: Address already in use)
1.查看占用8004端口的进程ID:
$ netstat -anp |grep 8004tcp 0 0 0.0.0.0:8004 0.0.0.0:* LISTEN 2768/nginx.conf
2.查看进程信息:
$ ps -u -p 2768USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMANDmars 2768 0.0 0.5 385344 353712 ? Ss Mar28 0:00 nginx: master process /home/mars/nginx/sbin/nginx -p/home/mars/nginx -c /home/
3.根据实际情况修改端口或停止原进程
不错,不错,看看了!