我使用了Ubuntu16.04,并在Apache2中遇到了奇怪的错误,在那里它不再启动,我不知道是什么导致了这一点。希望有新眼睛的人能帮我进来。
以下是我收到的一些错误:
>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.下面是这两个状态命令的输出:
$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 rootapache的配置测试看起来是干净的(如果不计算servername警告)
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上重复了相同的东西,因为我试着让它运行)。看起来这也没什么好说的奇怪的。
-- 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'.发布于 2018-08-25 18:35:01
现在它变得更感兴趣了。
如果我将apache2设置为在没有文档根的情况下启动,则使用命令检查
apache2ctl -T然后使用下面的命令启动apache,它将在没有错误的情况下启动。
systemctl start apache2.service但是,在重新启动机器后,apache2不会按应有的方式自动启动,并且错误也是相同的。你知道那里发生了什么吗?
https://askubuntu.com/questions/1068627
复制相似问题