【发布时间】:2013-02-07 14:16:55
【问题描述】:
我正在尝试在我的 Windows 7 系统上安装和运行 apache 2.4 我去了 apache 2.4 bin 目录并运行以下命令: 注意:我以管理员身份打开了 cmd 窗口。 C:\Apache24\bin>httpd.exe -k 安装
它的输出如下:
Installing the Apache2.4 service
The Apache2.4 service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
(OS 10013)An attempt was made to access a socket in a way forbidden by its acces
s permissions. : AH00072: make_sock: could not bind to address [::]:80
(OS 10013)An attempt was made to access a socket in a way forbidden by its acces
s permissions. : AH00072: make_sock: could not bind to address 0.0.0.0:80
AH00451: no listening sockets available, shutting down
AH00015: Unable to open log
因此它将 apache 2.4 作为服务安装,但无法启动。似乎正在使用 localhost 端口 80。这就是 "[::]:80" 的意思吗?
然后我停止了我一直运行的 apache 2.0 服务和 mysql 服务,希望停止其中一个服务可以释放 localhost 端口 80。
我还运行 netstat -o 来查看端口 80 是否正在使用。不是。
但是,我发现一个进程正在使用上面的套接字,它是一个正在监听上面的套接字的进程
TCP [::]:80 User-PC:0 LISTENING 4
然后我运行 tasklist 发现系统使用的是 pid 4。4 在 pid 列下
System 4 Services 0 544 K
最后,从尝试启动服务失败 我收到了一个记录在 Windows 系统事件中的错误。
Log Name: System
Source: Service Control Manager
Date: 2/21/2013 1:58:03 PM
Event ID: 7024
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: User-PC
Description:
The Apache2.4 service terminated with service-specific error Incorrect function.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" />
<EventID Qualifiers="49152">7024</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x8080000000000000</Keywords>
<TimeCreated SystemTime="2013-02-21T18:58:03.723988900Z" />
<EventRecordID>87756</EventRecordID>
<Correlation />
<Execution ProcessID="560" ThreadID="7596" />
<Channel>System</Channel>
<Computer>User-PC</Computer>
<Security />
</System>
<EventData>
<Data Name="param1">Apache2.4</Data>
<Data Name="param2">%%1</Data>
</EventData>
</Event>
尝试启动时的错误表明,由于缺乏访问权限,make-sock 无法绑定到在我看来类似于 localhost 端口 80 的套接字。例如,
(OS 10013)An attempt was made to access a socket in a way forbidden by its acces
s permissions. : AH00072: make_sock: could not bind to address [::]:80
谁能告诉我我做错了什么?
【问题讨论】:
-
这实际上帮助我解决了我的问题,这是一个完全不同的问题,但我得到了完全相同的服务启动错误
The Apache2.4 service terminated with service-specific error Incorrect function.。这个问题让我去看看error.log文件:) -
您的 netstat -o 选项让我发现哪个程序与端口 80 绑定 skype 是我机器的罪魁祸首。为了解决它,我搜索了“skype apache 冲突”,这对我有帮助:[链接]stackoverflow.com/questions/4705005/…。希望这会对遇到同样问题的人有所帮助。
-
我发现:运行SKYPE时apache无法启动。
-
我同意乔的解决方案。就我而言,我使用的是 Windows 10,而 Apache 一直工作到今天(2017 年 5 月 1 日)。我更改了 Apache 安装文件夹中 httpd.conf 中的“Listen”指令。现在我可以启动 Apache Web 服务器,我喜欢使用 Apache 监控应用程序来做这件事。如果您已经在 Windows 上安装了 Apache,那么您应该在 Apache 下的开始程序菜单中有一个很好的、易于使用的 httpd.conf 快捷方式。
标签: apache service windows-7 installation