Apache2 无法在 Ubuntu 14.04 上启动,日志文件为空

Apache2 无法在 Ubuntu 14.04 上启动,日志文件为空

我刚刚尝试在我的 14.04 Ubuntu 服务器上安装 apache2,但是出现错误:

 * Starting web server apache2                                                                       (98)Address already in use: AH00073: make_sock: unable to listen for connections on address [::]:80
(98)Address already in use: AH00073: make_sock: unable to listen for connections on 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.
 * 
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
invoke-rc.d: initscript apache2, action "start" failed.
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...

我尝试访问 /var/log/apache2/access.log 上的日志文件,但该文件是空的。

请帮我解决这个错误。谢谢。

更新:我得到这个netstat -antp | grep 80

(No info could be read for "-p": geteuid()=1001 but you should be root.)
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:8082            0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:8001            0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:5432          127.0.0.1:42080         ESTABLISHED -               
tcp        0      0 127.0.0.1:42080         127.0.0.1:5432          ESTABLISHED -               
tcp        0      0 127.0.0.1:41880         127.0.0.1:5432          ESTABLISHED -               
tcp        0      0 127.0.0.1:53380         127.0.0.1:11211         ESTABLISHED -               
tcp        0      0 127.0.0.1:38980         127.0.0.1:11211         TIME_WAIT   -               
tcp        0      0 127.0.0.1:11211         127.0.0.1:53380         ESTABLISHED -               
tcp        0      0 127.0.0.1:5432          127.0.0.1:41809         ESTABLISHED -               
tcp        0      0 127.0.0.1:5432          127.0.0.1:41880         ESTABLISHED -               
tcp        0      0 127.0.0.1:41809         127.0.0.1:5432          ESTABLISHED -               
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      -   

答案1

以超级用户身份运行 netstat 来实际查看正在使用端口 80 的进程(就像它基本上告诉您的那样)。

sudo netstat -antp | grep 80

相关内容