在制作apache虚拟主机时如何解决这个错误?

在制作apache虚拟主机时如何解决这个错误?

我已经在我的新服务器上安装了 LAMP,并且想要创建一个 Apache 虚拟主机。首先,我通过命令在 CentOS 7 上安装更新sudo yum updates。其次,更新服务器后,我安装了 LAMP 堆栈并继续制作 Apache 虚拟主机。创建 Apache 虚拟主机后,当我通过命令重新启动 Apache 时sudo apachectl restart,出现错误。

错误结果

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

当我尝试输入以下命令时出现错误。

命令:systemctl 状态 httpd.service

错误结果:

● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2017-09-04 07:06:47 EDT; 47s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 13017 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 13016 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 13016 (code=exited, status=1/FAILURE)

Sep 04 07:06:47 example.com systemd[1]: Starting The Apache HTTP Server...
Sep 04 07:06:47 example.com systemd[1]: httpd.service: main process exite...E
Sep 04 07:06:47 example.com kill[13017]: kill: cannot find process ""
Sep 04 07:06:47 example.com systemd[1]: httpd.service: control process ex...1
Sep 04 07:06:47 example.com systemd[1]: Failed to start The Apache HTTP S....
Sep 04 07:06:47 example.com systemd[1]: Unit httpd.service entered failed....
Sep 04 07:06:47 example.com systemd[1]: httpd.service failed.

Hint: Some lines were ellipsized, use -l to show in full.

我该如何解决这个问题?

答案1

到目前为止我已经找到了

sudo systemctl restart httpd

比其他任何东西都有效。

sudo systemctl restart httpd.service

似乎总是需要一段时间,而且并不总是能完成工作。

相关内容