nginx: [emerg] bind() to 0.0.0.0:21140 failed (98: Address already in use)
时间: 2023-09-29 10:02:25 浏览: 94
这个错误信息显示nginx无法在0.0.0.0:21140上绑定(bind)端口,因为该端口已经被占用。要解决这个问题,可以按照以下步骤进行:
1. 使用命令ps -e | grep nginx来查看是否已经启动了nginx。如果nginx已经在运行,可以使用命令sudo service nginx stop来停止nginx服务。
2. 如果nginx没有在运行,那么可以使用netstat命令查看端口0.0.0.0:21140被哪个进程占用了。可以使用命令sudo netstat -tuln | grep 21140来查看。
3. 找到占用该端口的进程后,可以使用kill命令将其终止。命令格式为sudo kill 进程ID。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [nginx报错 nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)](https://blog.csdn.net/Liqi23/article/details/127908856)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [nginx启动时遇到的问题](https://download.csdn.net/download/weixin_38589314/14037351)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文