![Apache 虚拟主机服务器重新启动时出错](https://linux22.com/image/116733/Apache%20%E8%99%9A%E6%8B%9F%E4%B8%BB%E6%9C%BA%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%87%8D%E6%96%B0%E5%90%AF%E5%8A%A8%E6%97%B6%E5%87%BA%E9%94%99.png)
我将通过 PuTTy 上的 root 用户登录我的服务器并在其上安装 LAMP。安装灯后,打开森托斯7我将成功创建 Apache 虚拟主机,但最后当我尝试重新启动 Apache 时,它显示错误。如何解决这个问题?
systemctl status httpd.service
**Error=>>>>>>>**
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-08-24 11:38:04 EDT; 10s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 7029 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited,
status=1/FAILURE)
Process: 7028 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited,
status=1/FAILURE)
Main PID: 7028 (code=exited, status=1/FAILURE)
Aug 24 11:38:04 example.com systemd[1]: Starting The Apache HTTP Server...
Aug 24 11:38:04 example.com systemd[1]: httpd.service: main process exite...E
Aug 24 11:38:04 example.com kill[7029]: kill: cannot find process ""
Aug 24 11:38:04 example.com systemd[1]: httpd.service: control process ex...1
Aug 24 11:38:04 example.com systemd[1]: Failed to start The Apache HTTP S....
Aug 24 11:38:04 example.com systemd[1]: Unit httpd.service entered failed....
Aug 24 11:38:04 example.com systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
答案1
始终从故障排除工作开始。
此命令将显示导致错误的原因:
在带有 Apache 的 CentOS 上,请使用
apachectl -t
在带有 Apache2 的 Ubuntu 上,请使用
apache2ctl -t
通常这可能是一个非常小的错误,修复错误,重新启动 apache Web 服务器并享受。
快乐编码。