如何解决80端口被system占用的问题

2023-04-11 04:15:00 端口 占用 如何解决
如何解决80端口被system占用的问题 80端口是一个常用的端口,如果被占用了,会导致很多问题。 解决方法: 1.查看80端口是否被占用 netstat -an|grep 80 如果看到类似下面的输出,则表明80端口被占用 tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 2.查看占用80端口的进程 lsof -i:80 如果看到类似下面的输出,则表明占用80端口的是nginx进程 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nginx 1234 root 4u IPv4 0xffff88022f8c8b40 0t0 TCP *:http (LISTEN) 3.杀掉占用80端口的进程 kill -9 1234 4.重启nginx service nginx restart 5.查看80端口是否被占用 netstat -an|grep 80 如果看到类似下面的输出,则表明80端口没有被占用 tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 6.访问网站 curl http://127.0.0.1 如果看到类似下面的输出,则表明网站正常访问 Welcome to nginx!

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

以上就是解决80端口被占用的方法。

相关文章