capricornxl/ad-password-self-service

自动脚本部署成功后网址502

Closed this issue · 8 comments

系统:centos 8
内核版本:4.18.0-240.el8.x86_64
安装版本:ad-password-self-service-master 2月10日更新版本
现象:使用一键部署脚本安装成功后,打开域名502。

一键安装的时候我是把ad-password-self-service-master这个目录放在/tmp下执行的 部署脚本./auto-install.sh。是否需要把哪个目录复制到nginx所在的什么目录下才不会报502错误?

Uwsgi的启动状态。
[root@ssp ad-password-self-service-master]# systemctl status uwsgiserver
● uwsgiserver.service - SYSV: uwsgi server is Web Server
Loaded: loaded (/etc/rc.d/init.d/uwsgiserver; generated)
Active: active (exited) since Wed 2023-03-15 22:29:48 CST; 3 days ago
Docs: man:systemd-sysv-generator(8)
Process: 1130 ExecStart=/etc/rc.d/init.d/uwsgiserver start (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 23495)
Memory: 0B
CGroup: /system.slice/uwsgiserver.service

/log/uwsgi.log的日志信息。
*** Operational MODE: preforking+threaded ***
Redis无法连接,请排查Redis配置...
Traceback (most recent call last):
File "/tmp/ad-password-self-service-master/pwd_venv/lib/python3.8/site-packages/django/utils/connection.py", line 58, in getitem
return getattr(self._connections, alias)
File "/tmp/ad-password-self-service-master/pwd_venv/lib/python3.8/site-packages/asgiref/local.py", line 105, in getattr
raise AttributeError(f"{self!r} object has no attribute {key!r}")
AttributeError: <asgiref.local.Local object at 0x7f65347a1c10> object has no attribute 'default'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/tmp/ad-password-self-service-master/./pwdselfservice/init.py", line 11, in
redis_conn = get_redis_connection()
File "/tmp/ad-password-self-service-master/pwd_venv/lib/python3.8/site-packages/django_redis/init.py", line 12, in get_redis_connection
cache = caches[alias]
File "/tmp/ad-password-self-service-master/pwd_venv/lib/python3.8/site-packages/django/utils/connection.py", line 60, in getitem
if alias not in self.settings:
File "/tmp/ad-password-self-service-master/pwd_venv/lib/python3.8/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/tmp/ad-password-self-service-master/pwd_venv/lib/python3.8/site-packages/django/utils/connection.py", line 45, in settings
self._settings = self.configure_settings(self._settings)
File "/tmp/ad-password-self-service-master/pwd_venv/lib/python3.8/site-packages/django/utils/connection.py", line 50, in configure_settings
settings = getattr(django_settings, self.settings_name)
File "/tmp/ad-password-self-service-master/pwd_venv/lib/python3.8/site-packages/django/conf/init.py", line 82, in getattr
self._setup(name)
File "/tmp/ad-password-self-service-master/pwd_venv/lib/python3.8/site-packages/django/conf/init.py", line 69, in _setup
self._wrapped = Settings(settings_module)
File "/tmp/ad-password-self-service-master/pwd_venv/lib/python3.8/site-packages/django/conf/init.py", line 170, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/share/python-3.8.16/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 843, in exec_module
File "", line 219, in _call_with_frames_removed
File "/tmp/ad-password-self-service-master/./pwdselfservice/settings.py", line 11, in
from conf.local_settings import REDIS_LOCATION, REDIS_PASSWORD
ImportError: cannot import name 'REDIS_LOCATION' from 'conf.local_settings' (/tmp/ad-password-self-service-master/./conf/local_settings.py)

####### Redis

REDIS_LOCATION = r'127.0.0.1:6379'
REDIS_PASSWORD = r'PWD_SELF_REDIS_PASSWORD'

我这边手动添加到文件末尾,重启了服务器,现在/log/uwsgi.log的日志信息如下:

*** Starting uWSGI 2.0.21 (64bit) on [Mon Mar 20 16:38:20 2023] ***
compiled with version: 8.5.0 20210514 (Red Hat 8.5.0-18) on 15 March 2023 14:07:37
os: Linux-4.18.0-240.el8.x86_64 #1 SMP Fri Sep 25 19:48:47 UTC 2020
nodename: ssp
machine: x86_64
clock source: unix
detected number of CPU cores: 2
current working directory: /
detected binary path: /tmp/ad-password-self-service-master/pwd_venv/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
chdir() to /tmp/ad-password-self-service-master
your processes number limit is 14684
your memory page size is 4096 bytes
detected max file descriptor number: 1024
!!! no /etc/mime.types file found !!!
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
bind(): Cannot assign requested address [core/socket.c line 769]

文件里确实没有这2行记录,那是需要重新再部署一遍吗?

好的。我已经用ubuntu重新部署了一台服务,但是目前还是有一些小问题,方便加个QQ:252987765帮忙解答一下吗?

252987765

大佬,己加。