当我输入sudo nginx时,我得到以下错误。我正在尝试设置虚拟机。有什么想法/建议吗?
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:90 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:90 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:90 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:90 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:90 failed (98: Address already in use)
nginx: [emerg] still could not bind()
答案 0 :(得分:2)
这意味着该端口已在使用中:
尝试:(对于每个失败的端口,80
90
443
)
sudo fuser -k 80/tcp
然后
sudo service nginx restart
答案 1 :(得分:0)
是的,这意味着该端口已由另一个服务示例apache服务器sudo fuser -k 80/tcp
使用,它为您提供了有关文本80使用的端口的详细信息。
尝试停止apache服务
sudo service apache2 stop
然后重新启动nginx
sudo systemctl restart nginx