Apache 阿帕奇赢得';由于“原因”而无法启动;根目录的密码失败,来自…“;

Apache 阿帕奇赢得';由于“原因”而无法启动;根目录的密码失败,来自…“;,apache,permissions,root,Apache,Permissions,Root,我在尝试启动apache时遇到以下错误: balter@balterbox:/etc/apache2$ sudo service apache2 restart Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details. 以下是日志: bal

我在尝试启动apache时遇到以下错误:

balter@balterbox:/etc/apache2$ sudo service apache2 restart
Job for apache2.service failed because the control process exited with error code.
See "systemctl  status apache2.service" and "journalctl  -xe" for details.
以下是日志:

balter@balterbox:/etc/apache2$ sudo systemctl status apache2.service
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Fri 2018-02-16 14:45:58 PST; 33s ago
  Process: 2534 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
      CPU: 34ms

编辑: @Carlo建议的结果:

balter@balterbox:~$ sudo apache2ctl restart
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
httpd not running, trying to start
(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 'restart' failed.
The Apache error log may have more information.
balter@balterbox:~$ sudo apachectl restart
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
httpd not running, trying to start
(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 'restart' failed.
The Apache error log may have more information.
balter@balterbox:~$ sudo /etc/init.d/apache2 restart
[....] Restarting apache2 (via systemctl): apache2.serviceJob for apache2.service failed because the control process exited with error code.
See "systemctl  status apache2.service" and "journalctl  -xe" for details.

为什么无法打开日志?

重新启动服务器并发布Apache状态

试一试

  • sudo apache2ctl重启

  • sudo apachectl重启

  • sudo/etc/init.d/apache2重启

  • 在这些命令之后发布apache日志

  • 另见:

      • 在配置文件中设置服务器名
      • 使用Kill命令终止apache进程(因为您的日志显示该地址已在使用中)
      • 使用
        sudo apache2ctl Start
        启动apache

      尝试此命令
      sudo killall-9 httpd
      并使用
      sudo服务httpd start
      启动apache。 这篇文章是关于你的问题的:
      如果不起作用,请重新安装apache。

      请访问以下网站:

      在这种情况下,您可以忽略“根用户密码失败”错误——它们是针对SSH服务器的,而不是针对web服务器的。出于这个原因,您需要从journalctl命令中删除tail,并在文件中向上或向下翻页以查找有关Apache的特定行

      您添加的
      apache2ctl restart
      的输出显示了问题所在-有些东西已经在侦听端口80,因此Apache无法开始侦听该端口号上的连接。您可以运行类似于
      sudonetstat-tnlp的命令来获取正在侦听连接的正在运行的进程的列表,并查找本地地址以:80结尾的进程。停止相应的服务,然后再次尝试启动Apache

      事实证明,我还运行了Nginx(我安装它是为了做一些实验)。转向Nginx,并能够启动Apache


      另外,特别要感谢@Carlo Federico Vescovo坚持使用它。

      从ssh中删除您的iplogs@CarloFedericoVescovo抢手货你可以发布你的配置文件吗?该死。我有很高的期望,但这不起作用。我想如果我发布配置文件和日志,我将开始违反帖子长度!有什么建议吗?为什么不起作用?sudo apache2ctl状态的结果是什么?怎么了?我没有httpd,你有httpd。如果我需要它,为什么不用apache安装呢?我确实
      sudo安装了lamp服务器^
      。我一直在想它是什么…你有。尝试重新安装apache。使用sudo-apt-get-remove-apache2——purge和sudo-apt-get-install-apache2你试过我在最后一个答案中写的所有建议了吗?我是对的。您正在使用套接字,因此无法重新启动服务器。绝对正确。我只是不知道该杀哪一个服务!
      balter@balterbox:~$ sudo apache2ctl restart
      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
      httpd not running, trying to start
      (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 'restart' failed.
      The Apache error log may have more information.
      balter@balterbox:~$ sudo apachectl restart
      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
      httpd not running, trying to start
      (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 'restart' failed.
      The Apache error log may have more information.
      balter@balterbox:~$ sudo /etc/init.d/apache2 restart
      [....] Restarting apache2 (via systemctl): apache2.serviceJob for apache2.service failed because the control process exited with error code.
      See "systemctl  status apache2.service" and "journalctl  -xe" for details.