Help with installing Postorius and Hyperkitty on Ubuntu 19
I'm new to Mailman. I have a Ubuntu 19 production server. I attempted to get Mailman 3 and the web components going with the system packages, but I encountered a few showstopper errors (such as indexing not working at all) which I know have been fixed in the codebase. To that end I erased my installation, and installed mailman from the gitlab source. That all works much more nicely now and I feel I have a lot more control of the layout of all the files (the various Ubuntu packages smear the parts all over the place, confusingly).
Now I want to get Postorius and Hyperkitty going again, independently of Ubuntu packages. I would like to run Postorius and Hyperkitty under one Django project. So I downloaded the git source for mailman_web. I do not know if this is the right way to install.
I am partially familiar with Django, but to come to the point, I have no idea once having obtained the source from git how to setup and install the project, where it lives in the filesystem, and so on. Are there any pointers to help in this area? The very nice readthedocs format files for Postorius and Hyperkitty are very silent on basic matters like this, which is not of much help! The git README files also define a new level of brevity.
I need some initial hand holding here. If any help is forthcoming, such as links to more full documentation for newbies to Mailman, I would be most grateful.
On Sat, Jun 8, 2019, at 2:12 AM, andrew.bernard@gmail.com wrote:
I'm new to Mailman. I have a Ubuntu 19 production server. I attempted to get Mailman 3 and the web components going with the system packages, but I encountered a few showstopper errors (such as indexing not working at all) which I know have been fixed in the codebase. To that end I erased my installation, and installed mailman from the gitlab source. That all works much more nicely now and I feel I have a lot more control of the layout of all the files (the various Ubuntu packages smear the parts all over the place, confusingly).
Now I want to get Postorius and Hyperkitty going again, independently of Ubuntu packages. I would like to run Postorius and Hyperkitty under one Django project. So I downloaded the git source for mailman_web. I do not know if this is the right way to install.
Mailman Web works okay, there are very few things actually in there. If you want to install things from source, consider using the mailman_suite project as a starting point.
https://gitlab.com/mailman/mailman-suite
Mark wrote down his experience installing Mailman 3 on two machines, which is currently running this very list.
https://wiki.list.org/DOC/Mailman%203%20installation%20experience
I am partially familiar with Django, but to come to the point, I have no idea once having obtained the source from git how to setup and install the project, where it lives in the filesystem, and so on. Are there any pointers to help in this area? The very nice readthedocs format files for Postorius and Hyperkitty are very silent on basic matters like this, which is not of much help! The git README files also define a new level of brevity.
I need some initial hand holding here. If any help is forthcoming, such as links to more full documentation for newbies to Mailman, I would be most grateful.
I'll try to write the steps in short, let me know if you need me to expand on any of these.
Choose a directory to get all the sources. I usually prefer /opt. So, create /opt/mailman
Create a Python 3 virtual environment.
$ cd /opt/mailman $ python3 -m venv vevn $ source venv/bin/activate
Get all the sources and install in this virtualenv, you neeed:
- Mailman Core (mailman/mailman)
- Mailman Client (mailman/mailmanclient
- Mailman-Hyperkitty (mailman/mailman-hyperkitty
- Django-Mailman3 (mailman/django-mailman3
- Postorius (mailman/postorius)
- Hyperkitty (mailman/hyperkitty)
You can also just pip
install those packages, instead of
using git sources. I would actually recommend using the
release versions if you are not ready to deal with the instability
of the git heads.
Finally, you need to create config files in right places:
Mailman Core's config lives at `/etc/mailman.cfg
Django config lives in the django project, mailman-suite.
I am not going to dive into actual runtime configuration here.
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/
-- thanks, Abhilash Raj (maxking)
Abilash,
This is most helpful. But there seems to be an inconsistency, and it goes to exactly the question I am asking. You refer to mailman suite at the top of the file. But I want to follow your advice to use pip. Then after the pip instructions, you talk about the mailman-suite config file for Django. t's exactyl what I _don't_ want. Where is the Django config area for the pip installed modules? It is this that I find obscure.
Andrew
On Sat, 8 Jun 2019 at 19:53, Abhilash Raj <maxking@asynchronous.in> wrote:
Finally, you need to create config files in right places:
Mailman Core's config lives at `/etc/mailman.cfg
Django config lives in the django project, mailman-suite.
I am not going to dive into actual runtime configuration here.
On 6/8/19 4:04 AM, Andrew Bernard wrote:
Where is the Django config area for the pip installed modules? It is this that I find obscure.
The short answer is wherever you put it. If you look at <https://wiki.list.org/DOC/Mailman%203%20installation%20experience> which Abhilash mentioned, you'll see what I do.
Abhilash mentioned creating the virtualenv in /opt/mailman/. I actually have another level below that, /opt/mailman/mm/, but this is only for convenience to separate things as I also have directories for the git branches and for local patches, so if we are just working with /opt/mailman/, you can put your Django settings.py and settings_local.py files there. I also put various other config things there like
Mailman's var/ directory Django's static/ directory mailman.cfg mailman-hyperkitty.cfg gunicorn.conf and an empty __init__.py file so Django can import settings.
Then I create a /opt/mailman/bin/ directory and in that I put small bash scripts to run things.
for example:
opt/mailman/bin/mailman contains
#!/bin/bash unset PYTHONSTARTUP
exec /opt/mailman/venv/bin/mailman
-C "/opt/mailman/mm/mailman.cfg"
$@
opt/mailman/bin/django-admin contains
#!/bin/bash . /opt/mailman/venv/bin/activate cd /opt/mailman/ export PYTHONPATH=/opt/mailman/ export DJANGO_SETTINGS_MODULE=settings django-admin $@
and opt/mailman/bin/gunicorn contains
#!/opt/mailman/venv/bin/python
import sys sys.path[0:0] = [ '/opt/mailman/', ]
import os os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import gunicorn.app.wsgiapp
if __name__ == '__main__': sys.exit(gunicorn.app.wsgiapp.run())
Then I use those commands to run Mailman, Django and gunicorn. Some of this may not be directly applicable to you, but I hope it gives you the basic idea.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi Mark,
Thanks for your great help. But despite decades of UNIX experience, my area is not Django (yet). The nub of my question is that I thought you have to have a manage.py file for Django to be able to set up the various affairs, such as making the database migrations and so on. It is that that is eluding me. Apologies for this hopelessly newbie question.
I was impressed with your method of installation in the page referenced, and I have foolwed that closely. But I am puzzled about the build script. If I run as user mailman, not root, it wanted to install under /usr. which of course results in permission denied. I had to modify the script to say this:
python setup.py install --prefix /opt/mailman/mm/venv
I am concerned that I have also misunderstood something here.
A
On Sun, 9 Jun 2019 at 00:57, Mark Sapiro <mark@msapiro.net> wrote:
On 6/8/19 4:04 AM, Andrew Bernard wrote:
Where is the Django config area for the pip installed modules? It is this that I find obscure.
The short answer is wherever you put it. If you look at <https://wiki.list.org/DOC/Mailman%203%20installation%20experience> which Abhilash mentioned, you'll see what I do.
On 6/8/19 4:33 PM, Andrew Bernard wrote:
Hi Mark,
Thanks for your great help. But despite decades of UNIX experience, my area is not Django (yet). The nub of my question is that I thought you have to have a manage.py file for Django to be able to set up the various affairs, such as making the database migrations and so on. It is that that is eluding me. Apologies for this hopelessly newbie question.
The equivalent of manage.py in what I suggested is /opt/mailman/bin/django-admin.
I was impressed with your method of installation in the page referenced, and I have foolwed that closely. But I am puzzled about the build script. If I run as user mailman, not root, it wanted to install under /usr. which of course results in permission denied. I had to modify the script to say this:
python setup.py install --prefix /opt/mailman/mm/venv
If you want to install in the virtualenv, you should just activate the virtualenv and it should work.
Perhaps the issue is that the build script at <https://wiki.list.org/DOC/Mailman%203%20installation%20experience?action=AttachFile&do=view&target=build_script.txt> assumes the virtualenv is at /opt/mailman/mm/venv. You need to insure that the '. ../mm/venv/bin/activate' line is actually pointing to your 'venv/bin/activate'
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (4)
-
Abhilash Raj
-
Andrew Bernard
-
andrew.bernard@gmail.com
-
Mark Sapiro