如何解决重启Apache Ubuntu的错误

时间:2019-10-17 16:59:53

标签: apache ubuntu

我与Apache的连接有问题,使用sudo service apache2 restart命令重新启动后,出现此错误

  

apache2.service的作业失败,因为控制进程退出   错误代码。请参阅“ systemctl status apache2.service”和“ journalctl   -xe”以获取详细信息。

然后进入localhost时,它不允许我进入,这使我更糟,当我运行sudo journalctl -xe时,他告诉我以下内容,但仍然找不到错误,如果可以的话,我会非常感谢

编辑:运行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 Thu 2019-10-17 12:20:34 -04; 29min ago
  Process: 21198 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE)
  Process: 7385 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
  Process: 23453 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
 Main PID: 1059 (code=exited, status=0/SUCCESS)

oct 17 12:20:34 pcarrasco systemd[1]: Starting The Apache HTTP Server...
oct 17 12:20:34 pcarrasco apachectl[23453]: AH00526: Syntax error on line 47 of /etc/apache2/sites-enabled/cms.local.conf:
oct 17 12:20:34 pcarrasco apachectl[23453]: order takes one argument, 'allow,deny', 'deny,allow', or 'mutual-failure'
oct 17 12:20:34 pcarrasco apachectl[23453]: Action 'start' failed.
oct 17 12:20:34 pcarrasco apachectl[23453]: The Apache error log may have more information.
oct 17 12:20:34 pcarrasco systemd[1]: apache2.service: Control process exited, code=exited status=1
oct 17 12:20:34 pcarrasco systemd[1]: apache2.service: Failed with result 'exit-code'.
oct 17 12:20:34 pcarrasco systemd[1]: Failed to start The Apache HTTP Server.

1 个答案:

答案 0 :(得分:0)

由于配置问题,这很常见

可能是端口配置

锁定log file(在/etc/httpd/conf/httpd.conf中可以将其作为ErrorLog找到)

或尝试撤消在配置文件中所做的更改,直到发现问题为止