Debian 9 / Apache 2.4 / Radicale 2.1 / uWSGI - PullRequest
0 голосов
/ 07 мая 2020

Я пытаюсь использовать Radicale через uWSGI и Apache.

После некоторой борьбы мне удалось использовать WSGI для радикала на Apache, но я хотел бы разгрузить аутентификацию на 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 , Я получаю общую ошибку c 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 - я считаю, что документы не очень полезны, когда дело доходит до отладки ошибок или понимания того, как определять модули

1 Ответ

0 голосов
/ 15 мая 2020

Хорошо, после недели размышлений, отладки и некоторой ругани я увидел свою довольно глупую ошибку: (

Я настроил HTTP-сокет в UWSGI

http-socket = 127.0.0.1:5232

, но указал uwsgi протокол в Apache ...

ProxyPass / uwsgi://127.0.0.1:5232/
...