sup*_*tah 4 debian apache-httpd
我似乎无法让 Apache 在任何端口上启动。我总是收到错误:
apache2(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Run Code Online (Sandbox Code Playgroud)
我检查以确保端口 80 上没有任何东西在运行,为了确定,netstat -plant|grep 80我什sudo nc -l 80至没有出现任何问题。我想这可能是权限问题(它不应该是因为它应该从 initscript 开始),所以我将 Apache 的侦听端口更改为 8080,并且除了端口 8080 之外出现了相同的错误(并且没有任何内容在运行那个端口)。除了显示相应的地址和端口外,我什至尝试设置ports.conf为具有Listen 127.0.0.1:80甚Listen 127.0.0.1:8080至或多或少相同的错误。
我应该注意到我在 Debian Unstable 上。
在这一点上,我不知道还有什么要检查的。
从您的 strace 文件中,这是您的问题:
[pid 23020] setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
[pid 23020] setsockopt(5, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
[pid 23020] setsockopt(5, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
[pid 23020] setsockopt(5, SOL_TCP, TCP_NODELAY, [1], 4) = 0
[pid 23020] bind(5, {sa_family=AF_INET6, sin6_port=htons(80), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
[pid 23020] listen(5, 511) = 0
[pid 23020] setsockopt(7, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
[pid 23020] setsockopt(7, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
[pid 23020] setsockopt(7, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
[pid 23020] setsockopt(7, SOL_TCP, TCP_NODELAY, [1], 4) = 0
[pid 23020] bind(7, {sa_family=AF_INET6, sin6_port=htons(80), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 EADDRINUSE (Address already in use)
[pid 23020] write(2, "(98)Address already in use: AH00"..., 82(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
) = 82
Run Code Online (Sandbox Code Playgroud)
你会注意到bind被调用了两次。第一次工作。第二次,它失败了,因为地址已经在使用中——确实如此,因为它刚刚被绑定。
我已经在我的 apache 配置(Debian 测试/不稳定的 Apache 2.4)上确认我可以通过Listen 80两次配置来实现这一点。我怀疑你做了同样的事情,或者非常相似的事情。
| 归档时间: |
|
| 查看次数: |
1645 次 |
| 最近记录: |