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 '^$|^.*#' ¯\_(ツ)_/¯ :-)