我试图为我的应用服务器使用端口80,但当我执行netstat -aon时,我得到:

TCP 0.0.0.0:80 0.0.0.0:0监听4

当我在任务管理器中查找进程时,它显示PID 4是SYSTEM,就是这样。没有扩展…什么都没有。“系统”。这是怎么回事?

我害怕结束这个过程,我该怎么办?


当前回答

这不能解释PID方面的事情,但如果你运行Skype,它喜欢使用端口80出于某种原因。

其他回答

以下五个步骤可以很容易地解决这个问题:

开放服务 右击万维网出版服务 点击停止

为防止此类问题再次发生:

转到属性 修改“启动类型”为“手动”

维奥拉准备好了!

有关根本原因的更多信息:https://serverfault.com/questions/65717/port-80-is-being-used-by-system-pid-4-what-is-that

这些对我都没用。我不得不回答一个超级用户的问题。

If it is a System Process—PID 4—you need to disable the HTTP.sys driver which is started on demand by another service, such as Windows Remote Management or Print Spooler on Windows 7 or 2008. There is two ways to disable it but the first one is safer: Go to device manager, select “show hidden devices” from menu/view, go to “Non-Plug and Play Driver”/HTTP, double click it to disable it (or set it to manual, some services depended on it). Reboot and use netstat -nao | find ":80" to check if 80 is still used.

这招对我很管用!

以编程方式标识流程

到目前为止,所有的答案都要求用户进行一些交互操作。这就是当netstat显示PID 4时如何找到PID,而不需要打开一些GUI或处理有关依赖服务的对话。

$Uri = "http://127.0.0.1:8989"    # for example


# Shows processes that have registered URLs with HTTP.sys
$QueueText = netsh http show servicestate view=requestq verbose=yes | Out-String

# Break into text chunks; discard the header
$Queues    = $QueueText -split '(?<=\n)(?=Request queue name)' | Select-Object -Skip 1

# Find the chunk for the request queue listening on your URI
$Queue     = @($Queues) -match [regex]::Escape($Uri -replace '/$')


if ($Queue.Count -eq 1)
{
    # Will be null if could not pick out exactly one PID
    $ProcessId = [string]$Queue -replace '(?s).*Process IDs:\s+' -replace '(?s)\s.*' -as [int]

    if ($ProcessId)
    {
        Write-Verbose "Identified process $ProcessId as the HTTP listener. Killing..."
        Stop-Process -Id $ProcessId -Confirm
    }
}

那可真让我受不了。我讨厌HttpListener,希望我只使用Pode。

另外,尝试停止“SQL Server Reporting Services (MSSQLSERVER)”,显然默认值是80。我这样做了,端口80释放了。PID认为罪魁祸首是“系统”,但显然这个系统可以有多种含义。

听起来好像IIS正在监听HTTP请求的80端口。

尝试通过进入控制面板/管理工具/Internet信息服务停止IIS,右键单击默认网站,然后单击弹出菜单中的停止选项,并查看端口80上的侦听器是否已清除。