Hi Mark,
Thanks very much for your prompt and helpful reply!
I made the change to the mailman3 configuration for Apache that you recommended since I am using uwsgi. Now, I am able to start/status/stop the mailman3-web service without errors. However, now, when I then attempt to access the mailman installation on my server with my browser, I get the following message in the browser window:
Internal Server Error
I am unable to find any errors in the mailman3 logs or in the Apache error logs. However the Apache access logs have the following:
173.165.166.34 - - [04/Feb/2022:17:06:20 -0500] "GET /mailman3 HTTP/1.1" 500 21
Do you have any idea as to what is going on now? Any suggestions for troubleshooting this?
Here is my /etc/mailman3/settings.py file where I have obfuscated sensitive info:
# Mailman Web configuration file. # /etc/mailman3/settings.py
from mailman_web.settings.base import * from mailman_web.settings.mailman import *
#: Default list of admins who receive the emails from error logging. ADMINS = ( ('Mailman Suite Admin', 'root@localhost'), )
# mysql database setup. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'mailman3web', 'USER': 'mailman', # TODO: Replace this with the password. 'PASSWORD': 'my_password', 'HOST': 'localhost', 'PORT': '', # GLD - add utf8mb4 character set for emoticons to work. 'OPTIONS': {'charset': 'utf8mb4',}, } }
# 'collectstatic' command will copy all the static files here.
# Alias this location from your webserver to /static
STATIC_ROOT = '/var/lib/mailman3/web/static'
# Make sure that this directory is created or Django will fail on start. LOGGING['handlers']['file']['filename'] = '/var/log/mailman3/web/mailman-web.log'
#: See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts ALLOWED_HOSTS = [ "localhost", # Archiving API from Mailman, keep it. # "lists.your-domain.org", # Add here all production domains you have. ]
#: Current Django Site being served. This is used to customize the web host #: being used to serve the current website. For more details about Django #: site, see: https://docs.djangoproject.com/en/dev/ref/contrib/sites/ SITE_ID = 1
# Set this to a new secret value. SECRET_KEY = 'secret_key_value'
# Set this to match the api_key setting in # /opt/mailman/mm/mailman-hyperkitty.cfg (quoted here, not there). MAILMAN_ARCHIVER_KEY = 'archiver_key'
# The sender of emails from Django such as address confirmation requests. # Set this to a valid email address. DEFAULT_FROM_EMAIL = 'postmaster@tld.com'
# The sender of error messages from Django. Set this to a valid email # address. SERVER_EMAIL = 'postmaster@tld.com'
And here is my uwsgi.ini file:
[uwsgi] # Port on which uwsgi will be listening. uwsgi-socket = /run/mailman3-web/uwsgi.sock # http-socket = 0.0.0.0:8000 # http = 0.0.0.0:8000
# If running uwsgi from the virtual environment ... virtualenv = /opt/mailman/venv/
module=mailman_web.wsgi:application
# Set PYTHONPATH env = PYTHONPATH=/etc/mailman3/ # The default settings module. env = DJANGO_SETTINGS_MODULE=settings
#Enable threading for python # GLD - remove the following line from debian uwsgi.ini # enable-threads = true
# Move to the directory wher the django files are. # GLD - remove the following line from debian uwsgi.ini # chdir = /usr/share/mailman3-web
# Use the wsgi file provided with the django project. # GLD - remove the following line from debian uwsgi.ini #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. # GLD uid = www-data gid = www-data # plugins = python3
# Setup the django_q related worker processes. # attach-daemon = python3 manage.py qcluster attach-daemon = /opt/mailman/venv/bin/mailman-web qcluster
# Setup hyperkitty's cron jobs. #unique-cron = -1 -1 -1 -1 -1 ./manage.py runjobs minutely #unique-cron = -15 -1 -1 -1 -1 ./manage.py runjobs quarter_hourly #unique-cron = 0 -1 -1 -1 -1 ./manage.py runjobs hourly #unique-cron = 0 0 -1 -1 -1 ./manage.py runjobs daily #unique-cron = 0 0 1 -1 -1 ./manage.py runjobs monthly #unique-cron = 0 0 -1 -1 0 ./manage.py runjobs weekly #unique-cron = 0 0 1 1 -1 ./manage.py runjobs yearly
# Setup the request log. req-logger = file:/var/log/mailman3/web/mailman-web.log
# Log cron seperately. #logger = cron file:/var/log/mailman3/web/mailman-web-cron.log #log-route = cron uwsgi-cron
# Log qcluster commands seperately. # GLD - Add the following two lines from mailman3 venv instructions. logger = qcluster file:/var/log/mailman3/web/mailman-web-qcluster.log log-route = qcluster uwsgi-daemons
# Last log and it logs the rest of the stuff. # GLD - Add the following line from mailman3 venv instructions. logger = file:/var/log/mailman3/web/mailman-web-error.log # GLD - remove the following line from debian uwsgi.ini # logto = /var/log/mailman3/web/mailman-web.log