启动 apache 失败(无法绑定到地址 0.0.0.0:80) [英] Starting apache fails (could not bind to address 0.0.0.0:80)

查看:41
本文介绍了启动 apache 失败(无法绑定到地址 0.0.0.0:80)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:已修复,在启用站点的情况下,VirtualHosts 配置文件之一似乎有误.

Update: Already fixed, it seems that one of VirtualHosts configurations files was wrong in sites-enabled.

我有 Ubuntu 11.10

I have Ubuntu 11.10

当我运行命令启动 apache2 时:

When I run the command to start apache2:

sudo /etc/init.d/apache2 start

我收到以下错误消息:

启动 web 服务器 apache2
apache2:无法可靠地确定服务器的完全合格域名,使用 127.0.1.1 作为 ServerName (98)Address already in使用:make_sock:无法绑定到地址 0.0.0.0:80 没有监听套接字可用,正在关闭无法打开日志操作开始"失败.

Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Action 'start' failed.

我运行此命令是为了获取使用端口 80 的进程:

I run this command in order to get the process that is using the port 80:

sudo netstat -ltnp | grep ':80'

返回此输出:

tcp6       0      0 :::80                   :::*                    LISTEN      1176/

要知道我运行的是哪个进程:

To know which process is I run this command:

ps -wlp1176

返回:

F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
5 D    33  1176     1  0  80   0 -     0 exit   ?        00:00:00 apache2

但是如果我试图终止进程:

But if I try to kill the process:

sudo kill -9 1176

它不会杀死它,如果我再次运行,netstat 命令仍然会出现在监听并且 apache 启动失败.

It doesn't kill it, if I run again the netstat command still appears listening and apache start fails.

有什么建议吗?

推荐答案

运行此命令为我工作:

fuser -k -n tcp 80

这篇关于启动 apache 失败(无法绑定到地址 0.0.0.0:80)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆