我无法重新启动 httpd:
[root@controller conf.d]# systemctl restart httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
我看到了日志:
[root@controller conf.d]# systemctl status httpd
● 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-07-13 00:01:48 CST; 2min 5s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 18076 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 18074 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 18074 (code=exited, status=1/FAILURE)
Jul 13 00:01:48 controller systemd[1]: Starting The Apache HTTP Server...
Jul 13 00:01:48 controller httpd[18074]: AH00526: Syntax error on line 23 of /etc/httpd/conf.d/00-nova-placement-api.conf:
Jul 13 00:01:48 controller httpd[18074]: Illegal option
Jul 13 00:01:48 controller systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jul 13 00:01:48 controller kill[18076]: kill: cannot find process ""
Jul 13 00:01:48 controller systemd[1]: httpd.service: control process exited, code=exited status=1
Jul 13 00:01:48 controller systemd[1]: Failed to start The Apache HTTP Server.
Jul 13 00:01:48 controller systemd[1]: Unit httpd.service entered failed state.
Jul 13 00:01:48 controller systemd[1]: httpd.service failed.
你看到这两行:
7 月 13 日 00:01:48 控制器 httpd[18074]:AH00526: /etc/httpd/conf.d/00-nova-placement-api.conf 第 23 行语法错误:
7 月 13 日 00:01:48 控制器 httpd[18074]: 非法选项
但在/etc/httpd/conf.d/00-nova-placement-api.conf
文件中:
1 Listen 8778
2
3 <VirtualHost *:8778>
4 WSGIProcessGroup nova-placement-api
5 WSGIApplicationGroup %{GLOBAL}
6 WSGIPassAuthorization On
7 WSGIDaemonProcess nova-placement-api processes=3 threads=1 user=nova group=nova
8 WSGIScriptAlias / /usr/bin/nova-placement-api
9 <Directory "/">
10 Order allow,deny
11 Allow from all
12 Require all granted
13 </Directory>
14 <IfVersion >= 2.4>
15 ErrorLogFormat "%M"
16 </IfVersion>
17 ErrorLog /var/log/nova/nova-placement-api.log
18 </VirtualHost>
19
20 Alias /nova-placement-api /usr/bin/nova-placement-api
21 <Location /nova-placement-api>
22 SetHandler wsgi-script
23 Options +ExecCGI
24 WSGIProgressGroup nova-placement-api
25 WSGIApplicationGroup %{GLOBAL}
26 WSGIPassAuthorization On
27 </Location>
~
~
~
23行是正确的,为什么这里有错误?
编辑-1
权限如下:
[root@controller conf.d]# pwd
/etc/httpd/conf.d
[root@controller conf.d]# ll
total 24
-rw-r-----. 1 root root 698 Jul 13 00:07 00-nova-placement-api.conf
-rw-r-----. 1 root root 695 Jul 12 23:56 00-nova-placement-api.conf.bak
-rw-r--r--. 1 root root 2926 Nov 20 2015 autoindex.conf
-rw-r--r--. 1 root root 0 Jul 12 23:56 cp
-rw-r--r--. 1 root root 366 Nov 20 2015 README
-rw-r--r--. 1 root root 1252 Nov 20 2015 userdir.conf
-rw-r--r--. 1 root root 824 Nov 20 2015 welcome.conf
lrwxrwxrwx. 1 root root 38 Jul 12 15:27 wsgi-keystone.conf -> /usr/share/keystone/wsgi-keystone.conf
答案1
最后我发现错误出现在24行而不是23行。
所以这是系统错误:
24 WSGIProgressGroup nova-placement-api
应该:
24 WSGIProcessGroup nova-placement-api