2017-05-31 55 views
0

我學習的OpenStack,在虛擬機中退出,我改變後的00-nova-placement-api.conf工作的httpd.service失敗,因爲控制過程,錯誤代碼爲

我要重新啓動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 

然後我得到了下面的信息:

[[email protected] ~]# 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-投放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> 
~ 

Atteention

我發現在信息提示:

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

屏幕射擊低於:

enter image description here

353線低於: IncludeOptional conf.d/*.conf

我不知道哪裏是錯誤。

+0

'systemctl status httpd.service'顯示有用的*「**提示:**一些行被省略了,使用'-l'顯示完整。」*這將防止像「/etc/httpd/con ... fVersion>的第16行的語法錯誤被截斷,允許您找到正確的配置文件。 – HBruijn

回答

0

要使用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> 
+0

它應該大於2.4,不能使用'> ='? – aircraft

+0

仍然無法正常工作,我測試了一下,看到我的更新後的帖子。 – aircraft

+0

查看我的修改回答 – HBruijn

相關問題