如何停止使用端口80的nginx
问题描述:
我试图使用sudo apt-get install nginx
更新nginx,但它给了我一个有关端口80被占用的错误消息。当我运行如何停止使用端口80的nginx
sudo netstat -tlnp | grep 80
我得到
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6845/nginx
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 1919/config.ru
tcp 0 0 0.0.0.0:8060 0.0.0.0:* LISTEN 6845/nginx
虽然我是不是能够很容易地了解每列从--help
功能是指,我想,在这个例子6845
是nginx
进程ID 。如果我尝试使用
sudo kill 6845
将其杀死,并再次运行sudo netstat -tlnp | grep 80
,我看到
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 10130/nginx
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 1919/config.ru
tcp 0 0 0.0.0.0:8060 0.0.0.0:* LISTEN 10130/nginx
换句话说,好像nginx
已立即开始下一个不同的进程ID侦听端口80一次。如何停止nginx
运行? (我也试过sudo systemctl stop nginx
,但无济于事)。
'sudo service nginx stop' – arkascha
这应该是[serverfault](http://serverfault.com/) – armnotstrong
后的问题帖子'sudo service nginx stop'后我仍然看到相同的进程正在运行。 –