Still on my MM3 learning path.
I mostly have everything running without errors - even uwsgi is starting without errors after I followed the fix from the discussion at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/N...
I have standardized all the files in /opt/mailman/mm/ because this is FreeBSD and our configs for user-installed apps are usually supposed to go to /usr/local/etc/.
My VHOST configuration is the exact replica of https://wiki.list.org/DOC/Mailman%203%20installation%20experience?action=AttachFile&do=view&target=mpo_wsgi.txt with the only change being the Python version from 3.6 to 3.9.
My challenge now is to get Apache+mod_uwsgi to serve my pages, but I am hitting the error below which has gotten me stuck. Thanking you in advance for your advice on how to overcome this.
[Thu Dec 22 14:21:22.758277 2022] [wsgi:info] [pid 4288] [remote 197.232.81.246:15107] mod_wsgi (pid=4288, process='mailman-web', application='mm3-lists.kictanet.or.ke|/mailman3'): Loading Python script file '/opt/mailman/mm/wsgi.py'. [Thu Dec 22 14:21:23.039999 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] mod_wsgi (pid=4288): Failed to exec Python script file '/opt/mailman/mm/wsgi.py'. [Thu Dec 22 14:21:23.040054 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] mod_wsgi (pid=4288): Exception occurred processing WSGI script '/opt/mailman/mm/wsgi.py'. [Thu Dec 22 14:21:23.040841 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] Traceback (most recent call last): [Thu Dec 22 14:21:23.040914 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] File "/opt/mailman/mm/wsgi.py", line 38, in <module> [Thu Dec 22 14:21:23.040921 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] application = get_wsgi_application() [Thu Dec 22 14:21:23.040929 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] File "/opt/mailman/mm/venv/lib/python3.9/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application [Thu Dec 22 14:21:23.040934 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] django.setup(set_prefix=False) [Thu Dec 22 14:21:23.040941 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] File "/opt/mailman/mm/venv/lib/python3.9/site-packages/django/__init__.py", line 19, in setup [Thu Dec 22 14:21:23.040945 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) [Thu Dec 22 14:21:23.040952 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] File "/opt/mailman/mm/venv/lib/python3.9/site-packages/django/conf/__init__.py", line 92, in __getattr__ [Thu Dec 22 14:21:23.040957 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] self._setup(name) [Thu Dec 22 14:21:23.040964 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] File "/opt/mailman/mm/venv/lib/python3.9/site-packages/django/conf/__init__.py", line 79, in _setup [Thu Dec 22 14:21:23.040968 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] self._wrapped = Settings(settings_module) [Thu Dec 22 14:21:23.040975 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] File "/opt/mailman/mm/venv/lib/python3.9/site-packages/django/conf/__init__.py", line 190, in __init__ [Thu Dec 22 14:21:23.040979 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] mod = importlib.import_module(self.SETTINGS_MODULE) [Thu Dec 22 14:21:23.040986 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module [Thu Dec 22 14:21:23.040990 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] return _bootstrap._gcd_import(name[level:], package, level) [Thu Dec 22 14:21:23.040997 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] File "<frozen importlib._bootstrap>", line 1030, in _gcd_import [Thu Dec 22 14:21:23.041004 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] File "<frozen importlib._bootstrap>", line 1007, in _find_and_load [Thu Dec 22 14:21:23.041012 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked [Thu Dec 22 14:21:23.041064 2022] [wsgi:error] [pid 4288] [remote 197.232.81.246:15107] ModuleNotFoundError: No module named 'settings'
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
On 12/22/22 03:49, Odhiambo Washington wrote:
My challenge now is to get Apache+mod_uwsgi to serve my pages,
I assume that's a typo. I.e, mod_wsgi, not mod_uwsgi.
but I am hitting the error below which has gotten me stuck. Thanking you in advance for your advice on how to overcome this.
...> [Thu Dec 22 14:21:23.041064 2022] [wsgi:error] [pid 4288] [remote
197.232.81.246:15107] ModuleNotFoundError: No module named 'settings'
Django can't import your settings.py. Is the directory that contains it in your Python path and does that directory contain (an empty) __init__.py?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Thu, Dec 22, 2022 at 8:02 PM Mark Sapiro <mark@msapiro.net> wrote:
On 12/22/22 03:49, Odhiambo Washington wrote:
My challenge now is to get Apache+mod_uwsgi to serve my pages,
I assume that's a typo. I.e, mod_wsgi, not mod_uwsgi.
That's right :)
but I am hitting the error below which has gotten me stuck. Thanking you in advance for your advice on how to overcome this.
...> [Thu Dec 22 14:21:23.041064 2022] [wsgi:error] [pid 4288] [remote
197.232.81.246:15107] ModuleNotFoundError: No module named 'settings'
Django can't import your settings.py. Is the directory that contains it in your Python path and does that directory contain (an empty) __init__.py?
Here is the VHOST... <CUT> vhost ---8< [00:53 mm ]$ less /usr/local/etc/apache24/Includes/mailman3-uwsgi.cf # mm3-lists.kictanet.or.ke
<VirtualHost *:80> ServerName mm3-lists.kictanet.or.ke ServerAdmin odhiambo@gmail.com Redirect permanent / https://mm3-lists.kictanet.or.ke
</VirtualHost>
# This goes in a global section.
WSGIDaemonProcess mailman-web display-name=mailman-web maximum-requests=1000 umask=0002 user=mailman group=mailman python-path=/opt/mailman/mm/venv/lib/python3.9/site-packages:/opt/mailman/mm/venv/lib/python3.9 python-home=/opt/mailman/mm/venv home=/opt/mailman/mm/var WSGIRestrictSignal Off
<VirtualHost *:443> ServerName mm3-lists.kictanet.or.ke ServerAdmin odhiambo@gmail.com
SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/cert.pem" SSLCertificateKeyFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/privkey.pem" SSLCertificateChainFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/chain.pem"
CustomLog /var/log/mm3-lists-access.log combined ErrorLog /var/log/mm3-lists-error.log LogLevel info
Alias /favicon.ico /opt/mailman/mm/static/hyperkitty/img/favicon.ico
# (I'm not sure that WSGIRestrictSignal Off is required, but it was in the # provided example so I kept it. I also made changes to WSGIDaemonProcess # based on my own mod_wsgi experience elsewhere.)
# This goes in the VirtualHost block for the domain.
# Mailman 3 stuff
Alias /static "/opt/mailman/mm/static"
<Directory "/opt/mailman/mm/static">
Require all granted
</Directory>
WSGIScriptAlias /mailman3 /opt/mailman/mm/wsgi.py
<Directory "/opt/mailman/mm/">
<Files wsgi.py>
Order deny,allow
Allow from all
Require all granted
</Files>
WSGIProcessGroup mailman-web
</Directory>
</VirtualHost> </CUT>
And here is the path - or maybe there is something I am missing in the VHOST?
[00:53 ~ ]$ cd /opt/mailman/mm/ [00:53 mm ]$ ls -al total 116 drwxr-xr-x 9 mailman mailman 512 Dec 22 13:54 . drwxr-xr-x 6 mailman mailman 512 Dec 21 07:54 .. -rw-r--r-- 1 mailman mailman 0 Sep 29 2021 __init__.py drwxr-xr-x 2 mailman mailman 512 Dec 22 14:18 __pycache__ -rw-r--r-- 1 mailman mailman 15574 Dec 20 18:16 _settings.py drwxr-xr-x 3 mailman mailman 512 Dec 20 19:47 bin drwxr-xr-x 5 mailman mailman 512 Dec 8 10:32 etc drwxr-xr-x 2 mailman mailman 1536 Dec 21 11:54 fulltext_index -rw-r--r-- 1 mailman mailman 317 Dec 21 16:53 gunicorn.conf lrwxr-xr-x 1 mailman mailman 13 Dec 21 16:55 gunicorn.conf.py -> gunicorn.conf -rw-r--r-- 1 mailman mailman 0 Dec 5 18:10 init.py lrwxr-xr-x 1 mailman mailman 24 Dec 5 17:38 logs -> /opt/mailman/mm/var/logs -rw-r--r-- 1 mailman mailman 592 Oct 2 2021 mailman-crontab -rw-r--r-- 1 mailman mailman 409 Dec 20 16:32 mailman-hyperkitty.cfg -rw-r--r-- 1 mailman mailman 1330 Dec 20 16:24 mailman.cfg -rw-r--r-- 1 mailman mailman 183 Dec 2 15:17 main.py -rwxr-xr-x 1 mailman mailman 243 Sep 29 2021 manage.py -rw-r--r-- 1 mailman mailman 510 Dec 11 14:11 modify-db.sql -rw-r--r-- 1 mailman mailman 15844 Dec 22 14:18 settings.py -rw-r--r-- 1 mailman mailman 6622 Dec 22 11:27 settings_local.py drwxr-xr-x 10 mailman mailman 512 Dec 5 17:38 static -rw-r--r-- 1 mailman mailman 1453 Dec 20 16:32 urls.py -rw-r--r-- 1 mailman mailman 1266 Dec 22 13:55 uwsgi.ini drwxr-xr-x 12 mailman mailman 512 Dec 22 14:21 var drwxr-xr-x 7 mailman mailman 512 Dec 6 15:35 venv -rw-r--r-- 1 mailman mailman 1173 Sep 29 2021 wsgi.py
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
On 12/22/22 13:57, Odhiambo Washington wrote:
WSGIDaemonProcess mailman-web display-name=mailman-web maximum-requests=1000 umask=0002 user=mailman group=mailman python-path=/opt/mailman/mm/venv/lib/python3.9/site-packages:/opt/mailman/mm/venv/lib/python3.9 python-home=/opt/mailman/mm/venv home=/opt/mailman/mm/var WSGIRestrictSignal Off
Add /opt/mailman/mm to python_path. I.e.
python-path=/opt/mailman/mm:/opt/mailman/mm/venv/lib/python3.9/site-packages:/opt/mailman/mm/venv/lib/python3.9
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Fri, Dec 23, 2022 at 2:02 AM Mark Sapiro <mark@msapiro.net> wrote:
On 12/22/22 13:57, Odhiambo Washington wrote:
WSGIDaemonProcess mailman-web display-name=mailman-web maximum-requests=1000 umask=0002 user=mailman group=mailman
python-path=/opt/mailman/mm/venv/lib/python3.9/site-packages:/opt/mailman/mm/venv/lib/python3.9
python-home=/opt/mailman/mm/venv home=/opt/mailman/mm/var WSGIRestrictSignal Off
Add /opt/mailman/mm to python_path. I.e.
python-path=/opt/mailman/mm:/opt/mailman/mm/venv/lib/python3.9/site-packages:/opt/mailman/mm/venv/lib/python3.9
Now working as expected.
With this, my questions about running MM3 with either gunicorn or mod_wsgi are bound to get reduced to an acceptable level.
There is just one more thing - I have this in settings.py: LOGGING['handlers']['file']['filename'] = '/opt/mailman/mm/var/logs/mailmanweb.log'
However, the referenced file is ever empty. At what point is it supposed to record anything?
Thank you very much and may you enjoy your festive season - the one we call Christmas.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
On 12/22/22 16:03, Odhiambo Washington wrote:
There is just one more thing - I have this in settings.py: LOGGING['handlers']['file']['filename'] = '/opt/mailman/mm/var/logs/mailmanweb.log'
And what are LOGGING['handlers']['file']['level'], LOGGING['handlers']['file']['class'] and LOGGING['handlers']['file']['formatter']
However, the referenced file is ever empty. At what point is it supposed to record anything?
What is logged depends on level
but even with DEBUG
not much routine
stuff is logged. See https://docs.djangoproject.com/en/3.2/topics/logging/
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Fri, Dec 23, 2022 at 4:29 AM Mark Sapiro <mark@msapiro.net> wrote:
On 12/22/22 16:03, Odhiambo Washington wrote:
There is just one more thing - I have this in settings.py: LOGGING['handlers']['file']['filename'] = '/opt/mailman/mm/var/logs/mailmanweb.log'
And what are LOGGING['handlers']['file']['level'], LOGGING['handlers']['file']['class'] and LOGGING['handlers']['file']['formatter']
Those are left as defaults in my setup.py.
However, the referenced file is ever empty. At what point is it supposed to record anything?
What is logged depends on
level
but even withDEBUG
not much routine stuff is logged. See https://docs.djangoproject.com/en/3.2/topics/logging/
I will read that and see if I get to pick up something.
And now I am having a problem with mod_wsgi. First, the URL displayed when I load the page looks bogus to me. While I expect the URL to be https://mm3-lists.kictanet.or.ke/mailman3/domains/, mod_wsgi give me https://mm3-lists.kictanet.or.ke/mailman3/mailman3/domains/ - there is an extra /mailman3!
So I have;
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/lists/ - working, or appears to.
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/domains/ - working, or appears to.
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/bans/ - working, or appears to
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/users - working, or appears to
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/lists/kictanet.lists.kict...
- This throws an exception error when I click "Manage Subscription".
-> https://pastebin.ubuntu.com/p/RkKH793Jgw/
And while I do not quite understand the error itself, there is also one particular line that I also saw that has left me baffled: [Fri Dec 23 08:53:18.290411 2022] [core:info] [pid 91236] [client 197.232.81.246:13865] AH00128: File does not exist: /usr/local/www/apache24/data/archives/list/ kictanet@lists.kictanet.or.ke/thread/VIHCC6MSXZSNHY7YPEJ3D2US4N7MHJEC/, refe rer: https://mm3-lists.kictanet.or.ke/archives/list/kictanet@lists.kictanet.or.ke
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
On Fri, Dec 23, 2022 at 9:21 AM Odhiambo Washington <odhiambo@gmail.com> wrote:
On Fri, Dec 23, 2022 at 4:29 AM Mark Sapiro <mark@msapiro.net> wrote:
On 12/22/22 16:03, Odhiambo Washington wrote:
There is just one more thing - I have this in settings.py: LOGGING['handlers']['file']['filename'] = '/opt/mailman/mm/var/logs/mailmanweb.log'
And what are LOGGING['handlers']['file']['level'], LOGGING['handlers']['file']['class'] and LOGGING['handlers']['file']['formatter']
Those are left as defaults in my setup.py.
However, the referenced file is ever empty. At what point is it supposed to record anything?
What is logged depends on
level
but even withDEBUG
not much routine stuff is logged. See https://docs.djangoproject.com/en/3.2/topics/logging/I will read that and see if I get to pick up something.
And now I am having a problem with mod_wsgi. First, the URL displayed when I load the page looks bogus to me. While I expect the URL to be https://mm3-lists.kictanet.or.ke/mailman3/domains/, mod_wsgi give me https://mm3-lists.kictanet.or.ke/mailman3/mailman3/domains/ - there is an extra /mailman3!
So I have;
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/lists/ - working, or appears to.
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/domains/ - working, or appears to.
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/bans/ - working, or appears to
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/users - working, or appears to
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/lists/kictanet.lists.kict...
- This throws an exception error when I click "Manage Subscription".
-> https://pastebin.ubuntu.com/p/RkKH793Jgw/
And while I do not quite understand the error itself, there is also one particular line that I also saw that has left me baffled: [Fri Dec 23 08:53:18.290411 2022] [core:info] [pid 91236] [client 197.232.81.246:13865] AH00128: File does not exist: /usr/local/www/apache24/data/archives/list/ kictanet@lists.kictanet.or.ke/thread/VIHCC6MSXZSNHY7YPEJ3D2US4N7MHJEC/, refe rer: https://mm3-lists.kictanet.or.ke/archives/list/kictanet@lists.kictanet.or.ke
I also need to add the fact that at the point where I am clicking "Manage Subscription", the URL has changed to https://mm3-lists.kictanet.or.ke/mailman3/archives/list/kictanet@lists.kicta... (just a single /mailman3).
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
On 12/22/22 22:26, Odhiambo Washington wrote:
On Fri, Dec 23, 2022 at 9:21 AM Odhiambo Washington <odhiambo@gmail.com> wrote:
And now I am having a problem with mod_wsgi. First, the URL displayed when I load the page looks bogus to me. While I expect the URL to be https://mm3-lists.kictanet.or.ke/mailman3/domains/, mod_wsgi give me https://mm3-lists.kictanet.or.ke/mailman3/mailman3/domains/ - there is an extra /mailman3!
See below:
So I have;
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/lists/ - working, or appears to.
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/domains/ - working, or appears to.
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/bans/ - working, or appears to
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/users - working, or appears to
- https://mm3-lists.kictanet.or.ke/mailman3/mailman3/lists/kictanet.lists.kict...
- This throws an exception error when I click "Manage Subscription".
messages like these
[Fri Dec 23 09:10:55.393386 2022] [wsgi:error] [pid 74857] [remote 197.232.81.246:14181] File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mailmanclient/restbase/connection.py", line 160, in call [Fri Dec 23 09:10:55.393390 2022] [wsgi:error] [pid 74857] [remote 197.232.81.246:14181] raise HTTPError(params.get('url'), response.status_code, [Fri Dec 23 09:10:55.393394 2022] [wsgi:error] [pid 74857] [remote 197.232.81.246:14181] urllib.error.HTTPError: HTTP Error 500: {"title": "500 Internal Server Error"}
Indicate an uncaught exception in Mailman core. What's in mailman.log?
And while I do not quite understand the error itself, there is also one particular line that I also saw that has left me baffled: [Fri Dec 23 08:53:18.290411 2022] [core:info] [pid 91236] [client 197.232.81.246:13865] AH00128: File does not exist: /usr/local/www/apache24/data/archives/list/ kictanet@lists.kictanet.or.ke/thread/VIHCC6MSXZSNHY7YPEJ3D2US4N7MHJEC/, referer: https://mm3-lists.kictanet.or.ke/archives/list/kictanet@lists.kictanet.or.ke
This is because something is doing an HTTP GET for
/archives/list/kictanet@lists.kictanet.or.ke/thread/VIHCC6MSXZSNHY7YPEJ3D2US4N7MHJEC/
and the URL is not recognized as one handled by mod_wsgi so apache tries
to get it from its DocumentRoot.
mod_wsgi has to serve a number of URLs. Look in /opt/mailman/mm/urls.py for urlpatterns. You will probably see things like
url(r'^accounts/', include('allauth.urls')),
# Django admin
url(r'^admin/', admin.site.urls),
url(r'^mailman3/', include('postorius.urls')),
url(r'^archives/', include('hyperkitty.urls')),
Those are all things that need to be handled by mod_wsgi
In your apache config, you only have a WSGIScriptAlias for /mailman3. Thus paths need to be prefixed with /mailman3 in order to be handled by mod_wsgi. I'm not sure what is doing this prefixing, but without it paths that don't begin with /mailman3 don't work unless you also have things like
WSGIScriptAlias /accounts /opt/mailman/mm/wsgi.py WSGIScriptAlias /admin /opt/mailman/mm/wsgi.py WSGIScriptAlias /archives /opt/mailman/mm/wsgi.py
in your apache config.
I also need to add the fact that at the point where I am clicking "Manage Subscription", the URL has changed to https://mm3-lists.kictanet.or.ke/mailman3/archives/list/kictanet@lists.kicta... (just a single /mailman3).
Something is adding mailman3/ to URLs. In the above the URL should be https://mm3-lists.kictanet.or.ke/archives/list/kictanet@lists.kictanet.or.ke..., but an extra /mailman3 is added. The others are like https://mm3-lists.kictanet.or.ke/mailman3/lists/ and an extra /mailman3 is added.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Sat, Dec 24, 2022 at 1:51 AM Mark Sapiro <mark@msapiro.net> wrote:
On 12/22/22 22:26, Odhiambo Washington wrote:
On Fri, Dec 23, 2022 at 9:21 AM Odhiambo Washington <odhiambo@gmail.com> wrote:
And now I am having a problem with mod_wsgi. First, the URL displayed when I load the page looks bogus to me. While I expect the URL to be https://mm3-lists.kictanet.or.ke/mailman3/domains/, mod_wsgi give me https://mm3-lists.kictanet.or.ke/mailman3/mailman3/domains/ - there is an extra /mailman3!
See below:
So I have;
https://mm3-lists.kictanet.or.ke/mailman3/mailman3/lists/ - working, or appears to.
https://mm3-lists.kictanet.or.ke/mailman3/mailman3/domains/ - working, or appears to.
https://mm3-lists.kictanet.or.ke/mailman3/mailman3/bans/ - working, or appears to
https://mm3-lists.kictanet.or.ke/mailman3/mailman3/users - working, or appears to
https://mm3-lists.kictanet.or.ke/mailman3/mailman3/lists/kictanet.lists.kict...
- This throws an exception error when I click "Manage Subscription".
messages like these
[Fri Dec 23 09:10:55.393386 2022] [wsgi:error] [pid 74857] [remote 197.232.81.246:14181] File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mailmanclient/restbase/connection.py",
line 160, in call [Fri Dec 23 09:10:55.393390 2022] [wsgi:error] [pid 74857] [remote 197.232.81.246:14181] raise HTTPError(params.get('url'), response.status_code, [Fri Dec 23 09:10:55.393394 2022] [wsgi:error] [pid 74857] [remote 197.232.81.246:14181] urllib.error.HTTPError: HTTP Error 500: {"title": "500 Internal Server Error"}
Indicate an uncaught exception in Mailman core. What's in mailman.log?
A good catch here! mailman.log was mostly having a complaint about a missing config file - /etc/mailman3/mailman-hyperkitty.cfg I then just did a symlink: ln -s /opt/mailman/mm /etc/mailman3, which then made things start working. And I don't like this, so I think I will put all my configs into /opt/mailman/mm/etc/ and link /etc/mailman3 to this path instead. What bite me is probably related to this experience by Turnbull: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/... I am on FreeBSD where user applications should have config files in /usr/local/etc/ and not /etc/ so having /etc/mailman3 and not /usr/local/etc/mailman3 kinda makes me feel weird.
And while I do not quite understand the error itself, there is also one
particular line that I also saw that has left me baffled: [Fri Dec 23 08:53:18.290411 2022] [core:info] [pid 91236] [client 197.232.81.246:13865] AH00128: File does not exist: /usr/local/www/apache24/data/archives/list/ kictanet@lists.kictanet.or.ke/thread/VIHCC6MSXZSNHY7YPEJ3D2US4N7MHJEC/, referer:
https://mm3-lists.kictanet.or.ke/archives/list/kictanet@lists.kictanet.or.ke
This is because something is doing an HTTP GET for
/archives/list/ kictanet@lists.kictanet.or.ke/thread/VIHCC6MSXZSNHY7YPEJ3D2US4N7MHJEC/
<http://kictanet@lists.kictanet.or.ke/thread/VIHCC6MSXZSNHY7YPEJ3D2US4N7MHJEC...> and the URL is not recognized as one handled by mod_wsgi so apache tries to get it from its DocumentRoot.mod_wsgi has to serve a number of URLs. Look in /opt/mailman/mm/urls.py for urlpatterns. You will probably see things like
url(r'^accounts/', include('allauth.urls')), # Django admin url(r'^admin/', admin.site.urls), url(r'^mailman3/', include('postorius.urls')), url(r'^archives/', include('hyperkitty.urls')),
Those are all things that need to be handled by mod_wsgi
In your apache config, you only have a WSGIScriptAlias for /mailman3. Thus paths need to be prefixed with /mailman3 in order to be handled by mod_wsgi. I'm not sure what is doing this prefixing, but without it paths that don't begin with /mailman3 don't work unless you also have things like
WSGIScriptAlias /accounts /opt/mailman/mm/wsgi.py WSGIScriptAlias /admin /opt/mailman/mm/wsgi.py WSGIScriptAlias /archives /opt/mailman/mm/wsgi.py
in your apache config.
These are my files:
- urls.py <CUT > from django.conf.urls import include from django.urls import re_path from django.contrib import admin from django.urls import reverse_lazy from django.views.generic import RedirectView
urlpatterns = [ re_path(r'^$', RedirectView.as_view( url=reverse_lazy('list_index'), permanent=True)), re_path(r'^postorius/', include('postorius.urls')), re_path(r'^hyperkitty/', include('hyperkitty.urls')), re_path(r'', include('django_mailman3.urls')), re_path(r'^accounts/', include('allauth.urls')), # Django admin re_path(r'^admin/', admin.site.urls), re_path(r'^mailman3/', include('postorius.urls')), re_path(r'^archives/', include('hyperkitty.urls')), ] </CUT>
- apache.conf <CUT> ... Alias /static "/opt/mailman/mm/static" <Directory "/opt/mailman/mm/static"> Require all granted </Directory>
WSGIScriptAlias /mailman3 /opt/mailman/mm/wsgi.py
# WSGIScriptAlias /accounts /opt/mailman/mm/wsgi.py # WSGIScriptAlias /admin /opt/mailman/mm/wsgi.py # WSGIScriptAlias /archives /opt/mailman/mm/wsgi.py # WSGIScriptAlias /user-profile /opt/mailman/mm/wsgi.py # WSGIScriptAlias /hyperkitty /opt/mailman/mm/wsgi.py # WSGIScriptAlias /postorius /opt/mailman/mm/wsgi.py WSGIScriptAlias / /opt/mailman/mm/wsgi.py
<Directory "/opt/mailman/mm/">
<Files wsgi.py>
Order deny,allow
Allow from all
Require all granted
</Files>
WSGIProcessGroup mailman-web
</Directory>
<CUT>
I also need to add the fact that at the point where I am clicking "Manage Subscription", the URL has changed to
https://mm3-lists.kictanet.or.ke/mailman3/archives/list/kictanet@lists.kicta...
(just a single /mailman3).
Something is adding mailman3/ to URLs. In the above the URL should be
https://mm3-lists.kictanet.or.ke/archives/list/kictanet@lists.kictanet.or.ke...,
but an extra /mailman3 is added. The others are like https://mm3-lists.kictanet.or.ke/mailman3/lists/ and an extra /mailman3 is added.
I have tested with creating all those commented out aliases and that ended up still giving me /mailman3/mailman3/* which I did not like, although everything appeared to work. I then ended up with only "WSGIScriptAlias / /opt/mailman/mm/wsgi.py" and now when I type https://mm3-lists.kictanet.or.ke I end up at https://mm3-lists.kictanet.or.ke/mailman3/lists/. Of course something has appended "/mailman3" So this has resulted in all URLs having /mailman3/ appended, except for the /archives link.
Now my question is about what could be adding the /mailman3. Is it possible that I installed something out of the ordinary?
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
Odhiambo Washington writes:
And I don't like this, so I think I will put all my configs into /opt/mailman/mm/etc/ and link /etc/mailman3 to this path instead.
Unfortunately by definition it's impossible to make the search path for the configuration file be configurable. Hm ... I think I know how to do this. ;-) Specifically, we could have a "install_defaults.py" file that lives next to bin/mailman or maybe in site-packages/mailman directory. bin/mailman would import specific variables from it, something like
try:
from .install_defaults import CONFIG_SEARCH_PATH, USE_CONF_D
except ModuleNotFoundError:
CONFIG_SEARCH_PATH = ['./mailman.cfg', ...]
USE_CONF_D = False # this variable is probably a bad idea
except ImportError:
log'"your bootstrap.py is missing required variables'")
raise
Important: mailman info
would report its location.
What bite me is probably related to this experience by Turnbull: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/... I am on FreeBSD where user applications should have config files in /usr/local/etc/ and not /etc/ so having /etc/mailman3 and not /usr/local/etc/mailman3 kinda makes me feel weird.
I sympathize. While I have no problem with the /etc/mailman3 approach, I think the *BSD approach of putting locally built configs in /usr/local/etc is equally reasonable. More than either, for third party and locally built software, I'm a fan of the /opt approach (ie, a self-contained tree for $APP, with /opt/$APP/bin, /opt/$APP/usr, /opt/$APP/var, /opt/$APP/etc or similar subdirectories).
FWIW, Mailman 3's search path looks for mailman.cfg in the following places, in this order:
- the value of the -C option # run-time option
- $MAILMAN_CONFIG_FILE # login-time option
- ./mailman.cfg # run-time option
- ./var/etc/mailman.cfg # /opt-like
- $HOME/.mailman.cfg # for developers?
- /etc/mailman.cfg # traditional
- /etc/mailman3/mailman.cfg # distro-friendly (Linux, at least) # good place for conf.d (see issue#424)
- ../../etc/mailman.cfg # /opt-like # (relative to Mailman 3's bin directory)
IMO this list is way too long, and ./var/etc is kind of strange. But the thing about creating the file even though it finds one of the other ones is really annoying.
BTW the config file creation issue was reported about two years ago: https://gitlab.com/mailman/mailman/-/issues/797 and there are a couple of loosed related issues (ie, if we're going to thoroughly review the configuration files):
- Separate config for secrets: https://gitlab.com/mailman/mailman/-/issues/466
- Support conf.d directory: https://gitlab.com/mailman/mailman/-/issues/424
Comments welcome, not really sure what I want to do here.
Steve
On 12/24/22 00:00, Odhiambo Washington wrote:
These are my files:
- urls.py <CUT > from django.conf.urls import include from django.urls import re_path from django.contrib import admin from django.urls import reverse_lazy from django.views.generic import RedirectView
urlpatterns = [ re_path(r'^$', RedirectView.as_view( url=reverse_lazy('list_index'), permanent=True)), re_path(r'^postorius/', include('postorius.urls')), re_path(r'^hyperkitty/', include('hyperkitty.urls')), re_path(r'', include('django_mailman3.urls')), re_path(r'^accounts/', include('allauth.urls')), # Django admin re_path(r'^admin/', admin.site.urls), re_path(r'^mailman3/', include('postorius.urls')), re_path(r'^archives/', include('hyperkitty.urls')), ] </CUT>
You don't need all of those. ^postorius/ and ^mailman3/ are two different ways to access Postorius, and ^hyperkitty/ and ^archives/ are two different ways to access HypereKitty. You only need one of each, but having both is OK.
- apache.conf <CUT> ... Alias /static "/opt/mailman/mm/static" <Directory "/opt/mailman/mm/static"> Require all granted </Directory>
WSGIScriptAlias /mailman3 /opt/mailman/mm/wsgi.py
# WSGIScriptAlias /accounts /opt/mailman/mm/wsgi.py # WSGIScriptAlias /admin /opt/mailman/mm/wsgi.py # WSGIScriptAlias /archives /opt/mailman/mm/wsgi.py # WSGIScriptAlias /user-profile /opt/mailman/mm/wsgi.py # WSGIScriptAlias /hyperkitty /opt/mailman/mm/wsgi.py # WSGIScriptAlias /postorius /opt/mailman/mm/wsgi.py WSGIScriptAlias / /opt/mailman/mm/wsgi.py
This will send every http request to mod_wsgi except for requests to /static. This is OK if there are no other web sites on this server and the only http requests are for Django related things.
...
I have tested with creating all those commented out aliases and that ended up still giving me /mailman3/mailman3/* which I did not like, although everything appeared to work. I then ended up with only "WSGIScriptAlias / /opt/mailman/mm/wsgi.py" and now when I type https://mm3-lists.kictanet.or.ke I end up at https://mm3-lists.kictanet.or.ke/mailman3/lists/. Of course something has appended "/mailman3" So this has resulted in all URLs having /mailman3/ appended, except for the /archives link.
How about https://mm3-lists.kictanet.or.ke/user_profile/ ?
Now my question is about what could be adding the /mailman3. Is it possible that I installed something out of the ordinary?
It's a mod_wsgi thing. I haven't used mod_wsgi for Mailman for some time (I now use gunicorn on all the sites I manage), but when I did I think I had
WSGIScriptAlias /mm3 /opt/mailman/mm/wsgi.py
and all the URLs were like https://example.com/mm3/mailman3/..., https://example.com/mm3/archives/..., etc.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Sat, Dec 24, 2022 at 9:40 PM Mark Sapiro <mark@msapiro.net> wrote:
On 12/24/22 00:00, Odhiambo Washington wrote:
These are my files:
- urls.py <CUT > from django.conf.urls import include from django.urls import re_path from django.contrib import admin from django.urls import reverse_lazy from django.views.generic import RedirectView
urlpatterns = [ re_path(r'^$', RedirectView.as_view( url=reverse_lazy('list_index'), permanent=True)), re_path(r'^postorius/', include('postorius.urls')), re_path(r'^hyperkitty/', include('hyperkitty.urls')), re_path(r'', include('django_mailman3.urls')), re_path(r'^accounts/', include('allauth.urls')), # Django admin re_path(r'^admin/', admin.site.urls), re_path(r'^mailman3/', include('postorius.urls')), re_path(r'^archives/', include('hyperkitty.urls')), ] </CUT>
You don't need all of those. ^postorius/ and ^mailman3/ are two different ways to access Postorius, and ^hyperkitty/ and ^archives/ are two different ways to access HypereKitty. You only need one of each, but having both is OK.
That urls.py was picked from https://wiki.list.org/DOC/Mailman%203%20installation%20experience. Maybe that page needs some edits/revision now?
- apache.conf
<CUT> ... Alias /static "/opt/mailman/mm/static" <Directory "/opt/mailman/mm/static"> Require all granted </Directory> # WSGIScriptAlias /mailman3 /opt/mailman/mm/wsgi.py # WSGIScriptAlias /accounts /opt/mailman/mm/wsgi.py # WSGIScriptAlias /admin /opt/mailman/mm/wsgi.py # WSGIScriptAlias /archives /opt/mailman/mm/wsgi.py # WSGIScriptAlias /user-profile /opt/mailman/mm/wsgi.py # WSGIScriptAlias /hyperkitty /opt/mailman/mm/wsgi.py # WSGIScriptAlias /postorius /opt/mailman/mm/wsgi.py WSGIScriptAlias / /opt/mailman/mm/wsgi.py
This will send every http request to mod_wsgi except for requests to /static. This is OK if there are no other web sites on this server and the only http requests are for Django related things.
This is just a virtual host. There are other websites on the server.
...
I have tested with creating all those commented out aliases and that ended up still giving me /mailman3/mailman3/* which I did not like, although everything appeared to work. I then ended up with only "WSGIScriptAlias / /opt/mailman/mm/wsgi.py" and now when I type https://mm3-lists.kictanet.or.ke I end up at https://mm3-lists.kictanet.or.ke/mailman3/lists/. Of course something has appended "/mailman3" So this has resulted in all URLs having /mailman3/ appended, except for the /archives link.
How about https://mm3-lists.kictanet.or.ke/user_profile/ ?
I have uncommented the line "WSGIScriptAlias /user-profile /opt/mailman/mm/wsgi.py", I don't see any definition for it in urls.py as well. Perhaps that's the issue?
When I uncomment /user-profile, I end up with an ugly URL: https://mm3-lists.kictanet.or.ke/user-profile/user-profile/
So instead of aliasing the /user-profile, I have decided to add another definition to urls.py: re_path(r'^user-profile/', include('allauth.urls')), Which I think gives me a cleaner URL: https://mm3-lists.kictanet.or.ke/user-profile/login/?next=/user-profile/
I also had to alias /accounts, which then brings me to: https://mm3-lists.kictanet.or.ke/accounts/mailman3/lists/ - which I believe is fine because one gets the option to either login or signup.
And I think that "/account" and "/user-profile" are synonymous.
Now my question is about what could be adding the /mailman3. Is it possible
that I installed something out of the ordinary?
It's a mod_wsgi thing. I haven't used mod_wsgi for Mailman for some time (I now use gunicorn on all the sites I manage), but when I did I think I had
WSGIScriptAlias /mm3 /opt/mailman/mm/wsgi.py
and all the URLs were like https://example.com/mm3/mailman3/..., https://example.com/mm3/archives/..., etc.
I already had gunicorn working too, but I just need to also figure out this mod_wsgi. I will stop bothering about the /mailman3 being appended, as long as it serves the required purpose.
Thank you for all the help.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
Odhiambo Washington writes:
- apache.conf
<CUT> ... Alias /static "/opt/mailman/mm/static" <Directory "/opt/mailman/mm/static"> Require all granted </Directory> # WSGIScriptAlias /mailman3 /opt/mailman/mm/wsgi.py # WSGIScriptAlias /accounts /opt/mailman/mm/wsgi.py # WSGIScriptAlias /admin /opt/mailman/mm/wsgi.py # WSGIScriptAlias /archives /opt/mailman/mm/wsgi.py # WSGIScriptAlias /user-profile /opt/mailman/mm/wsgi.py # WSGIScriptAlias /hyperkitty /opt/mailman/mm/wsgi.py # WSGIScriptAlias /postorius /opt/mailman/mm/wsgi.py WSGIScriptAlias / /opt/mailman/mm/wsgi.py
This will send every http request to mod_wsgi except for requests to /static. This is OK if there are no other web sites on this server and the only http requests are for Django related things.
This is just a virtual host. There are other websites on the server.
If the above lines are in the virtual host element, they won't interfere with the other websites. If they are at top level, they will.
On 12/25/22 01:14, Odhiambo Washington wrote:
On Sat, Dec 24, 2022 at 9:40 PM Mark Sapiro <mark@msapiro.net> wrote:
How about https://mm3-lists.kictanet.or.ke/user_profile/ ?
I have uncommented the line "WSGIScriptAlias /user-profile /opt/mailman/mm/wsgi.py", I don't see any definition for it in urls.py as well. Perhaps that's the issue?
It is defined in django_mailman3/urls.py which is referenced by
re_path(r'', include('django_mailman3.urls')),
When I uncomment /user-profile, I end up with an ugly URL: https://mm3-lists.kictanet.or.ke/user-profile/user-profile/
So instead of aliasing the /user-profile, I have decided to add another definition to urls.py: re_path(r'^user-profile/', include('allauth.urls')), Which I think gives me a cleaner URL: https://mm3-lists.kictanet.or.ke/user-profile/login/?next=/user-profile/
It shouldn't include allauth.urls
. That URL is appropriate if you
aren't logged in, but what do you get when you are?
Go to https://lists.mailman3.org/user-profile/ and log in if necessary and you'll see what it should look like.
I also had to alias /accounts, which then brings me to: https://mm3-lists.kictanet.or.ke/accounts/mailman3/lists/ - which I believe is fine because one gets the option to either login or signup.
And I think that "/account" and "/user-profile" are synonymous.
They are in your instance because of
re_path(r'^user-profile/', include('allauth.urls')),
but they should not be.
It's a mod_wsgi thing. I haven't used mod_wsgi for Mailman for some time (I now use gunicorn on all the sites I manage), but when I did I think I had
WSGIScriptAlias /mm3 /opt/mailman/mm/wsgi.py
and all the URLs were like https://example.com/mm3/mailman3/..., https://example.com/mm3/archives/..., etc.
I already had gunicorn working too, but I just need to also figure out this mod_wsgi.
Why? Intellectual curiosity or do you have an actual need.
The bottom line is with mod_wsgi, whatever you have in your WSGIScriptAlias is going to be prepended to the URL path. If you don't want anything prepended, you need
WSGIScriptAlias / /opt/mailman/mm/wsgi.py
but then in order for user-profile to work, you need to replace
re_path(r'', include('django_mailman3.urls')),
in urls.py with the urlpatterns from django_mailman3/urls.py
re_path(r'^user-profile/delete$', delete_account,
name='mm_user_account_delete'),
re_path(r'^user-profile/$', user_profile, name='mm_user_profile'),
and also add
from django_mailman3.views.profile import delete_account, user_profile
to the imports in urls.py
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Sun, Dec 25, 2022 at 9:05 PM Mark Sapiro <mark@msapiro.net> wrote:
On 12/25/22 01:14, Odhiambo Washington wrote:
On Sat, Dec 24, 2022 at 9:40 PM Mark Sapiro <mark@msapiro.net> wrote:
How about https://mm3-lists.kictanet.or.ke/user_profile/ ?
I have uncommented the line "WSGIScriptAlias /user-profile /opt/mailman/mm/wsgi.py", I don't see any definition for it in urls.py as well. Perhaps that's the issue?
It is defined in django_mailman3/urls.py which is referenced by
re_path(r'', include('django_mailman3.urls')),
I have seen that now.
When I uncomment /user-profile, I end up with an ugly URL: https://mm3-lists.kictanet.or.ke/user-profile/user-profile/
So instead of aliasing the /user-profile, I have decided to add another definition to urls.py: re_path(r'^user-profile/', include('allauth.urls')), Which I think gives me a cleaner URL: https://mm3-lists.kictanet.or.ke/user-profile/login/?next=/user-profile/
It shouldn't include
allauth.urls
. That URL is appropriate if you aren't logged in, but what do you get when you are?Go to https://lists.mailman3.org/user-profile/ and log in if necessary and you'll see what it should look like.
Here when I log in. I land on the /archives ( https://lists.mailman3.org/archives/?sort=popular). I then head to the dropdown and click "Account " and I am taken to https://lists.mailman3.org/user-profile/ (very clean URL!) and that's the same thing I am seeing on my server at the moment..
When I comment out the edit I had on /etc/mailman3/urls.py and uncomment to /user-profile alias in the VHOST, I end up with
- https://mm3-lists.kictanet.or.ke/user-profile/mailman3/lists/ - once I am logged in
- https://mm3-lists.kictanet.or.ke/user-profile/user-profile/ - when I click on "Account " # I hope you can see the duplication of /user-profile, which is ugly.
However, your server isn't using mod_wsgi, I believe, so I shouldn't be comparing it to mine. I just don't like the extra URLs being added.
I also had to alias /accounts, which then brings me to:
https://mm3-lists.kictanet.or.ke/accounts/mailman3/lists/ - which I believe is fine because one gets the option to either login or signup.
And I think that "/account" and "/user-profile" are synonymous.
They are in your instance because of
re_path(r'^user-profile/', include('allauth.urls')),
but they should not be.
I have changed that, as already pointed out, but with consequences :) There must be a way to not have "/user-profile/user-profile"
It's a mod_wsgi thing. I haven't used mod_wsgi for Mailman for some time (I now use gunicorn on all the sites I manage), but when I did I think I had
WSGIScriptAlias /mm3 /opt/mailman/mm/wsgi.py
and all the URLs were like https://example.com/mm3/mailman3/..., https://example.com/mm3/archives/..., etc.
I already had gunicorn working too, but I just need to also figure out this mod_wsgi.
Why? Intellectual curiosity or do you have an actual need.
It's out of intellectual curiosity actually.
The bottom line is with mod_wsgi, whatever you have in your
WSGIScriptAlias is going to be prepended to the URL path. If you don't want anything prepended, you need
WSGIScriptAlias / /opt/mailman/mm/wsgi.py
but then in order for user-profile to work, you need to replace
re_path(r'', include('django_mailman3.urls')),
in urls.py with the urlpatterns from django_mailman3/urls.py
re_path(r'^user-profile/delete$', delete_account, name='mm_user_account_delete'), re_path(r'^user-profile/$', user_profile, name='mm_user_profile'),
and also add
from django_mailman3.views.profile import delete_account, user_profile
to the imports in urls.py
And with that, I am now happy with what I am seeing.
Again, thank you very much.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
Mark Sapiro writes:
You don't need all of those. ^postorius/ and ^mailman3/ are two different ways to access Postorius, and ^hyperkitty/ and ^archives/ are two different ways to access HypereKitty. You only need one of each,
That's true from "outside", but there are internal links as well. For example, in Postorius top page, the link to HyperKitty is .../archives. I guess it's a good idea to grep the templates to see which URLS are used.
Now my question is about what could be adding the /mailman3. Is it possible that I installed something out of the ordinary?
Besides mod_wsgi as Mark suggests and the uwsgi configuration, the only thing I can think of is an Apache rewrite rule. It's not in the Postorius and HyperKitty templates.
Steve
On Sun, Dec 25, 2022 at 3:47 PM Stephen J. Turnbull < stephenjturnbull@gmail.com> wrote:
Mark Sapiro writes:
You don't need all of those. ^postorius/ and ^mailman3/ are two different ways to access Postorius, and ^hyperkitty/ and ^archives/ are two different ways to access HypereKitty. You only need one of each,
That's true from "outside", but there are internal links as well. For example, in Postorius top page, the link to HyperKitty is .../archives. I guess it's a good idea to grep the templates to see which URLS are used.
Now my question is about what could be adding the /mailman3. Is it possible that I installed something out of the ordinary?
Besides mod_wsgi as Mark suggests and the uwsgi configuration, the only thing I can think of is an Apache rewrite rule. It's not in the Postorius and HyperKitty templates.
And I do not have any rewrite rules in my VHOST config:
https://pastebin.ubuntu.com/p/9MRMJST9zZ/
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
Odhiambo Washington writes:
Besides mod_wsgi as Mark suggests and the uwsgi configuration, the only thing I can think of is an Apache rewrite rule. It's not in the Postorius and HyperKitty templates.
And I do not have any rewrite rules in my VHOST config:
Is there a mod_wsgi.conf file? I've never seen this "mysterious" insertion of "/mailman3" in URLs. I'm trying to imagine where mod_wsgi would get it from, and just can't think of why that would be in mod_wsgi or its .load or .conf files in the Apache config. The maintainable place for URL configuration is the main apache.conf or a site-specific include file such as sites-available/mailman.conf. I guess it could be in an instance-specific configuration file or stanza of uwsgi to create a namespace.
Steve
On Sun, Dec 25, 2022 at 5:13 PM Stephen J. Turnbull < stephenjturnbull@gmail.com> wrote:
Odhiambo Washington writes:
Besides mod_wsgi as Mark suggests and the uwsgi configuration, the only thing I can think of is an Apache rewrite rule. It's not in the Postorius and HyperKitty templates.
And I do not have any rewrite rules in my VHOST config:
Is there a mod_wsgi.conf file? I've never seen this "mysterious" insertion of "/mailman3" in URLs. I'm trying to imagine where mod_wsgi would get it from, and just can't think of why that would be in mod_wsgi or its .load or .conf files in the Apache config. The maintainable place for URL configuration is the main apache.conf or a site-specific include file such as sites-available/mailman.conf. I guess it could be in an instance-specific configuration file or stanza of uwsgi to create a namespace.
Steve
There is none that is in use anywhere. Only /etc/mailman3/uwsgi.ini
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
Odhiambo Washington writes:
There is none [of mod_wsgi, mod_wsgi.load, mod_wsgi.conf, I guess?] that is in use anywhere. Only /etc/mailman3/uwsgi.ini
OK. I'm happy with gunicorn so far, and uwsgi seems to involve a lot of random pain -- not just from you, it comes up every so often in different ways -- so I'm going to give up for now. Not sure if Mark has any more ideas, but if you have any new discoveries feel free to reopen the discussion.
On Mon, Dec 26, 2022 at 9:16 AM Stephen J. Turnbull < stephenjturnbull@gmail.com> wrote:
Odhiambo Washington writes:
There is none [of mod_wsgi, mod_wsgi.load, mod_wsgi.conf, I guess?] that is in use anywhere. Only /etc/mailman3/uwsgi.ini
OK. I'm happy with gunicorn so far, and uwsgi seems to involve a lot of random pain -- not just from you, it comes up every so often in different ways -- so I'm going to give up for now. Not sure if Mark has any more ideas, but if you have any new discoveries feel free to reopen the discussion.
Mark's ideas have really helped. I now have very clean urls.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
Hello,
I have a working configuration with uwsgi that runs just fine. If interested, I can send you my config.
Cheers, Eggert
Am Montag, 26. Dezember 2022, 07:16:26 CET schrieb Stephen J. Turnbull:
Odhiambo Washington writes:
There is none [of mod_wsgi, mod_wsgi.load, mod_wsgi.conf, I guess?] that is in use anywhere. Only /etc/mailman3/uwsgi.ini
OK. I'm happy with gunicorn so far, and uwsgi seems to involve a lot of random pain -- not just from you, it comes up every so often in different ways -- so I'm going to give up for now. Not sure if Mark has any more ideas, but if you have any new discoveries feel free to reopen the discussion.
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message /QPBTR26T2CLWUYPZD7M7O3ZCBIGWQEUR/
This message sent to eggert@eehmke.de
On Mon, Dec 26, 2022 at 1:38 PM Eggert Ehmke <eggert@eehmke.de> wrote:
Hello,
I have a working configuration with uwsgi that runs just fine. If interested, I can send you my config.
Cheers, Eggert
It would be nice to see the production URL as well as your Apache VHOST config and urls.py files.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
Eggert Ehmke via Mailman-users writes:
I have a working configuration with uwsgi that runs just fine. If interested, I can send you my config.
Yes, I'd be interested to see it and compare it to Mark's suggestions. mod_swgi+uswgi configurations are popular enough that we should have it documented nicely.
Steve
Am Montag, 26. Dezember 2022, 12:39:59 CET schrieb Stephen J. Turnbull:
Eggert Ehmke via Mailman-users writes:
I have a working configuration with uwsgi that runs just fine. If interested, I can send you my config.
Yes, I'd be interested to see it and compare it to Mark's suggestions. mod_swgi+uswgi configurations are popular enough that we should have it documented nicely.
ok I will put together some files and remove private information. Should I put them into some tar.gz and attach them here or on some file server?
Will take me some hours, I am not at home.
Cheers, Eggert
Steve
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message /HHE22DZYGRTQKLBGV3G4SJ7SSQJBUVRR/
This message sent to eggert@eehmke.de
On Mon, Dec 26, 2022 at 2:45 PM Eggert Ehmke <eggert@eehmke.de> wrote:
Am Montag, 26. Dezember 2022, 12:39:59 CET schrieb Stephen J. Turnbull:
Eggert Ehmke via Mailman-users writes:
I have a working configuration with uwsgi that runs just fine. If interested, I can send you my config.
Yes, I'd be interested to see it and compare it to Mark's suggestions. mod_swgi+uswgi configurations are popular enough that we should have it documented nicely.
ok I will put together some files and remove private information. Should I put them into some tar.gz and attach them here or on some file server?
Will take me some hours, I am not at home.
https://pastebin.ubuntu.com/ ??
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
Ok,
I hope this is readable. I just copíed the content of some files into the pastebin, don't know if it is possible to post tar.gz there. https://pastebin.ubuntu.com/p/mmRJJwKDc3/
Just tell me if this works for you, and when something is missing. Most of the settings are copied from some other sites and just adjusted for my needs. Good luck!
Am Montag, 26. Dezember 2022, 14:02:53 CET schrieb Odhiambo Washington:
On Mon, Dec 26, 2022 at 2:45 PM Eggert Ehmke <eggert@eehmke.de> wrote:
Am Montag, 26. Dezember 2022, 12:39:59 CET schrieb Stephen J. Turnbull:
Eggert Ehmke via Mailman-users writes:
I have a working configuration with uwsgi that runs just fine. If interested, I can send you my config.
Yes, I'd be interested to see it and compare it to Mark's suggestions. mod_swgi+uswgi configurations are popular enough that we should have it documented nicely.
ok I will put together some files and remove private information. Should I put them into some tar.gz and attach them here or on some file server?
Will take me some hours, I am not at home.
https://pastebin.ubuntu.com/ ??
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message /A4F73SXA5JSLCSOSBLA25VXOJLUM7V2G/
This message sent to eggert@eehmke.de
On Mon, Dec 26, 2022 at 5:07 PM Eggert Ehmke <eggert@eehmke.de> wrote:
Ok,
I hope this is readable. I just copíed the content of some files into the pastebin, don't know if it is possible to post tar.gz there. https://pastebin.ubuntu.com/p/mmRJJwKDc3/
Just tell me if this works for you, and when something is missing. Most of the settings are copied from some other sites and just adjusted for my needs. Good luck!
So it seems your WSGIDaemonProcess is defined somewhere outside the VHOST, right? Or it wasn't necessary? And what does your urls.py look like?
My setup is PUBLIC for everyone so I will not hide the domain name :-)
In my setup, MM3 is installed in /opt/mailman/mm/. and mod_wsgi is enabled in Apache. I am running uwsgi on a TCP socket, not unix socket.
The whole of my *VHOST:* <CUT> WSGIDaemonProcess mailman-web display-name=mailman-web maximum-requests=1000 umask=0002 user=mailman group=mailman python-path=/opt/mailman/mm:/opt/mailman/mm/venv/lib/python3.9/site-packages:/opt/mailman/mm/venv/lib/python3.9 python-home=/opt/mailman/mm/venv home=/opt/mailman/mm/var WSGIRestrictSignal Off <VirtualHost *:443> ServerName mm3-lists.kictanet.or.ke
SSLEngine on SSLCertificateFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/cert.pem" SSLCertificateKeyFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/privkey.pem" SSLCertificateChainFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/chain.pem" CustomLog /var/log/mm3-lists-access.log combined ErrorLog /var/log/mm3-lists-error.log LogLevel info Alias /favicon.ico /opt/mailman/mm/static/hyperkitty/img/favicon.ico Alias /static "/opt/mailman/mm/static" <Directory "/opt/mailman/mm/static"> Require all granted </Directory> WSGIScriptAlias / /opt/mailman/mm/wsgi.py <Directory "/opt/mailman/mm/"> <Files wsgi.py> Order deny,allow Allow from all Require all granted </Files> WSGIProcessGroup mailman-web </Directory> </VirtualHost> </CUT>
*2. uwsgi.ini:* <CUT> [uwsgi] http-socket = 127.0.0.1:8000 pidfile = /opt/mailman/mm/var/uwsgi.pid chdir = /opt/mailman/mm/ virtualenv = /opt/mailman/mm/venv/ module=mailman_web.wsgi:application env =PYTHONPATH=/opt/mailman/mm/ env =DJANGO_SETTINGS_MODULE=settings master = true process = 2 threads = 2 attach-daemon = /opt/mailman/mm/venv/bin/mailman-web qcluster req-logger = file:/opt/mailman/mm/var/logs/uwsgi.log logger = qcluster file:/opt/mailman/mm/var/logs/uwsgi-qcluster.log log-route = qcluster uwsgi-daemons logger = cron file://opt/mailman/mm/var/logs/uwsgi-cron.log log-route = cron uwsgi-cron logger = file:/opt/mailman/mm/var/logs/uwsgi-error.log uid = mailman gid = mailman </CUT>
*3. uwsgi - *Running supervised (supervisord): <CUT> [program:uwsgi] directory=/opt/mailman/mm/ environment=PYTHONPATH=/opt/mailman/mm/ command=/usr/bin/su -m mailman -c '/opt/mailman/mm/venv/bin/uwsgi --ini /opt/mailman/mm/uwsgi.ini' 2>&1 | logger -t uwsgi autostart=true autorestart=true user=mailman group=mailman stopasgroup=true killasgroup=true </CUT>
*4. urls.py*: <CUT> from django.conf.urls import include from django.urls import re_path from django.contrib import admin from django.urls import reverse_lazy from django.views.generic import RedirectView from django_mailman3.views.profile import delete_account, user_profile urlpatterns = [ re_path(r'^$', RedirectView.as_view( url=reverse_lazy('list_index'), permanent=True)), re_path(r'^postorius/', include('postorius.urls')), re_path(r'^hyperkitty/', include('hyperkitty.urls')), re_path(r'^user-profile/delete$', delete_account, name='mm_user_account_delete'), re_path(r'^user-profile/$', user_profile, name='mm_user_profile'), re_path(r'^accounts/', include('allauth.urls')), re_path(r'^admin/', admin.site.urls), re_path(r'^mm/', include('postorius.urls')), re_path(r'^archives/', include('hyperkitty.urls')), ] </CUT>
And that's pretty much what I am using on my FreeBSD server.
PS: Possible to bottom-post instead of top-posting? :)
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
Am Montag, 26. Dezember 2022, 16:08:42 CET schrieb Odhiambo Washington:
On Mon, Dec 26, 2022 at 5:07 PM Eggert Ehmke <eggert@eehmke.de> wrote:
Ok,
I hope this is readable. I just copíed the content of some files into the pastebin, don't know if it is possible to post tar.gz there. https://pastebin.ubuntu.com/p/mmRJJwKDc3/
Just tell me if this works for you, and when something is missing. Most of the settings are copied from some other sites and just adjusted for my needs. Good luck!
So it seems your WSGIDaemonProcess is defined somewhere outside the VHOST, right? Or it wasn't necessary?
I have no settings for WSGIDaemon whatsoever. It's all handled by the uwsgi inside the venv.
And what does your urls.py look like?
Which of the various urls.py files do you need?
My setup is PUBLIC for everyone so I will not hide the domain name :-)
In my setup, MM3 is installed in /opt/mailman/mm/. and mod_wsgi is enabled in Apache. I am running uwsgi on a TCP socket, not unix socket.
The whole of my *VHOST:* <CUT> WSGIDaemonProcess mailman-web display-name=mailman-web maximum-requests=1000 umask=0002 user=mailman group=mailman python-path=/opt/mailman/mm:/opt/mailman/mm/venv/lib/python3.9/site-packages :/opt/mailman/mm/venv/lib/python3.9 python-home=/opt/mailman/mm/venv home=/opt/mailman/mm/var WSGIRestrictSignal Off <VirtualHost *:443> ServerName mm3-lists.kictanet.or.ke
SSLEngine on SSLCertificateFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/cert.pem" SSLCertificateKeyFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/privkey.pem" SSLCertificateChainFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/chain.pem" CustomLog /var/log/mm3-lists-access.log combined ErrorLog /var/log/mm3-lists-error.log LogLevel info Alias /favicon.ico /opt/mailman/mm/static/hyperkitty/img/favicon.ico Alias /static "/opt/mailman/mm/static" <Directory "/opt/mailman/mm/static"> Require all granted </Directory> WSGIScriptAlias / /opt/mailman/mm/wsgi.py <Directory "/opt/mailman/mm/"> <Files wsgi.py> Order deny,allow Allow from all Require all granted </Files> WSGIProcessGroup mailman-web </Directory> </VirtualHost> </CUT>
*2. uwsgi.ini:* <CUT> [uwsgi] http-socket = 127.0.0.1:8000 pidfile = /opt/mailman/mm/var/uwsgi.pid chdir = /opt/mailman/mm/ virtualenv = /opt/mailman/mm/venv/ module=mailman_web.wsgi:application env =PYTHONPATH=/opt/mailman/mm/ env =DJANGO_SETTINGS_MODULE=settings master = true process = 2 threads = 2 attach-daemon = /opt/mailman/mm/venv/bin/mailman-web qcluster req-logger = file:/opt/mailman/mm/var/logs/uwsgi.log logger = qcluster file:/opt/mailman/mm/var/logs/uwsgi-qcluster.log log-route = qcluster uwsgi-daemons logger = cron file://opt/mailman/mm/var/logs/uwsgi-cron.log log-route = cron uwsgi-cron logger = file:/opt/mailman/mm/var/logs/uwsgi-error.log uid = mailman gid = mailman </CUT>
*3. uwsgi - *Running supervised (supervisord): <CUT> [program:uwsgi] directory=/opt/mailman/mm/ environment=PYTHONPATH=/opt/mailman/mm/ command=/usr/bin/su -m mailman -c '/opt/mailman/mm/venv/bin/uwsgi --ini /opt/mailman/mm/uwsgi.ini' 2>&1 | logger -t uwsgi autostart=true autorestart=true user=mailman group=mailman stopasgroup=true killasgroup=true </CUT>
*4. urls.py*: <CUT> from django.conf.urls import include from django.urls import re_path from django.contrib import admin from django.urls import reverse_lazy from django.views.generic import RedirectView from django_mailman3.views.profile import delete_account, user_profile urlpatterns = [ re_path(r'^$', RedirectView.as_view( url=reverse_lazy('list_index'), permanent=True)), re_path(r'^postorius/', include('postorius.urls')), re_path(r'^hyperkitty/', include('hyperkitty.urls')), re_path(r'^user-profile/delete$', delete_account, name='mm_user_account_delete'), re_path(r'^user-profile/$', user_profile, name='mm_user_profile'), re_path(r'^accounts/', include('allauth.urls')), re_path(r'^admin/', admin.site.urls), re_path(r'^mm/', include('postorius.urls')), re_path(r'^archives/', include('hyperkitty.urls')), ] </CUT>
And that's pretty much what I am using on my FreeBSD server.
PS: Possible to bottom-post instead of top-posting? :)
El 26/12/22 a las 16:08, Odhiambo Washington escribió:
On Mon, Dec 26, 2022 at 5:07 PM Eggert Ehmke<eggert@eehmke.de> wrote:
Odhiambo, I didn't change anything from my config as I wrote down in https://forums.FreeBSD.org/threads/mailman-3.61050/post-488128, save the python version (I upgraded to 3.9 moths ago, as I posted in this list).
My urls.py looks like this:
################### from django.conf import settings ### mod. 30/10/22 ###from django.conf.urls import include, url from django.conf.urls import include from django.urls import re_path as url #####
from django.contrib import admin from django.urls import reverse_lazy from django.views.generic import RedirectView
urlpatterns = [ url(r'^$', RedirectView.as_view( url=reverse_lazy('list_index'), permanent=True)), url(r'^postorius/', include('postorius.urls')), url(r'^hyperkitty/', include('hyperkitty.urls')), url(r'', include('django_mailman3.urls')), url(r'^accounts/', include('allauth.urls')), # Django admin url(r'^admin/', admin.site.urls), url(r'^mailman3/', include('postorius.urls')), url(r'^archives/', include('hyperkitty.urls')), ]
Ok,
I hope this is readable. I just copíed the content of some files into the pastebin, don't know if it is possible to post tar.gz there. https://pastebin.ubuntu.com/p/mmRJJwKDc3/
Just tell me if this works for you, and when something is missing. Most of the settings are copied from some other sites and just adjusted for my needs. Good luck!
So it seems your WSGIDaemonProcess is defined somewhere outside the VHOST, right? Or it wasn't necessary? And what does your urls.py look like?
My setup is PUBLIC for everyone so I will not hide the domain name :-)
In my setup, MM3 is installed in /opt/mailman/mm/. and mod_wsgi is enabled in Apache. I am running uwsgi on a TCP socket, not unix socket.
The whole of my *VHOST:* <CUT> WSGIDaemonProcess mailman-web display-name=mailman-web maximum-requests=1000 umask=0002 user=mailman group=mailman python-path=/opt/mailman/mm:/opt/mailman/mm/venv/lib/python3.9/site-packages:/opt/mailman/mm/venv/lib/python3.9 python-home=/opt/mailman/mm/venv home=/opt/mailman/mm/var WSGIRestrictSignal Off <VirtualHost *:443> ServerName mm3-lists.kictanet.or.ke
SSLEngine on SSLCertificateFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/cert.pem" SSLCertificateKeyFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/privkey.pem" SSLCertificateChainFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/chain.pem" CustomLog /var/log/mm3-lists-access.log combined ErrorLog /var/log/mm3-lists-error.log LogLevel info Alias /favicon.ico /opt/mailman/mm/static/hyperkitty/img/favicon.ico Alias /static "/opt/mailman/mm/static" <Directory "/opt/mailman/mm/static"> Require all granted </Directory> WSGIScriptAlias / /opt/mailman/mm/wsgi.py <Directory "/opt/mailman/mm/"> <Files wsgi.py> Order deny,allow Allow from all Require all granted </Files> WSGIProcessGroup mailman-web </Directory> </VirtualHost> </CUT>
*2. uwsgi.ini:* <CUT> [uwsgi] http-socket = 127.0.0.1:8000 pidfile = /opt/mailman/mm/var/uwsgi.pid chdir = /opt/mailman/mm/ virtualenv = /opt/mailman/mm/venv/ module=mailman_web.wsgi:application env =PYTHONPATH=/opt/mailman/mm/ env =DJANGO_SETTINGS_MODULE=settings master = true process = 2 threads = 2 attach-daemon = /opt/mailman/mm/venv/bin/mailman-web qcluster req-logger =file:/opt/mailman/mm/var/logs/uwsgi.log logger = qclusterfile:/opt/mailman/mm/var/logs/uwsgi-qcluster.log log-route = qcluster uwsgi-daemons logger = cronfile://opt/mailman/mm/var/logs/uwsgi-cron.log log-route = cron uwsgi-cron logger =file:/opt/mailman/mm/var/logs/uwsgi-error.log uid = mailman gid = mailman </CUT>
*3. uwsgi - *Running supervised (supervisord): <CUT> [program:uwsgi] directory=/opt/mailman/mm/ environment=PYTHONPATH=/opt/mailman/mm/ command=/usr/bin/su -m mailman -c '/opt/mailman/mm/venv/bin/uwsgi --ini /opt/mailman/mm/uwsgi.ini' 2>&1 | logger -t uwsgi autostart=true autorestart=true user=mailman group=mailman stopasgroup=true killasgroup=true </CUT>
*4. urls.py*: <CUT> from django.conf.urls import include from django.urls import re_path from django.contrib import admin from django.urls import reverse_lazy from django.views.generic import RedirectView from django_mailman3.views.profile import delete_account, user_profile urlpatterns = [ re_path(r'^$', RedirectView.as_view( url=reverse_lazy('list_index'), permanent=True)), re_path(r'^postorius/', include('postorius.urls')), re_path(r'^hyperkitty/', include('hyperkitty.urls')), re_path(r'^user-profile/delete$', delete_account, name='mm_user_account_delete'), re_path(r'^user-profile/$', user_profile, name='mm_user_profile'), re_path(r'^accounts/', include('allauth.urls')), re_path(r'^admin/', admin.site.urls), re_path(r'^mm/', include('postorius.urls')), re_path(r'^archives/', include('hyperkitty.urls')), ] </CUT>
And that's pretty much what I am using on my FreeBSD server.
PS: Possible to bottom-post instead of top-posting? :)
--
Mailman's content filtering has removed the following MIME parts from this message.
Content-Type: image/png Name: firma-GHP-emails.png
Replaced multipart/alternative part with first alternative.
On Mon, Dec 26, 2022 at 6:35 PM Guillermo Hernandez (Oldno7) via Mailman-users <mailman-users@mailman3.org> wrote:
El 26/12/22 a las 16:08, Odhiambo Washington escribió:
On Mon, Dec 26, 2022 at 5:07 PM Eggert Ehmke<eggert@eehmke.de> wrote:
Odhiambo, I didn't change anything from my config as I wrote down in https://forums.FreeBSD.org/threads/mailman-3.61050/post-488128, save the python version (I upgraded to 3.9 moths ago, as I posted in this list).
My urls.py looks like this:
################### from django.conf import settings ### mod. 30/10/22 ###from django.conf.urls import include, url from django.conf.urls import include from django.urls import re_path as url #####
from django.contrib import admin from django.urls import reverse_lazy from django.views.generic import RedirectView
urlpatterns = [ url(r'^$', RedirectView.as_view( url=reverse_lazy('list_index'), permanent=True)), url(r'^postorius/', include('postorius.urls')), url(r'^hyperkitty/', include('hyperkitty.urls')), url(r'', include('django_mailman3.urls')), url(r'^accounts/', include('allauth.urls')), # Django admin url(r'^admin/', admin.site.urls), url(r'^mailman3/', include('postorius.urls')), url(r'^archives/', include('hyperkitty.urls')), ]
Hi @Guillermo Hernandez (Oldno7) <guillermo@querysoft.es>
Does your https://site.name/user-profile/ work?
PS: I deviated from installing things on the base system and went the virtualenv way for a production server. I believe it's a lot easier to maintain as compared to having everything using FreeBSD ports/packages. Oh, and virtualenv is well-supported. Remember FreeBSD as on OS is not even supported, which has led to most FreeBSD admins staying with MM2 or going the way of Sympa and whatever else:)
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
On 12/26/22 07:42, Odhiambo Washington wrote:
Hi @Guillermo Hernandez (Oldno7) <guillermo@querysoft.es>
Does your https://site.name/user-profile/ work?
Again, Guillermo is using uWSGI, not Apache mod_wsgi
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
El 26/12/22 a las 19:19, Mark Sapiro escribió:
On 12/26/22 07:42, Odhiambo Washington wrote:
Hi @Guillermo Hernandez (Oldno7) <guillermo@querysoft.es>
Does your https://site.name/user-profile/ work?
Again, Guillermo is using uWSGI, not Apache mod_wsgi
Well... now I am not sure, you know I've been confused before about that.
In my httpd.conf I have:
##############
LoadModule wsgi_module "/usr/local/lib/python3.9/site-packages/mod_wsgi/server/mod_wsgi-py39.cpython-39.so" WSGIPythonHome "/usr/local" WSGIDaemonProcess hyperkitty threads=25 python-path=/usr/local/mailman3 user=mailman3 group=mailman WSGIProcessGroup hyperkitty ###############
And in then end of my vhost definition file there is this line:
Include "/usr/local/mailman3/apache24.uwsgi.conf"
In that file I have:
######### begin of 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> #### esto va en el httpd.conf ##WSGIDaemonProcess hyperkitty threads=25 python-path=/usr/local/mailman3 user=mailman group=mailman ## esta es la de Sapiro #WSGIDaemonProcess mailman-web display-name=mailman-web maximum-requests=1000 umask=0002 ####user=mailman group=mailman ####python-path=/opt/mailman/mm/venv/lib/python3.6/site-packages:/opt/mailman/mm/venv/lib/python3.6 ####python-home=/opt/mailman/mm/venv home=/opt/mailman/mm/var
#### agregado el 08/07/22 WSGIPassAuthorization On ####
WSGIScriptAlias /mailman3 /usr/local/mailman3/wsgi.py process-group=hyperkitty WSGIScriptAlias /hyperkitty /usr/local/mailman3/wsgi.py process-group=hyperkitty WSGIScriptAlias /postorius /usr/local/mailman3/wsgi.py process-group=hyperkitty WSGIScriptAlias /archives /usr/local/mailman3/wsgi.py process-group=hyperkitty <Directory "/usr/local/mailman3"> <Files wsgi.py> Require all granted </Files> WSGIProcessGroup hyperkitty
</Directory> ####################### end of apache24.uwsgi.conf
And the related wsgi.py is as follows:
""" WSGI config for HyperKitty project.
It exposes the WSGI callable as a module-level variable named
application
.
For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/wsgi/ """
import os from django.core.wsgi import get_wsgi_application
#### os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") ##os.environ["DJANGO_SETTINGS_MODULE"] = "{{ project_name }}.settings"
application = get_wsgi_application() ################
I don't want to put more noise in the list. But I'm confused because I always updated via pip the apache mod_wsgi thinking is was needed for my configuration. If it is not, I will stop updating it.
--
Mailman's content filtering has removed the following MIME parts from this message.
Content-Type: image/png Name: firma-GHP-emails.png
Replaced multipart/alternative part with first alternative.
On 12/26/22 11:08, Guillermo Hernandez (Oldno7) via Mailman-users wrote:
El 26/12/22 a las 19:19, Mark Sapiro escribió:
On 12/26/22 07:42, Odhiambo Washington wrote:
Hi @Guillermo Hernandez (Oldno7) <guillermo@querysoft.es>
Does your https://site.name/user-profile/ work?
Again, Guillermo is using uWSGI, not Apache mod_wsgi
Well... now I am not sure, you know I've been confused before about that.
I was looking at what you posted at https://forums.freebsd.org/threads/mailman-3.61050/#post-488128. I focused on the part beginning with
- initiated the uwsgi with a /usr/local/bin/uwsgi --ini /usr/local/mailman3/uwsgi.ini &
Which is running uwsgi. However I overlooked the mod_wsgi stuff.
In my httpd.conf I have:
##############
LoadModule wsgi_module "/usr/local/lib/python3.9/site-packages/mod_wsgi/server/mod_wsgi-py39.cpython-39.so" WSGIPythonHome "/usr/local" WSGIDaemonProcess hyperkitty threads=25 python-path=/usr/local/mailman3 user=mailman3 group=mailman WSGIProcessGroup hyperkitty ###############
This is all mod_wsgi.
And in then end of my vhost definition file there is this line:
Include "/usr/local/mailman3/apache24.uwsgi.conf"
In that file I have:
######### begin of 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 #####
All the above between #########
and #####
is redundant as you
already have
Alias /static /usr/local/mailman3/static
which will alias any /static/xxx to /usr/local/mailman3/static/xxx
###ErrorLog /var/log/httpd/hyperkitty_error.log ###CustomLog /var/log/httpd/hyperkitty_access.log combined
<Directory "/usr/local/mailman3/static"> Require all granted </Directory> #### esto va en el httpd.conf ##WSGIDaemonProcess hyperkitty threads=25 python-path=/usr/local/mailman3 user=mailman group=mailman ## esta es la de Sapiro #WSGIDaemonProcess mailman-web display-name=mailman-web maximum-requests=1000 umask=0002 ####user=mailman group=mailman ####python-path=/opt/mailman/mm/venv/lib/python3.6/site-packages:/opt/mailman/mm/venv/lib/python3.6 ####python-home=/opt/mailman/mm/venv home=/opt/mailman/mm/var
#### agregado el 08/07/22 WSGIPassAuthorization On ####
WSGIScriptAlias /mailman3 /usr/local/mailman3/wsgi.py process-group=hyperkitty WSGIScriptAlias /hyperkitty /usr/local/mailman3/wsgi.py process-group=hyperkitty WSGIScriptAlias /postorius /usr/local/mailman3/wsgi.py process-group=hyperkitty WSGIScriptAlias /archives /usr/local/mailman3/wsgi.py process-group=hyperkitty
And this is also mod_wsgi.
...
I don't want to put more noise in the list. But I'm confused because I always updated via pip the apache mod_wsgi thinking is was needed for my configuration. If it is not, I will stop updating it.
Based on the above you ARE using Apache mod_wsgi and if you are still also running uwsgi as
/usr/local/bin/uwsgi --ini /usr/local/mailman3/uwsgi.ini &
that is unnecessary.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
El 26/12/22 a las 23:57, Mark Sapiro escribió:
...
I don't want to put more noise in the list. But I'm confused because I always updated via pip the apache mod_wsgi thinking is was needed for my configuration. If it is not, I will stop updating it.
Based on the above you ARE using Apache mod_wsgi and if you are still also running uwsgi as
/usr/local/bin/uwsgi --ini /usr/local/mailman3/uwsgi.ini &
that is unnecessary.
It clarifies a pair of things. Thanks a lot.
I'll try deactivating that in one of my servers (the "quieter" one) and see how it goes.
Again, thanks for your kind support.
--
Mailman's content filtering has removed the following MIME parts from this message.
Content-Type: image/png Name: firma-GHP-emails.png
Replaced multipart/alternative part with first alternative.
I top post just for confirming that all your recommendations worked well and I am aplying them in the rest of servers
Thanks a lot and all of you have a happy new year.
El 27/12/22 a las 9:23, Guillermo Hernandez (Oldno7) via Mailman-users escribió:
El 26/12/22 a las 23:57, Mark Sapiro escribió:
...
I don't want to put more noise in the list. But I'm confused because I always updated via pip the apache mod_wsgi thinking is was needed for my configuration. If it is not, I will stop updating it.
Based on the above you ARE using Apache mod_wsgi and if you are still also running uwsgi as
/usr/local/bin/uwsgi --ini /usr/local/mailman3/uwsgi.ini &
that is unnecessary.
It clarifies a pair of things. Thanks a lot.
I'll try deactivating that in one of my servers (the "quieter" one) and see how it goes.
Again, thanks for your kind support.
--
Mailman's content filtering has removed the following MIME parts from this message.
Content-Type: image/png Name: firma-GHP-emails.png
Replaced multipart/alternative part with first alternative.
On Tue, Dec 27, 2022 at 11:23 AM Guillermo Hernandez (Oldno7) via Mailman-users <mailman-users@mailman3.org> wrote:
El 26/12/22 a las 23:57, Mark Sapiro escribió:
...
I don't want to put more noise in the list. But I'm confused because I always updated via pip the apache mod_wsgi thinking is was needed for my configuration. If it is not, I will stop updating it.
Based on the above you ARE using Apache mod_wsgi and if you are still also running uwsgi as
/usr/local/bin/uwsgi --ini /usr/local/mailman3/uwsgi.ini &
that is unnecessary.
It clarifies a pair of things. Thanks a lot.
I'll try deactivating that in one of my servers (the "quieter" one) and see how it goes.
Again, thanks for your kind support.
I have actually deactivated mine, and life is still good with my MM3.
And just so that my mind is in the clear, there are three ways of getting the full MM3 functionality, viz:
- Mailman core, Django's cluster, and Gunicorn
- Mailman core, Django's cluster, and uWSGI
- Mailman core, Django's cluster, and mod_wsgi
And something that has not been quite clear to me: What is the purpose of Django's cluster in all this? I am asking because on my FreeBSD server, I usually see not less than 30 PIDs for:
/opt/mailman/mm/venv/bin/python3 /opt/mailman/mm/venv/bin/django-admin qcluster --pythonpath /opt/mailman/mm/ --settings settings (python3.9)
And there is a time I found it having 240 PIDs. Would there be a problem if I limit the number of workers to "8"?
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
On 12/27/22 01:23, Odhiambo Washington wrote:
I have actually deactivated mine, and life is still good with my MM3.
And just so that my mind is in the clear, there are three ways of getting the full MM3 functionality, viz:
- Mailman core, Django's cluster, and Gunicorn
- Mailman core, Django's cluster, and uWSGI
- Mailman core, Django's cluster, and mod_wsgi
Yes, and possibly there are other WSGI interfaces, but offhand I don't know.
And something that has not been quite clear to me: What is the purpose of Django's cluster in all this?
django_q <https://django-q.readthedocs.io/en/latest/> is an app for Django that can process tasks asynchronously in the background so they don't block the foreground. qcluster manages those tasks.
I am asking because on my FreeBSD server, I usually see not less than 30 PIDs for:
/opt/mailman/mm/venv/bin/python3 /opt/mailman/mm/venv/bin/django-admin qcluster --pythonpath /opt/mailman/mm/ --settings settings (python3.9)
And there is a time I found it having 240 PIDs. Would there be a problem if I limit the number of workers to "8"? Some of those may be orphaned. On servers I manage, I regularly stop all mailman3 services to install updates and on one of these servers (only mail.python.org) where there are resource issues, when the services are stopped, there are still orphaned qcluster processes. I have this
#! /bin/bash
if status qcluster | grep -q 'running' ; then
echo qcluster is running
exit
fi
ps -fwwu mailman|grep '[a]dmin qcluster'|awk '{print $2}'|xargs kill
to get rid of the orphans
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Tue, Dec 27, 2022 at 1:58 AM Mark Sapiro <mark@msapiro.net> wrote:
On 12/26/22 11:08, Guillermo Hernandez (Oldno7) via Mailman-users wrote:
El 26/12/22 a las 19:19, Mark Sapiro escribió:
On 12/26/22 07:42, Odhiambo Washington wrote:
Hi @Guillermo Hernandez (Oldno7) <guillermo@querysoft.es>
Does your https://site.name/user-profile/ work?
Again, Guillermo is using uWSGI, not Apache mod_wsgi
Well... now I am not sure, you know I've been confused before about that.
I was looking at what you posted at https://forums.freebsd.org/threads/mailman-3.61050/#post-488128. I focused on the part beginning with
- initiated the uwsgi with a /usr/local/bin/uwsgi --ini /usr/local/mailman3/uwsgi.ini &
[snip]
Based on the above you ARE using Apache mod_wsgi and if you are still
also running uwsgi as
/usr/local/bin/uwsgi --ini /usr/local/mailman3/uwsgi.ini &
that is unnecessary.
Aha. This is interesting. I have been running the same, although via supervisord, thinking that it is necessary. So, this was a confusion! And it looks pretty easy to confuse mod_wsgi with uwsgi when dealing with the ever-evolving monster that most of us have been facing in MM3 over the years :-)
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
On 12/26/22 07:08, Odhiambo Washington wrote:
So it seems your WSGIDaemonProcess is defined somewhere outside the VHOST, right? Or it wasn't necessary? And what does your urls.py look like?
Eggert's configuration is for uWSGI. This is completely different from Apache mod_wsgi.
Background:
Python PEP 333 defines the Python Web Server Gateway Interface (WSGI) which is a protocol for communication between web servers and applications. Django is one such WSGI application.
Basic web servers typically do not support WSGI directly but need some kind of intermediary. Apache mod_wsgi is an Apache module that extends Apache to communicate with WSGI applications.
Both uWSGI and gunicorn are separate applications that can receive http requests via proxy from a web server and communicate them to a WSGI application and receive responses from the application and return them to the web server.
Thus Apache mod_wsgi, uWSGI ang gunicorn are three separate ways of providing the connection between the web server and Django (or other WSGI applications), each with their own separate configuration requirements.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Eggert Ehmke via Mailman-users writes:
I hope this is readable. I just copíed the content of some files into the pastebin, don't know if it is possible to post tar.gz there. https://pastebin.ubuntu.com/p/mmRJJwKDc3/
Thanks! Any lack of readability is due to the upstream config languages. :-)
The uwsgi-proxy stuff is interesting, I didn't know it existed.
Mark has filled in all the missing detail I need downthread, but for future reference, we're more interested in which modules are loaded than in what you've installed. That would either be in the main apache.conf (in some distros called "httpd.conf"), or in a /etc/apache2/mods-enabled directory full of files named mod_x.load and occasionally mod_x.conf. (I mention this because you wrote "not sure this is needed".)
Steve
participants (5)
-
Eggert Ehmke
-
Guillermo Hernandez (Oldno7)
-
Mark Sapiro
-
Odhiambo Washington
-
Stephen J. Turnbull