Installed from Howto_Install_Mailman3_On_Debian10, web not quite working
Hi,
today I installed MM3 with Nginx on Debian 11 following the document with a bit of "Mailman 3 installation experience" thrown in (many thanks to the authors!) with some minor changes, i.e. no encryption, and "re_path" instead of "url".
I cannot get the web interface to run. "admin" is OK, but Postorius und Hyperkitty refuse to show up with
Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/mailman3/lists/
Using the URLconf defined in urls, Django tried these URL patterns, in this order:
^$ ^postorius/ ^hyperkitty/ ^user-profile/delete$ [name='mm_user_account_delete'] ^user-profile/$ [name='mm_user_profile'] ^accounts/ ^admin/
The current path, mailman3/lists/, didn’t match any of these.
You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
The error logs are all OK, the GET requests are logged without any error.
My urls.py:
(venv) mailman@me:/opt/mailman/mm$ grep -v "^#" urls.py from django.contrib import admin from django.urls import include, reverse_lazy, re_path 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), ]
It must be something either really complex or, most likely, rather stupid. I switched from PC Assembler and C to Unix shell scripts some three decades ago, so I must admit that my Python skills are zero, my idea of the inner workings of all the packages is very vague.
Any hints where I may look for installation errors?
TIA Volkmar
On 5/6/23 16:02, volkmar@grote-family.com wrote:
My urls.py:
(venv) mailman@me:/opt/mailman/mm$ grep -v "^#" urls.py from django.contrib import admin from django.urls import include, reverse_lazy, re_path 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), ]
We and the various docs are inconsistent about 'postorius' vs 'mailman3' and 'hyperkitty' vs 'archives' in urls. Add these
re_path(r'^mailman3/', include('postorius.urls')),
re_path(r'^archives/', include('hyperkitty.urls')),
to your urlpatterns list in urls.py to cover both variants.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi Mark,
On 07.05.23 01:31, Mark Sapiro wrote:
On 5/6/23 16:02, volkmar@grote-family.com wrote:
My urls.py:
(venv) mailman@me:/opt/mailman/mm$ grep -v "^#" urls.py from django.contrib import admin from django.urls import include, reverse_lazy, re_path 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), ]
We and the various docs are inconsistent about 'postorius' vs 'mailman3' and 'hyperkitty' vs 'archives' in urls. Add these
re_path(r'^mailman3/', include('postorius.urls')), re_path(r'^archives/', include('hyperkitty.urls')),
to your urlpatterns list in urls.py to cover both variants.
thanks for the quick reply. I am one step closer to a solution, "http://127.0.0.1:8000/postorius/lists/?all-lists#" seems to work now. I get the functionality, but it looks ugly w/o any graphics, for which I get yet another, slightly similar, error message:
Page not found (404)
Request Method: GET Request URL: http://127.0.0.1:8000/static/postorius/img/mailman_logo_small_trans.png
Using the URLconf defined in |urls|, Django tried these URL patterns, in this order:
- ^$
- ^mailman3/
- ^archives/
- ^postorius/
- ^hyperkitty/
- ^user-profile/delete$ [name='mm_user_account_delete']
- ^user-profile/$ [name='mm_user_profile']
- ^accounts/
- ^admin/
The current path, |static/postorius/img/mailman_logo_small_trans.png|, didn’t match any of these.
The file exists, world readable:
mailman@me:/opt/mailman/mm$ find . -name mailman_logo_small_trans.png -ls 124610 2 -rw-r--r-- 1 mailman mailman 1163 May 6 12:18 ./venv/lib/python3.9/site-packages/postorius/static/postorius/img/mailman_logo_small_trans.png 125831 2 -rw-r--r-- 1 mailman mailman 1163 May 6 12:19 ./static/postorius/img/mailman_logo_small_trans.png
Q&D MM3 configuration check:
mailman@me:/opt/mailman/mm$ grep -i static *cfg *py|grep -v "#" settings_local.py: 'django.contrib.staticfiles', settings.py: 'django.contrib.staticfiles', settings.py: 'django.template.context_processors.static', settings.py:STATIC_ROOT = os.path.join(BASE_DIR, 'static') settings.py:STATIC_URL = '/static/' settings.py:STATICFILES_DIRS = ( settings.py:STATICFILES_FINDERS = ( settings.py: 'django.contrib.staticfiles.finders.FileSystemFinder', settings.py: 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
Nginx, /etc/nginx/conf.d/me.domain.de.conf
server { listen 80; listen [::]:80;
server_name me.domain.de; ... location /static/ { alias /opt/mailman/mm/static/; }
Again, many thanks in advance for any clue Volkmar
On 5/7/23 10:51, Volkmar Grote wrote:
thanks for the quick reply. I am one step closer to a solution, "http://127.0.0.1:8000/postorius/lists/?all-lists#" seems to work now. I get the functionality, but it looks ugly w/o any graphics, for which I get yet another, slightly similar, error message:
Page not found (404)
Request Method: GET Request URL: http://127.0.0.1:8000/static/postorius/img/mailman_logo_small_trans.png
...
Nginx, /etc/nginx/conf.d/me.domain.de.conf
server { listen 80; listen [::]:80;
server_name me.domain.de; ... location /static/ { alias /opt/mailman/mm/static/; }
Again, many thanks in advance for any clue
The above in nginx is correct, but you aren't getting the static files via nginx. You need to go to a URL like http://me.domain.de/postorius/lists/. Going to http://127.0.0.1:8000/postorius/lists/ goes directly to your wsgi server and doesn't involve nginx at all. You need to go to port 80 where nginx is listening and nginx then proxys requests to 127.0.0.1:8000. Do you also have
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
in /etc/nginx/conf.d/me.domain.de.conf. You need that.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 07.05.23 23:13, Mark Sapiro wrote:
On 5/7/23 10:51, Volkmar Grote wrote:
thanks for the quick reply. I am one step closer to a solution, "http://127.0.0.1:8000/postorius/lists/?all-lists#" seems to work now. I get the functionality, but it looks ugly w/o any graphics, for which I get yet another, slightly similar, error message:
Page not found (404)
Request Method: GET Request URL: http://127.0.0.1:8000/static/postorius/img/mailman_logo_small_trans.png
...
Nginx, /etc/nginx/conf.d/me.domain.de.conf
server { listen 80; listen [::]:80;
server_name me.domain.de; ... location /static/ { alias /opt/mailman/mm/static/; }
Again, many thanks in advance for any clue
The above in nginx is correct, but you aren't getting the static files via nginx. You need to go to a URL like http://me.domain.de/postorius/lists/. Going to http://127.0.0.1:8000/postorius/lists/ goes directly to your wsgi server and doesn't involve nginx at all. You need to go to port 80 where nginx is listening and nginx then proxys requests to 127.0.0.1:8000. Do you also have
location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr;
}
in /etc/nginx/conf.d/me.domain.de.conf. You need that.
Thanks, port :80 did the trick. In my old Mailman3 installation on an outdated Linux VM it runs on :8000.
Life's good again :-)
VGVG
On 07.05.23 23:13, Mark Sapiro wrote:
On 5/7/23 10:51, Volkmar Grote wrote:
thanks for the quick reply. I am one step closer to a solution, "http://127.0.0.1:8000/postorius/lists/?all-lists#" seems to work now. I get the functionality, but it looks ugly w/o any graphics, for which I get yet another, slightly similar, error message:
Page not found (404)
Request Method: GET Request URL: http://127.0.0.1:8000/static/postorius/img/mailman_logo_small_trans.png
...
Nginx, /etc/nginx/conf.d/me.domain.de.conf
server { listen 80; listen [::]:80;
server_name me.domain.de; ... location /static/ { alias /opt/mailman/mm/static/; }
Again, many thanks in advance for any clue
The above in nginx is correct, but you aren't getting the static files via nginx. You need to go to a URL like http://me.domain.de/postorius/lists/. Going to http://127.0.0.1:8000/postorius/lists/ goes directly to your wsgi server and doesn't involve nginx at all. You need to go to port 80 where nginx is listening and nginx then proxys requests to 127.0.0.1:8000. Do you also have
location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr;
}
in /etc/nginx/conf.d/me.domain.de.conf. You need that.
Thanks, port :80 did the trick. In my old Mailman3 installation on an outdated Linux VM it runs on :8000.
Life's good again :-)
VGVG
On Sun, May 7, 2023 at 8:52 PM Volkmar Grote <volkmar@grote-family.com> wrote:
Hi Mark,
On 07.05.23 01:31, Mark Sapiro wrote:
On 5/6/23 16:02, volkmar@grote-family.com wrote:
My urls.py:
(venv) mailman@me:/opt/mailman/mm$ grep -v "^#" urls.py from django.contrib import admin from django.urls import include, reverse_lazy, re_path 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), ]
We and the various docs are inconsistent about 'postorius' vs 'mailman3' and 'hyperkitty' vs 'archives' in urls. Add these
re_path(r'^mailman3/', include('postorius.urls')), re_path(r'^archives/', include('hyperkitty.urls')),
to your urlpatterns list in urls.py to cover both variants.
thanks for the quick reply. I am one step closer to a solution, "http://127.0.0.1:8000/postorius/lists/?all-lists#" seems to work now. I get the functionality, but it looks ugly w/o any graphics, for which I get yet another, slightly similar, error message:
Page not found (404)
You can run:
'/opt/mailman/mm/bin/django-admin clear_cache' as the mailman user. After that you can also restart Nginx, then test again and see if everything works.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
participants (5)
-
Mark Sapiro
-
Odhiambo Washington
-
Volkmar Grote
-
Volkmar Grote
-
volkmar@grote-family.com