【问题标题】:port 80 for apache server is in use by PID 4 (System) and cannot be stopped [closed]Apache服务器的端口80正在被PID 4(系统)使用并且无法停止[关闭]
【发布时间】:2016-09-06 07:31:30
【问题描述】:

我正在使用 xampp 在 80 端口启动 apache。但是,端口 80 由名称系统的 PID 4 占用。 我已经尝试过 Taskkill /F /PID 4 甚至使用管理员的权限来强制终止任务,但访问仍然被拒绝。 关于如何解决这个问题的任何想法(我不想更改 apache 的端口)

【问题讨论】:

  • 当我使用 systeminternals tcp 监视器时,它表明系统进程拥有一个端口,通常是因为 Windows 防火墙已打开,并且已经拦截了一些其他进程。当然,防火墙不会保持监听端口打开,除非其他一些应用程序打开了它。你没有启用IIS?只是猜测。
  • 也许这会有所帮助:stackoverflow.com/questions/1430141/…
  • 我在华硕笔记本电脑上遇到了完全相同的问题,但是在运行 ampps 时,我的解决方案是停止侦听端口 80 的“华硕翻转服务”。但是我必须每个都这样做在 MS Services gui 工具中的时间,我还没有解决方案让翻转屏幕和 amps 一起运行。

标签: windows apache tomcat xampp


【解决方案1】:

此服务通常使用80端口:“万维网发布服务”,在控制面板中打开“服务”并停止它

【讨论】:

    【解决方案2】:

    Nick W 我的华硕笔记本电脑也遇到了同样的问题,

    在 Windows 中,您可以使用以下命令获取有关某些应用程序正在使用的端口的信息: netstat -ao netsh http 显示 urlacl

    服务Asus Flip Service默认使用80端口,如果你停止服务它会释放端口,但是如果你把你的笔记本电脑变成平板模式屏幕不会旋转

    所以如果你想使用 Asus Flip Service 并释放 port 80 你可以更改正在使用的 Web Service 端口,我将端口更改为 800

    我所做的是转到安装应用程序的目录并更改配置文件

    导演: C:\Program Files\ASUS\ASUS FlipLock

    我更改的配置文件是:

    FlipController.exe.config

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <startup> 
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
        </startup>
        <system.serviceModel>
            <bindings>
                <basicHttpBinding>
                    <binding name="BasicHttpBinding_IWifiPowerServer" />
                    <binding name="BasicHttpBinding_IFlipPTPServer" />
                </basicHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://localhost:800/FilpWifiPowerManager.svc"
                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWifiPowerServer"
                    contract="WifiPowerServer.IWifiPowerServer" name="BasicHttpBinding_IWifiPowerServer" />
                <endpoint address="http://localhost:3712/FlipPTPServerManager.svc"
                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IFlipPTPServer"
                    contract="FlipPTPServer.IFlipPTPServer" name="BasicHttpBinding_IFlipPTPServer" />
            </client>
        </system.serviceModel>
    </configuration>
    

    ReStoreWifiPower.exe.config

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <startup> 
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
        </startup>
        <system.serviceModel>
            <bindings>
                <basicHttpBinding>
                    <binding name="BasicHttpBinding_IWifiPowerServer" />
                </basicHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://localhost:800/FilpWifiPowerManager.svc"
                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWifiPowerServer"
                    contract="WifiPowerServer.IWifiPowerServer" name="BasicHttpBinding_IWifiPowerServer" />
            </client>
        </system.serviceModel>
    </configuration>
    

    WifiPowerManager.exe.config

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <startup> 
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
        </startup>
      <system.serviceModel>
        <services>
          <service name="WifiPowerManager.WifiPowerServer"
                   behaviorConfiguration="HostedNetworkControlHostBehavior">
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:800/FilpWifiPowerManager.svc"/>
              </baseAddresses>
            </host>
            <!-- this endpoint is exposed at the base address provided by host: http://localhost/FilpWifiPowerManager.svc  -->
            <!--endpoint address=""
                      binding="wsHttpBinding"
                      contract="HostedNetwrokController.IHostedNetworkOperation" /-->
            <endpoint  binding="basicHttpBinding"
                       contract="WifiPowerManager.IWifiPowerServer" >
              <identity>
                <dns value="localhost"/>
              </identity>
            </endpoint>
            <!-- the mex endpoint is explosed at http://localhost/HostedNetworkController/service/mex -->
            <endpoint address="mex"
                      binding="mexHttpBinding"
                      contract="IMetadataExchange" />
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="HostedNetworkControlHostBehavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="False"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    </configuration>
    

    【讨论】:

      【解决方案3】:

      尝试运行 cmd:net stop http 会停止一些服务,然后你可以查看哪些服务使用了 80 端口

      【讨论】:

        【解决方案4】:

        当我遇到与您相同的问题时,我将 apache 端口更改为 81,默认情况下为 80,它可以正常工作,并且我一直在使用。这里是如何做到这一点。启动xampp控制面板->单击apache的配置按钮->单击httpd.conf->查找端口号并将其更改为所需的端口->重新启动xampp->完成。

        【讨论】:

          【解决方案5】:

          进程 PID 4 是系统关键服务,您无法在不导致窗口完全停止的情况下停止它。

          这些方法中的任何一种都应该可以解决问题:

          • 在注册表中更改 http.sys 设置: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\UrlAclInfo 只需在所有必要的键中将http:+:80 更改为另一个端口号,然后重新启动计算机。

          • 查找正在使用该端口的程序并使用其配置更改端口。通常 Microsoft SQL 报告工具使用 http.sys 侦听端口 80,有一个配置管理器允许您更改它。

          • 在您的 Apache 应用程序中使用不同的端口。

          【讨论】:

            【解决方案6】:

            首先这样做:

            • 在 Windows 任务管理器窗口中,转到“进程”选项卡。
            • 在菜单中,单击查看 -> 选择列。
            • 在选择进程页面列中,选中 PID(进程标识符)复选框。
            • 点击确定。
            • 勾选 Show Process from all users
            • 在“进程”选项卡中,在 对应的列。

            下一步:

            停止PID对应的进程,启动XAMPP

            我的猜测: IIS 或 WAMP 或 SQL Server Reporting Services (MSSQLSERVER) 或 WebMatrix 的“Web 部署代理服务”正在使用您的 80 端口

            【讨论】:

            • 进程名是ntoskrnl.exe
            • 它似乎是主要的操作系统进程。我将尝试将端口更改为另一个端口。感谢您的帮助。
            • 也许这些答案会有所帮助:stackoverflow.com/questions/1430141/…
            • 另外...安装了任何版本的 IIS、Visual Studio 或 Web 开发工具,或者在 Windows 功能下启用了 IIS?这可能会产生与您发现的结果相似的结果。
            猜你喜欢
            • 2013-11-29
            • 1970-01-01
            • 2021-09-23
            • 2019-03-11
            • 2015-10-28
            相关资源
            最近更新 更多