我最近在重启Apache时遇到了麻烦。我最近使用CentOS 7建立了一个Web服务器。我对我的php.ini文件进行了一些更改,并且相信我需要重新启动apache才能生效。当我尝试使用systemctl restart httpd.service
或apachectl restart
重启apache时,收到以下错误消息:
httpd.service的作业失败,因为控制进程退出并显示错误代码。有关详细信息,请参阅“systemctl status httpd.service”和“journalctl -xe”。
我输入journalctl -xe
并收到:
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 2016-01-25 08:44:29 EST; 10s ago Docs: man:httpd(8) man:apachectl(8) Process: 25244 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE) Process: 25243 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=0/SUCCESS) Main PID: 25243 (code=exited, status=0/SUCCESS)
Jan 25 08:44:29 localhost.localdomain systemd[1]: Starting The Apache HTTP Server... Jan 25 08:44:29 localhost.localdomain httpd[25243]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using l... message Jan 25 08:44:29 localhost.localdomain httpd[25243]: httpd (pid 10805) already running Jan 25 08:44:29 localhost.localdomain kill[25244]: kill: cannot find process "" Jan 25 08:44:29 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1 Jan 25 08:44:29 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server. Jan 25 08:44:29 localhost.localdomain systemd[1]: Unit httpd.service entered failed state. Jan 25 08:44:29 localhost.localdomain systemd[1]: httpd.service failed. Hint: Some lines were ellipsized, use -l to show in full.
答案 0 :(得分:0)
我重新启动了我的服务器,现在apache似乎正常运行。
答案 1 :(得分:0)
这很可能是httpd.conf文件中的配置错误
我在conf.d中创建了一个vhost.conf文件后遇到了同样的问题。删除这个新创建的文件(包含虚拟主机配置)后,我可以无错误地重启httpd。