0

我正在尝试通过 uWSGI 和 Apache 使用 Radicale。

经过一番努力,我设法在 Apache 上使用 WSGI 进行激进,但我想将身份验证卸载到 Apache。

所以我将apache conf创建为

<VirtualHost *:80>
ServerAdmin xxx@gmail.com
ServerName radicale.domain.com

ProxyPass / uwsgi://127.0.0.1:5232/

<Directory "/etc/radicale">
AllowOverride None
Require all granted
</Directory>

TransferLog /var/log/apache2/radicale_access.log
ErrorLog /var/log/apache2/radicale_error.log
</VirtualHost>

我的 uwsgi 应用程序是

[uwsgi]
http-socket = 127.0.0.1:5232
processes = 2
plugin = python3
#module = radicale
wsgi-file=/etc/radicale/radicale.wsgi
env = RADICALE_CONFIG=/etc/radicale/config

当我调用http://radicale.domain.com时,我收到一个通用的 500 错误,但在 apache 错误日志或 uswgi 日志中看不到任何错误。uwsgi 日志显示(详细)

Thu May  7 17:40:39 2020 - *** Starting uWSGI 2.0.14-debian (64bit) on [Thu May  7 17:40:39 2020] ***
Thu May  7 17:40:39 2020 - compiled with version: 6.3.0 20170516 on 17 March 2018 15:41:47
Thu May  7 17:40:39 2020 - os: Linux-2.6.32-042stab128.2 #1 SMP Thu Mar 22 10:58:36 MSK 2018
Thu May  7 17:40:39 2020 - nodename: xxx
Thu May  7 17:40:39 2020 - machine: x86_64
Thu May  7 17:40:39 2020 - clock source: unix
Thu May  7 17:40:39 2020 - pcre jit disabled
Thu May  7 17:40:39 2020 - detected number of CPU cores: 8
Thu May  7 17:40:39 2020 - current working directory: /
Thu May  7 17:40:39 2020 - writing pidfile to /run/uwsgi/app/radicale/pid
Thu May  7 17:40:39 2020 - detected binary path: /usr/bin/uwsgi-core
Thu May  7 17:40:39 2020 - setgid() to 33
Thu May  7 17:40:39 2020 - set additional group 125 (redis)
Thu May  7 17:40:39 2020 - set additional group 5003 (ispapps)
Thu May  7 17:40:39 2020 - set additional group 5004 (ispconfig)
Thu May  7 17:40:39 2020 - setuid() to 33
Thu May  7 17:40:39 2020 - your processes number limit is 256137
Thu May  7 17:40:39 2020 - your memory page size is 4096 bytes
Thu May  7 17:40:39 2020 - detected max file descriptor number: 131072
Thu May  7 17:40:39 2020 - lock engine: pthread robust mutexes
Thu May  7 17:40:39 2020 - thunder lock: disabled (you can enable it with --thunder-lock)
Thu May  7 17:40:39 2020 - uwsgi socket 0 bound to UNIX address /run/uwsgi/app/radicale/socket fd 3
Thu May  7 17:40:39 2020 - uwsgi socket 1 bound to TCP address 127.0.0.1:5232 fd 5
Thu May  7 17:40:39 2020 - Python version: 3.5.3 (default, Sep 27 2018, 17:25:39)  [GCC 6.3.0 20170516]
Thu May  7 17:40:39 2020 - *** Python threads support is disabled. You can enable it with --enable-threads ***
Thu May  7 17:40:39 2020 - Python main interpreter initialized at 0x7fc12c963dd0
Thu May  7 17:40:39 2020 - your server socket listen backlog is limited to 100 connections
Thu May  7 17:40:39 2020 - your mercy for graceful operations on workers is 60 seconds
Thu May  7 17:40:39 2020 - mapped 218304 bytes (213 KB) for 2 cores
Thu May  7 17:40:39 2020 - *** Operational MODE: preforking ***
Thu May  7 17:40:39 2020 - WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x7fc12c963dd0 pid: 23261 (defau
lt app)
Thu May  7 17:40:39 2020 - *** uWSGI is running in multiple interpreter mode ***
Thu May  7 17:40:39 2020 - spawned uWSGI master process (pid: 23261)
Thu May  7 17:40:39 2020 - spawned uWSGI worker 1 (pid: 23267, cores: 1)
Thu May  7 17:40:39 2020 - spawned uWSGI worker 2 (pid: 23268, cores: 1)

如何调试 uwsgi?如何查看 Apache 为何返回 500 错误?我是否对 conf 做错了什么 - 我发现文档在错误调试或理解如何定义模块时不是很有用

4

1 回答 1

0

好的,经过一周的思考、调试和一些咒骂,我看到了我相当愚蠢的错误:(

我在 UWSGI 中配置了一个 HTTP 套接字

http-socket = 127.0.0.1:5232

但在 Apache 中指定了 uwsgi 协议...

ProxyPass / uwsgi://127.0.0.1:5232/
于 2020-05-15T04:26:34.173 回答