systemctl重启httpd失败,当时我不知道为什么有python / django相关

时间:2017-12-05 10:30:59

标签: python django apache centos7

我启动httpd失败了:

systemctl restart httpd
  

httpd.service的作业失败,因为控制进程退出并显示错误代码。有关详细信息,请参阅“systemctl status httpd.service”和“journalctl -xe”。

[root @ controller html] #journalctl -xe

12月 05 18:22:17 controller sshd[16444]: Failed password for root from 182.100.67.120 port 32032 ssh2
12月 05 18:22:18 controller sshd[16444]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
12月 05 18:22:20 controller sshd[16444]: Failed password for root from 182.100.67.120 port 32032 ssh2
12月 05 18:22:20 controller sshd[16444]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
12月 05 18:22:22 controller sshd[16444]: Failed password for root from 182.100.67.120 port 32032 ssh2
12月 05 18:22:22 controller sshd[16444]: Disconnecting: Too many authentication failures for root [preauth]
12月 05 18:22:22 controller sshd[16444]: PAM 5 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=182.100.67.120  user=root
12月 05 18:22:22 controller sshd[16444]: PAM service(sshd) ignoring max retries; 6 > 3
12月 05 18:22:24 controller sshd[16463]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=182.100.67.120  user=root
12月 05 18:22:24 controller sshd[16463]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
12月 05 18:22:26 controller sshd[1646

在我的/ var / log / messages中:

Dec  5 18:27:45 controller systemd: Starting The Apache HTTP Server...
Dec  5 18:27:46 controller python: Traceback (most recent call last):
Dec  5 18:27:46 controller python: File "/usr/share/openstack-dashboard/manage.py", line 23, in <module>
Dec  5 18:27:46 controller python: execute_from_command_line(sys.argv)
Dec  5 18:27:46 controller python: File "/usr/lib/python2.7/site-packages/Django-1.11.2-py2.7.egg/django/core/management/__init__.py", line 363, in execute_from_command_line
Dec  5 18:27:46 controller python: utility.execute()
Dec  5 18:27:46 controller python: File "/usr/lib/python2.7/site-packages/Django-1.11.2-py2.7.egg/django/core/management/__init__.py", line 337, in execute
Dec  5 18:27:46 controller python: django.setup()
Dec  5 18:27:46 controller python: File "/usr/lib/python2.7/site-packages/Django-1.11.2-py2.7.egg/django/__init__.py", line 27, in setup
Dec  5 18:27:46 controller python: apps.populate(settings.INSTALLED_APPS)
Dec  5 18:27:46 controller python: File "/usr/lib/python2.7/site-packages/Django-1.11.2-py2.7.egg/django/apps/registry.py", line 108, in populate
Dec  5 18:27:46 controller python: app_config.import_models()
Dec  5 18:27:46 controller python: File "/usr/lib/python2.7/site-packages/Django-1.11.2-py2.7.egg/django/apps/config.py", line 202, in import_models
Dec  5 18:27:46 controller python: self.models_module = import_module(models_module_name)
Dec  5 18:27:46 controller python: File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
Dec  5 18:27:46 controller python: __import__(name)
Dec  5 18:27:46 controller python: File "/usr/lib/python2.7/site-packages/openstack_auth/models.py", line 15, in <module>
Dec  5 18:27:46 controller python: from openstack_auth.user import User        # noqa
Dec  5 18:27:46 controller python: File "/usr/lib/python2.7/site-packages/openstack_auth/user.py", line 26, in <module>
Dec  5 18:27:46 controller python: from openstack_auth import utils
Dec  5 18:27:46 controller python: File "/usr/lib/python2.7/site-packages/openstack_auth/utils.py", line 20, in <module>
Dec  5 18:27:46 controller python: from django.contrib.auth import middleware
Dec  5 18:27:46 controller python: File "/usr/lib/python2.7/site-packages/Django-1.11.2-py2.7.egg/django/contrib/auth/middleware.py", line 4, in <module>
Dec  5 18:27:46 controller python: from django.contrib.auth.backends import RemoteUserBackend
Dec  5 18:27:46 controller python: File "/usr/lib/python2.7/site-packages/Django-1.11.2-py2.7.egg/django/contrib/auth/backends.py", line 6, in <module>
Dec  5 18:27:46 controller python: UserModel = get_user_model()
Dec  5 18:27:46 controller python: File "/usr/lib/python2.7/site-packages/Django-1.11.2-py2.7.egg/django/contrib/auth/__init__.py", line 198, in get_user_model
Dec  5 18:27:46 controller python: "AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL
Dec  5 18:27:46 controller python: django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'openstack_auth.User' that has not been installed
Dec  5 18:27:46 controller systemd: httpd.service: control process exited, code=exited status=1
Dec  5 18:27:46 controller systemd: Failed to start The Apache HTTP Server.
Dec  5 18:27:46 controller systemd: Unit httpd.service entered failed state.
Dec  5 18:27:46 controller systemd: httpd.service failed.

修改

你看,日志与django有关。我不确定它是由我运行django服务器引起的:

python3 manage.py runserver xxx:8001

我正在运行这个开发服务器,然后我重新启动httpd,但失败了。

我的操作系统是CentOS-7.2。

如何立即启动我的httpd.service?

编辑-2

我使用httpd,它说已经在运行,请看下面,但它没有激活:

[root@controller Qiyun02]# httpd
[root@controller Qiyun02]# httpd --version
httpd (pid 19893) already running
[root@controller Qiyun02]# ps -e | grep httpd
19893 ?        00:00:00 httpd
19894 ?        00:00:00 httpd
19895 ?        00:00:00 httpd
19896 ?        00:00:00 httpd
19897 ?        00:00:00 httpd
19898 ?        00:00:00 httpd
19899 ?        00:00:00 httpd
19900 ?        00:00:00 httpd
19901 ?        00:00:00 httpd
19902 ?        00:00:00 httpd
19903 ?        00:00:00 httpd
19904 ?        00:00:00 httpd
19905 ?        00:00:03 httpd
19906 ?        00:00:04 httpd
19907 ?        00:00:03 httpd
19908 ?        00:00:00 httpd
19909 ?        00:00:00 httpd
19910 ?        00:00:00 httpd
19911 ?        00:00:00 httpd
19912 ?        00:00:00 httpd
19973 ?        00:00:00 httpd
19991 ?        00:00:00 httpd

编辑-3

我正在使用openstack-ocata,并使用django-1.11.2。

0 个答案:

没有答案