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