On 9/8/21 17:56, Richard Rosner wrote:
I don't use uwsgi and know little about it so I don't know what the Unix domain socket /run/mailman3-web/uwsgi.sock connection is for, but this appears to be some miscunfiguration between apache and uwsgi. Normally, in an apache/uwsgi configuration, apache proxies to uwsgi via tcp port 8000 and uwsgi is configured with [uwsgi] uwsgi-socket = 0.0.0.0:8000
I have the apache24 and uwsgi working together. I did this way:
For the apache24 part I decided to use the mod-wsgi (and uswgi binary). did a
pip install mod-wsgi (with "mod_wsgi-express module-config" it shows the conf needed.)
after that a
pip install uwsgi
In my systems the mailman3 files are located at /usr/local/mailman3, and the apache24 config path is /usr/local/etc/apache24 (I'm running FreeBSD)
- Included these lines in the "loadmodule" part of /usr/local/etc/apache24/httpd.conf
Watch out the correct path of your python
##### begin of added lines LoadModule wsgi_module "/usr/local/lib/python3.7/site-packages/mod_wsgi/server/mod_wsgi-py37.so" WSGIPythonHome "/usr/local" WSGIDaemonProcess hyperkitty threads=25 python-path=/usr/local/mailman3 user=mailman3 group=mailman WSGIProcessGroup hyperkitty ##### end of added lines
- Added this line in the correct places of my /usr/local/etc/apache24/extra/httpd-vhosts.conf (in the listen 80 and 443 servers) Include "/usr/local/mailman3/apache24.uwsgi.conf" ( my apache24.uwsgi.conf is copied below)
Then all you have to do is a
- service apache24 restart
and initiate the uwsgi with a /usr/local/bin/uwsgi --ini /usr/local/mailman3/uwsgi.ini & (beware the "&" backgrounding it)
####### start of /usr/local/mailman3/uwsgi.ini # uwsgi.ini # [uwsgi] # Port on which uwsgi will be listening. http-socket = 0.0.0.0:8000 # Move to the directory wher the django files are. chdir = /usr/local/mailman3/ # Use the wsgi file provided with the django project. wsgi-file = wsgi.py # Setup default number of processes and threads per process. master = true process = 2 threads = 2 # Drop privielges and don't run as root. uid = www gid = www # Setup the django_q related worker processes. attach-daemon = ./manage.py qcluster # Setup the request log. req-logger = file://usr/local/mailman3/logs/uwsgi.log # Log cron seperately. logger = cron file://usr/local/mailman3/logs/uwsgi-cron.log log-route = cron uwsgi-cron # Log qcluster commands seperately. logger = qcluster file://usr/local/mailman3/logs/uwsgi-qcluster.log log-route = qcluster uwsgi-daemons # Last log and it logs the rest of the stuff. logger = file://usr/local/mailman3/logs/uwsgi-error.log ####### end of /usr/local/mailman3/uwsgi.ini
####### start of /usr/local/mailman3/apache24.uwsgi.conf
Alias /favicon.ico /usr/local/mailman3/static/hyperkitty/favicon.ico Alias /static /usr/local/mailman3/static ######### # for hyperkitty Alias /static/admin /usr/local/mailman3/static/admin Alias /static/CACHE /usr/local/mailman3/static/CACHE Alias /static/django_extensions /usr/local/mailman3/static/django_extensions Alias /static/hyperkitty /usr/local/mailman3/static/hyperkitty Alias /static/mailman3 /usr/local/mailman3/static/hyperkitty Alias /static/django-mailman3 /usr/local/mailman3/static/django-mailman3 Alias /static/rest_framework /usr/local/mailman3/static/rest_framework # for postorius Alias /static/postorius /usr/local/mailman3/static/postorius Alias /static/archives /usr/local/mailman3/static/postorius #####
###ErrorLog /var/log/httpd/hyperkitty_error.log ###CustomLog /var/log/httpd/hyperkitty_access.log combined
<Directory "/usr/local/mailman3/static"> Require all granted </Directory>
######## end of /usr/local/mailman3/apache24.uwsgi.conf