AH00015:无法打开日志操作“启动”失败。在 Ubuntu 14.04

nar*_*033 10 apache2

我正在尝试安装 apache2,我遇到了这个问题。给我一些解决方案

重新启动 Web 服务器 apache2 出现错误:

    AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
[fail]
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Run Code Online (Sandbox Code Playgroud)

小智 8

sudo netstat -tulpn | grep :80
Run Code Online (Sandbox Code Playgroud)

你会得到类似的输出

tcp        0      0 0.0.0.0:80         0.0.0.0:*      LISTEN     1066/lighttpd
Run Code Online (Sandbox Code Playgroud)

注意监听端口的进程的pid,在我的例子中是1066。然后运行

sudo kill -9 1066
Run Code Online (Sandbox Code Playgroud)

记得把pid改成监听端口的,可能和1066不一样


小智 2

您在什么类型的服务器上运行它?

解决第一个错误

AH00558:apache2:无法可靠地确定服务器的完全限定域名(使用 127.0.1.1)。全局设置“ServerName”指令以抑制此消息

您需要编辑httpd.conf文件,添加以下行:

ServerName localhost
Run Code Online (Sandbox Code Playgroud)

要解决其他错误,您应该确保尝试使用 root 权限运行 Apache。

sudo /usr/sbin/apachectl start
Run Code Online (Sandbox Code Playgroud)


小智 0

您可能安装了新的 Web 服务器或保留端口 80 的任何内容,检查您的服务以及新安装的内容