首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未能启动LSB: Apache2 web服务器,apache2崩溃

未能启动LSB: Apache2 web服务器,apache2崩溃
EN

Ask Ubuntu用户
提问于 2018-08-24 17:27:12
回答 1查看 2.7K关注 0票数 1

我使用了Ubuntu16.04,并在Apache2中遇到了奇怪的错误,在那里它不再启动,我不知道是什么导致了这一点。希望有新眼睛的人能帮我进来。

以下是我收到的一些错误:

代码语言:javascript
复制
>sudo service apache2 start
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.

下面是这两个状态命令的输出:

代码语言:javascript
复制
$sudo systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Fri 2018-08-24 19:15:41 CEST; 2min 35s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 8631 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)
   CGroup: /system.slice/apache2.service
           └─8645 [pdflush-0

Aug 24 19:15:21 tegra-ubuntu systemd[1]: Starting LSB: Apache2 web server...
Aug 24 19:15:21 tegra-ubuntu apache2[8631]:  * Starting Apache httpd web server apache2
Aug 24 19:15:41 tegra-ubuntu apache2[8631]:  *
Aug 24 19:15:41 tegra-ubuntu apache2[8631]:  * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Aug 24 19:15:41 tegra-ubuntu systemd[1]: apache2.service: Control process exited, code=exited status=1
Aug 24 19:15:41 tegra-ubuntu systemd[1]: Failed to start LSB: Apache2 web server.
Aug 24 19:15:41 tegra-ubuntu systemd[1]: apache2.service: Unit entered failed state.
Aug 24 19:15:41 tegra-ubuntu systemd[1]: apache2.service: Failed with result 'exit-code'.

sudo journalctl -xe
Aug 24 19:20:03 tegra-ubuntu systemd[1]: Starting LSB: Apache2 web server...
-- Subject: Unit apache2.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has begun starting up.
Aug 24 19:20:03 tegra-ubuntu apache2[8768]:  * Starting Apache httpd web server apache2
Aug 24 19:20:23 tegra-ubuntu apache2[8768]:  *
Aug 24 19:20:23 tegra-ubuntu apache2[8768]:  * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Aug 24 19:20:23 tegra-ubuntu systemd[1]: apache2.service: Control process exited, code=exited status=1
Aug 24 19:20:23 tegra-ubuntu systemd[1]: Failed to start LSB: Apache2 web server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has failed.
--
-- The result is failed.
Aug 24 19:20:23 tegra-ubuntu systemd[1]: apache2.service: Unit entered failed state.
Aug 24 19:20:23 tegra-ubuntu systemd[1]: apache2.service: Failed with result 'exit-code'.
Aug 24 19:20:23 tegra-ubuntu sudo[8736]: pam_unix(sudo:session): session closed for user root

apache的配置测试看起来是干净的(如果不计算servername警告)

代码语言:javascript
复制
apachectl configtest
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
Syntax OK

更有趣的是,apache2 error.log是空的。

这里是journalctl的输出(我把它缩小了一点,在Apache2上重复了相同的东西,因为我试着让它运行)。看起来这也没什么好说的奇怪的。

代码语言:javascript
复制
-- Logs begin at Wed 2018-08-22 21:52:44 CEST, end at Sat 2018-08-25 13:25:11 CEST. --
Aug 24 19:20:03 tegra-ubuntu systemd[1]: Starting LSB: Apache2 web server...
Aug 24 19:20:03 tegra-ubuntu apache2[8768]:  * Starting Apache httpd web server apache2
Aug 24 19:20:23 tegra-ubuntu apache2[8768]:  *
Aug 24 19:20:23 tegra-ubuntu apache2[8768]:  * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Aug 24 19:20:23 tegra-ubuntu systemd[1]: apache2.service: Control process exited, code=exited status=1
Aug 24 19:20:23 tegra-ubuntu systemd[1]: Failed to start LSB: Apache2 web server.
Aug 24 19:20:23 tegra-ubuntu systemd[1]: apache2.service: Unit entered failed state.
Aug 24 19:20:23 tegra-ubuntu systemd[1]: apache2.service: Failed with result 'exit-code'.
EN

回答 1

Ask Ubuntu用户

发布于 2018-08-25 18:35:01

现在它变得更感兴趣了。

如果我将apache2设置为在没有文档根的情况下启动,则使用命令检查

代码语言:javascript
复制
apache2ctl -T

然后使用下面的命令启动apache,它将在没有错误的情况下启动。

代码语言:javascript
复制
systemctl start apache2.service

但是,在重新启动机器后,apache2不会按应有的方式自动启动,并且错误也是相同的。你知道那里发生了什么吗?

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1068627

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档