簡體   English   中英

httpd.service 的作業失敗,因為控制進程退出並顯示錯誤代碼

[英]Job for httpd.service failed because the control process exited with error code

我正在研究 openstack,在虛擬機中,更改00-nova-placement-api.conf

我想重新啟動httpd

systemctl restart httpd

但我失敗了:

httpd.service 的作業失敗,因為控制進程退出並顯示錯誤代碼。 有關詳細信息,請參閱“systemctl status httpd.service”和“journalctl -xe”。

所以我執行

systemctl status httpd.service

我得到以下信息:

x— httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2017-05-31 16:50:51 CST; 24s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 34969 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 34967 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 34967 (code=exited, status=1/FAILURE)

May 31 16:50:51 controller1 systemd[1]: Starting The Apache HTTP Server...
May 31 16:50:51 controller1 httpd[34967]: httpd: Syntax error on line 353 of /etc/httpd/conf/httpd.conf: Syntax error on line 16 of /etc/httpd/con...fVersion>
May 31 16:50:51 controller1 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
May 31 16:50:51 controller1 kill[34969]: kill: cannot find process ""
May 31 16:50:51 controller1 systemd[1]: httpd.service: control process exited, code=exited status=1
May 31 16:50:51 controller1 systemd[1]: Failed to start The Apache HTTP Server.
May 31 16:50:51 controller1 systemd[1]: Unit httpd.service entered failed state.

May 31 16:50:51 controller1 systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

我執行以下命令:

journalctl -xn

然后我得到了以下信息:

[root@controller1 ~]# journalctl -xn
-- Logs begin at Tue 2017-05-30 19:27:19 CST, end at Wed 2017-05-31 17:58:53 CST. --
May 31 17:58:48 controller1 systemd[1]: Unit openstack-nova-api.service entered failed state.
May 31 17:58:48 controller1 systemd[1]: openstack-nova-api.service failed.
May 31 17:58:49 controller1 systemd[1]: openstack-nova-api.service holdoff time over, scheduling restart.
May 31 17:58:49 controller1 systemd[1]: Starting OpenStack Nova API Server...
-- Subject: Unit openstack-nova-api.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit openstack-nova-api.service has begun starting up.
May 31 17:58:53 controller1 systemd[1]: openstack-nova-api.service: main process exited, code=exited, status=1/FAILURE
May 31 17:58:53 controller1 systemd[1]: Failed to start OpenStack Nova API Server.
-- Subject: Unit openstack-nova-api.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit openstack-nova-api.service has failed.
--
-- The result is failed.
May 31 17:58:53 controller1 systemd[1]: Unit openstack-nova-api.service entered failed state.
May 31 17:58:53 controller1 systemd[1]: openstack-nova-api.service failed.
May 31 17:58:53 controller1 systemd[1]: openstack-nova-api.service holdoff time over, scheduling restart.
May 31 17:58:53 controller1 systemd[1]: Starting OpenStack Nova API Server...
-- Subject: Unit openstack-nova-api.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit openstack-nova-api.service has begun starting up.

我的 00-nova-placement-api.conf 如下:

Listen 8778

<VirtualHost *:8778>
WSGIProcessGroup nova-placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGDaemonProcess nova-placement-api processes=3 threads=1 user=nova group=nova
WSGIScriptAlias //usr/bin/nova-placement-api
<Directory "/">
    Order allow,deny
    Allow from all
    Require all granted
</Directory>
<IfVersion>=2.4>
    ErrorLogFormat "%M"
</IfVersion>
    ErrorLog /var/log/nova/nova-placement-api.log
</VirtualHost>

Alias /nova-placement-api /usr/bin/nova-placement-api
<Location /nova-placement-api>
    SetHandler wsgi-script
    Options + ExecCGI
    WSGIProcessGroup nova-placemnet-api
    WSGIApplicationGroup %{GLOBAL}
    WSGIPassAuthorization On
</Location>
~

注意

我在資料中找到了一個線索:

: httpd: /etc/httpd/conf/httpd.conf 的第 353 行的語法錯誤:/etc/httpd/con... 數字的第 14 行的語法錯誤。

屏幕截圖如下:

在此處輸入圖片說明

353 行如下: IncludeOptional conf.d/*.conf

我不知道錯誤在哪里。

要使用IfVersion指令 mod_version 需要從您的 httpd.conf(或包含的conf.d/*.conf文件之一)加載:

LoadModule version_module modules/mod_version.so

其次,指令的格式是:

<IfVersion [[!]operator] version> 

而且您在指令和所需版本之間沒有空格

<IfVersion>=2.4>

需要 2.4 或更高版本,它可能看起來像:

<IfVersion >= 2.4>

請使用這個:

ErrorLog syslog

而不是這個

ErrorLog /var/log/nova/nova-placement-api.log

那對我有用。 更多信息: http : //httpd.apache.org/docs/1.3/mod/core.html#errorlog

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM