PDA

View Full Version : Howto guide: Installing Mailman



nsc
09-19-2004, 07:43 AM
Hi! :)

Today I had some free time so I wrote a small step-by-step guide on installing Mailman. I hope you find it useful. Please feel free to copy it and make it better if you know. Keep in mind I am not an expert so the info may be inaccurate. :)



HOWTO: Install Mailman on Westhost VPS
by NSK, 19 September 2004.

Redistribute and modify freely for commercial or non-commercial use. This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/

Disclaimer: I don't guarantee the validity of information contained here. This document is provided "as is" and you read/use it at your own risk. Trademarks are the property of their owners.

VERSIONS USED
-------------
Mailman: 2.1.5
Westhost VPS: 2.0
Python: 2.2.2

PREPARING YOUR VPS
------------------
1. Visit http://www.your-domain-name.tld/manager and login there. Go to Site Applications. click on the Development tab. Install Python and then install the GNU Compiler Collection.

RETRIEVING MAILMAN
------------------
2. You need to download Mailman from http://www.list.org
3. You need to transfer the file to your VPS. Put it in your home directory (/home/your-user-name). Alternatively you can proceed to step 4 and issue the commands "cd ~" and then "wget http://www.list.org/mailman.tar.gz" or you can substitute the URL with any other URL you want to download Mailman from.

SSH LOGIN
---------
4. Assuming you work on a GNU/Linux or BSD system, go to the console and type "ssh my-user-name@www.my-domain-name.tld" and login in your VPS. Welcome to the brave old world of the console!! :) If you get in trouble, you can visit the WestHost manual which contains lots of info on how to use SSH, especially for Windows users, at http://manual.westhost.com/part1.html#gi-telnet

EXTRACTING THE MAILMAN SOURCE
-----------------------------
5. Find/remember where you saved the mailman.tar.gz (or mailman-2.1.5.tar.gz) file in your VPS and go to that directory with cd. If it's in your home, issue "cd ~".
6. Issue "tar -zxvf mailman.tar.gz".
7. I reccomend renaming the mailman directory by using "mv ./mailman-2.1.5 ./mailman".
8. Issue "chgrp mailman ./mailman" and then "chmod a+rx ./mailman" and then "chmod g+ws ./mailman".
9. Issue "cd ./mailman".

COMPILING MAILMAN
-----------------
10. Issue "./configure --with-username=YOUR-USER-NAME --with-groupname=vuser --prefix=/home/YOUR-USER-NAME/mailman --with-mail-gid=vuser --with-python=/usr/local/bin/python --with-mailhost=YOUR-DOMAIN-NAME --with-urlhost=YOUR-DOMAIN-NAME --with-cgi-gid=vuser" and watch for errors. If you get errors try typing the whole command instead of copy-pasting it. User names, paths and domain names are or may be CASE SENSITIVE. I found the compile directions at http://www.domsch.com/westhost
11. Issue "make" and watch for errors.
12. Issue "make install" and watch for errors. Write down any error you get.

READING THE DOCS (Ouch!)
------------------------
13. Issue "less gnu-COPYING-GPL" and read it. Use the arrow keys or the spacebar or the z and w keys for changing page. If you need help press h. When you reach the end of the file, you press q to quit. If you like what you read, you may proceed, otherwise you should delete Mailman by issuing "cd ~" and "rm -Rvf mailman".
14. Issue "less INSTALL" and read it and then press q.
15. Issue "less README" and read it (and press again q to quit after you do so).

INSTALLING MAILMAN
------------------
16. BEWARE!: Mailman supports private non-public list archives. This will not work with the procedure I describe here, so keep in mind that if you archive your mailing lists then any Web user will be able to read the messages from the Web archives that Mailman by default keeps.
17. Type "cd ~/mailman/bin".
18. Issue "./check_perms". Read the messages. If you get errors type "./check_perms -f". If the errors cannot be fixed automatically, use the commands chgrp and/or chmod to change the directory and file permissions. "chmod --help" will give you the command's syntax.
19. Do not close your SSH session. Go to Site Manager 2.0 by accessing http://www.your-domain-name.tld/manager and login. Go to the Domain management area. Click on Web aliases. Click on New alias. Click on Script alias (CGI executable). The URL path is "mailman/" and the absolute path name is "/home/your-user-name/mailman/cgi-bin/". Now click on New alias again. Click on Alias and type "pipermail/" in the URL textbox and "/home/your-user-name/archives/public/" in the absolute script path. Do these steps quickly in order not to time out your SSH session, otherwise you will have to logon again via SSH!
20. Issue "cd ~/mailman/icons".
21. Issue "cp * /var/www/icons/".
22. Issue "cd ~/mailman/bin".
23. Issue "mmsitepass" and type in a password. Don't forget it! Passwords are case sensitive.
24. Visit http://your-domain-name.tld/mailman/create and start your mailing list. To administer it later you can visit http://your-domain-name.tld/mailman/admin/your-mailing-list-name
25. Issue "cd ~/mailman/cron".
26. Issue "crontab crontab.in". If it works continue to the next step, If it doesn't work maximise your SSH window and Issue "less crontab.in". Copy what you see. Issue "crontab -" (this command may be wrong, please search the Net for "cron syntax") and paste the lines. Press CTRL+O and ENTER. Press CTRL+X. Issue "crontab". If you see errors, repeat and ensure the pasted lines did not split because of wordwrapping.
27. Issue "cd ~/mailman/Mailman".
28. Issue "cp mm_cfg.py.dist mm_cfg.py".
29. Issue "pico mm_cfg.py". Use the down arrow key to reach the end of this file.
30. Add this line to the file: "SMTPHOST = 'your-domain-name.tld'". You may also use your VPS IP address (use ping or the Site Manager to find it).
31. Press CTRL+O and then ENTER. Press CTRL+X.
32. Issue "cd ~/mailman/bin".
33. Issue "mailmanctl start". If you see any error message, write it down. If not, be happy because you just finished the basic installation of Mailman! :)
34. You can access the web interface of Mailman by going to http://your-domain-name.tld/mailman/listinfo
35. Each time your VPS is restarted or the server is resetted you will need to login via SSH and issue the command found in step 33. To exit SSH type "exit".

EXTRA CONFIGURATION
-------------------
36. The INSTALL file of Mailman tells you how to configure Mailman to run automatically each time your VPS is restarted. I don't know whether it works on Westhost.

EXTRA READING/SUPPORT
-----------------------------------
37. You can visit http://www.list.org/docs.html to access the documentation of the Mailman project or use the FAQ Wizard to search for answers to common problems at http://www.python.org/cgi-bin/faqw-mm.py



Hope this guide can help you if you need Mailman. Comments are welcome!

Be happy,
NSK

FZ
09-19-2004, 08:37 AM
Thanks for sharing. I'm sure lots of people will find this extremely helpful.

I do have a few suggestions:

---
"RETRIEVING MAILMAN"
Since SSH needs to be used, you might as well suggest that people just do a wget to download Mailman straight to their VPS (instead of having to download it and then upload it, which is painful for people on slower connections). Something like:


wget http://url/to/mailman


"SSH LOGIN"
For those people on Windows, you could link to the WestHost manual (http://manual.westhost.com/part1.html#gi-telnet) for an explanation on how to use SSH.
---

Keep up the good work!

nsc
09-19-2004, 08:46 AM
Very good suggestions. thank you!

People who wish to use wget should first go to the directory they wish to have mailman.tar.gz (for example ~) and then type



wget http://www.list.org/mailman.tar.gz


which will transfer the file to the current directory.

Windows users can use PuTTY as described in the Westhost manual.

People who found Mailman useful and have the ability, can consider donating something or contributing some work back to the Mailman project, because this is how most opensource projects can continue their operation! :)

wizardofaz
05-08-2005, 11:30 AM
NSK - thanks for providing the how-to for mailman install.

In the current Mailman docs the python level required is stated as 2.1. The WH site manager claims to install python 1.5, but actually installs 2.2. So should be OK. However, when I run Mailman's "make install" I get

make[1]: *** [install] Error 1
make: *** [doinstall] Error 2

and if I go on to try ./check_perms I get

Traceback (most recent call last):
File "./check_perms", line 46, in ?
from Mailman import mm_cfg
ImportError: cannot import name mm_cfg

In the mailman install guide from gnu.org it mentions this error and indicates it's usually a Python problem. I tried installing a newer version of Python, but can't see how to do that w/o root privilege.

So I'm stuck. Any help anybody can provide for getting Mailman going would be appreciated.

Thanks
Bill

scritch
10-21-2005, 04:55 PM
Looks like Westhost will soon be automating the install of Mailman, but for now here's my edit of NSK's Mailman installation guide, based on what worked for me (split into 2 posts because of length):

HOWTO: Install Mailman on Westhost VPS, PART 1 OF 2
by NSK, 19 September 2004.
Edited by scritch, 23 October, 2005.

Redistribute and modify freely for commercial or non-commercial use. This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/

Disclaimer: I don't guarantee the validity of information contained here. This document is provided "as is" and you read/use it at your own risk. Trademarks are the property of their owners.

VERSIONS USED
-------------
Mailman: 2.1.6
Westhost VPS: 2.0
Python: 2.2.2

PREPARING YOUR VPS
------------------
1. Visit http://www.your-domain-name.tld/manager and login there. Go to Site Applications. click on the Development tab. Install Python and then install the GNU Compiler Collection.

RETRIEVING MAILMAN
------------------
2. You need to download Mailman from http://www.list.org 3. You need to transfer the file to your VPS. Put it in your home directory (/home/your-user-name). Alternatively you can proceed to step 4 and issue the commands "cd ~" and then "wget http://www.list.org/mailman-2.1.6.tar.gz" (or "mailman-2.1.6.tar") or you can substitute the URL with any other URL you want to download Mailman from.

SSH LOGIN
---------
4. Assuming you work on a GNU/Linux or BSD system, go to the console and type "ssh my-user-name@www.my-domain-name.tld" and login in your VPS. Welcome to the brave old world of the console!! If you get in trouble, you can visit the WestHost manual which contains lots of info on how to use SSH, especially for Windows users, at http://manual.westhost.com/part1.html#gi-telnet

EXTRACTING THE MAILMAN SOURCE
-----------------------------
5. Find/remember where you saved the mailman.tar.gz (or mailman-2.1.6.tar.gz) file in your VPS and go to that directory with cd. If it's in your home, issue "cd ~".
6. Issue "tar -zxvf mailman-2.1.6.tar.gz". For a .tar file, issue "tar -xvf mailman-2.1.6.tar".
7. I reccomend renaming the mailman directory by using "mv ./mailman-2.1.6 ./mailman".
8. Issue "chmod a+rx ./mailman" and then "chmod g+ws ./mailman".
9. Issue "cd ./mailman".

COMPILING MAILMAN
-----------------
10. Issue "./configure --with-username=YOUR-USER-NAME --with-groupname=vuser --prefix=/home/YOUR-USER-NAME/mailman --with-mail-gid=vuser --with-python=/usr/local/bin/python --with-mailhost=YOUR-DOMAIN-NAME --with-urlhost=YOUR-DOMAIN-NAME --with-cgi-gid=vuser" and watch for errors. If you get errors try typing the whole command instead of copy-pasting it. User names, paths and domain names are or may be CASE SENSITIVE. I found the compile directions at http://www.domsch.com/westhost 11. Issue "make" and watch for errors.
12. Issue "make install" and watch for errors. Write down any error you get.

READING THE DOCS (Ouch!)
------------------------
13. Issue "less gnu-COPYING-GPL" and read it. Use the arrow keys or the spacebar or the z and w keys for changing page. If you need help press h. When you reach the end of the file, you press q to quit. If you like what you read, you may proceed, otherwise you should delete Mailman by issuing "cd ~" and "rm -Rvf mailman".
14. Issue "less INSTALL" and read it and then press q.
15. Issue "less README" and read it (and press again q to quit after you do so).

INSTALLING MAILMAN
------------------
16. BEWARE!: Mailman supports private non-public list archives. This will not work with the procedure I describe here, so keep in mind that if you archive your mailing lists then any Web user will be able to read the messages from the Web archives that Mailman by default keeps.
17. Issue "cd ~/mailman/Mailman".
18. Issue "cp mm_cfg.py.dist mm_cfg.py".
19. Issue "cd ~/mailman/bin".
20. Issue "./check_perms". Read the messages. If you get errors type "./check_perms -f". If the errors cannot be fixed automatically, use the command chmod to change the directory and file permissions. "chmod --help" will give you the command's syntax, or you can use Westhost’s File Manager. Permissions can be a source of a variety of errors; bear this in mind if you have problems.
21. Do not close your SSH session. Go to Site Manager 2.0 by accessing http://www.your-domain-name.tld/manager and login. Go to the Domain management area. Click on Web aliases. Click on New alias. Click on Script alias (CGI executable). The URL path is "/mailman/" and the absolute path name is "/home/your-user-name/mailman/cgi-bin/". Click Finish. Now click on New alias again. Click on Alias and type "/pipermail/" in the URL textbox and "/home/your-user-name/mailman/archives/public/" in the absolute script path. Do these steps quickly in order not to time out your SSH session, otherwise you will have to logon again via SSH!
22. Issue "cd ~/mailman/icons".
23. Issue "cp * /var/www/icons/".
24. Issue "cd ~/mailman/bin".
25. Issue "mmsitepass" and type in a password. Don't forget it! Passwords are case sensitive.
26. Create a "site-wide" list named mailman. [The following is adapted from http://www.list.org/mailman-install/node40.html] This is the one that password reminders will appear to come from, and it is required for proper Mailman operation. Usually this should be a list called mailman, but if you need to change this, be sure to change the MAILMAN_SITE_LIST variable in mm_cfg.py. You can create the site list with this command, following the prompts:

"newlist mailman"

27. newlist will instruct you to add the following lines to etc/aliases (instructions how to do so follow):

## mailman mailing list
mailman: "|/home/YOUR-USER-NAME/mailman/mail/mailman post mailman"
mailman-admin: "|/home/YOUR-USER-NAME/mailman/mail/mailman admin mailman"
mailman-bounces: "|/home/YOUR-USER-NAME/mailman/mail/mailman bounces mailman"
mailman-confirm: "|/home/YOUR-USER-NAME/mailman/mail/mailman confirm mailman"
mailman-join: "|/home/YOUR-USER-NAME/mailman/mail/mailman join mailman"
mailman-leave: "|/home/YOUR-USER-NAME/mailman/mail/mailman leave mailman"
mailman-owner: "|/home/YOUR-USER-NAME/mailman/mail/mailman owner mailman"
mailman-request: "|/home/YOUR-USER-NAME/mailman/mail/mailman request mailman"
mailman-subscribe: "|/home/YOUR-USER-NAME/mailman/mail/mailman subscribe mailman"
mailman-unsubscribe: "|/home/YOUR-USER-NAME/mailman/mail/mailman unsubscribe mailman"

To add those lines:

28. Issue "cd /"
29. Issue "cd etc"
30. Issue "pico aliases". This will open the file "aliases" in the pico text editor. Scroll to the bottom by pressing CTRL+V. Paste the lines from step 25. Press CTRL+O and ENTER to save the file. Press CTRL+X to exit pico.
31. Issue "newaliases".
32. Issue "cd ~/mailman".
33. Now configure your site list. There is a convenient template for a generic site list in the installation directory, under data/sitelist.cfg which can help you with this. You should review the configuration options in the template, but note that any options not named in the sitelist.cfg file won't be changed. The template can be applied to your site list by issuing:

"bin/config_list -i data/sitelist.cfg mailman"

[End of adapted excerpt from list.org]

IMPORTANT: SEE FINAL STEPS IN PART 2.

scritch
10-21-2005, 04:57 PM
HOWTO: Install Mailman on Westhost VPS, PART 2 OF 2
by NSK, 19 September 2004.
Edited by scritch, 23 October, 2005.

34. Now you can create your first list. Visit http://your-domain-name.tld/mailman/create and start your mailing list. To administer it later you can visit http://your-domain-name.tld/mailman/mailing-list-name

Add the following to etc/aliases, substituting for "mailing-list-name" and "your-user-name"—issue "cd /" followed by "cd etc" to get to the etc directory, then use pico as in step 30:

## mailing-list-name mailing list
mailing-list-name: "|/home/your-user-name/mailman/mail/mailman post mailing-list-name"
mailing-list-name-admin: "|/home/your-user-name/mailman/mail/mailman admin mailing-list-name"
mailing-list-name-bounces: "|/home/your-user-name/mailman/mail/mailman bounces mailing-list-name"
mailing-list-name-confirm: "|/home/your-user-name/mailman/mail/mailman confirm mailing-list-name"
mailing-list-name-join: "|/home/your-user-name/mailman/mail/mailman join mailing-list-name"
mailing-list-name-leave: "|/home/your-user-name/mailman/mail/mailman leave mailing-list-name"
mailing-list-name-owner: "|/home/your-user-name/mailman/mail/mailman owner mailing-list-name"
mailing-list-name-request: "|/home/your-user-name/mailman/mail/mailman request mailing-list-name"
mailing-list-name-subscribe: "|/home/your-user-name/mailman/mail/mailman subscribe mailing-list-name"
mailing-list-name-unsubscribe: "|/home/your-user-name/mailman/mail/mailman unsubscribe mailing-list-name"

35. Issue "cd ~/mailman/cron".
36. Issue "crontab crontab.in". If no errors are reported continue to the next step. If it doesn't work maximise your SSH window and Issue "less crontab.in". (A crontab file should have five fields for specifying day, date and time*followed by the command to be run at that interval.) Copy what you see. Issue "crontab -" and paste the lines. Press CTRL+O and ENTER. Press CTRL+X. Issue "crontab". If you see errors, repeat and ensure the pasted lines did not split because of wordwrapping.
37. Issue "pico mm_cfg.py". Use the down arrow key to reach the end of this file.
38. Add this line to the file: "SMTPHOST = 'your-domain-name.tld'". You may also use your VPS IP address (use ping or the Site Manager to find it).
39. Press CTRL+O and then ENTER. Press CTRL+X.
40. Issue "cd ~/mailman/bin".
41. Issue "mailmanctl start". If you see any error message, write it down. If not, be happy because you just finished the basic installation of Mailman!
42. You can access the web interface of Mailman by going to http://your-domain-name.tld/mailman/listinfo
43. Each time your VPS is restarted or the server is reset you will need to login via SSH and issue the command found in step 41. To exit SSH type "exit".

EXTRA CONFIGURATION
-------------------
44. The INSTALL file of Mailman tells you how to configure Mailman to run automatically each time your VPS is restarted. I don't know whether it works on Westhost.

EXTRA READING/SUPPORT
-----------------------------------
45. You can visit http://www.list.org/docs.html to access the documentation of the Mailman project or use the FAQ Wizard to search for answers to common problems at http://www.python.org/cgi-bin/faqw-mm.py

floorbamboo
02-05-2007, 11:57 PM
First, many thanks to NSK and Scritch for this guide. With this guide, I was able to install Mailman successfully. However, i still had to make a few steps to make Mailman work. Probably due to changes between 2.1.6 and 2.1.9?

I would just like to share how i resolved the issues i was confronted with after step #43, and hopefully, others may also learn something from it.

1. After installing, i was not able to create a new list from web CGI. I got the error "Error: Unknown virtual host". I did some other things, but i think what resolved the problem were these:

1.1. I added "add_virtualhost ( 'www.do.main', 'do.main' )" to ~/mailman/Mailman/mm_cfg.py.

1.1.1. Please note that in step #37 (Scritch's edition), the mm_cfg.py file should be the one at ~/mailman/Mailman/mm_cfg.py. It seems Scritch forgot part of the instruction, so that in effect one will create a new file with the same name in ~/mailman/cron.

1.2. I restarted my VPS.

2. After restarting VPS, i was not able to restart Mailman using "mailmanctl start" successfully. There were some problems with a qrunner and a lock. I had to use "mailmanctl -s start".

3. Finally, i was able to create a mailing list at the browser. One thing i noticed, though, was that only one Mailman page should be opened when creating a new mail list, or else the error "Unknown virtual host" will again pop up.

4. After creating a new list, I had to manually enter lines to "etc/aliases" file, repeating step #34, only this time, following the instruction sent by Mailman to my administrator email.

Then, i again issued "newaliases".

5. Next, i edited the "/etc/mail/virtusertable" file. This part i learned from Miked (http://forums.westhost.com/showthread.php?p=34651#post34651). I added the new aliases i created earlier using this format:

maillistname@domain.com maillistname
maillistname-admin@domain.com maillistname-admin
maillistname-bounces@domain.com maillistname-bounces.
...

6. After this, learning still from Miked, i issued this:

makemap hash /etc/mail/virtusertable.db < /etc/mail/virtusertable

That's it. Mailman worked as it should.

Hope this helps.