Initial Server Set-up

To set up the system Ubuntu 8.04 and Python 2.5 is neccessary. Unfortunately, newer versions of eg. Python are yet not compatible with the version on Mailman used here (Mailman 2.1.10), hence please use the versions named above.

As part of gsoc2010, the installation steps have been automated. Please read : http://systers.org/systers-dev/doku.php/svaksha:step_by_step_system_installation_automation for detailed instructions.

  • Install Ubuntu 8.04 LTS - Numerious issues arise with 9.1, and no one has debugged them: use 8.04!
  • Add the admin group if not here already
$ sudo addgroup admin 
  • Add any necessary user accounts
$ sudo adduser <name of user> 
  • Add users to the admin group to allow for sudo access
$ sudo vi /etc/group

Find the line that looks like this (number may be different)

admin:x:112:

And add any users that you want to have super-user privileges.

admin:x:112:user1,user2,user3

Write and quit /etc/group

  • Check for any OS and Software Updates (pulls any software and OS updates from Ubuntu's Hardy Heron stable repositories)
$ sudo apt-get update
  • Install any OS and Software Updates (applies any updates to the system)
$ sudo apt-get upgrade
Software Installation

All package dependencies will be installed with the following commands. Select “Y” to install when prompted.

  • Install missing language packs (Forces text localization for English)
$ sudo apt-get install language-pack-en
  • Install NTP (maintains correct system time by checking time against “official time servers located on the internet”)
$ sudo apt-get install ntp 
  • Install Bazaar (Needed to pull custom code for repository on Launchpad)
$ sudo apt-get install bzr
  • Install Python
$ sudo apt-get install python2.5
  • Install Apache 2.2 (The http-server, needed to serve web-pages)
$ sudo apt-get install apache2
  • Install Postfix (The systems mail-server aka MTA)
$ sudo apt-get install postfix 

(use tab and arrow keys to navigate through option window)

-> Select Internet Site

-> FQDN = yourdomain.com

For setting up the system locally use this (exchange <domain name> for a “valid” domain name such as my.dom.ain or yourcomputername.yournetworkname):

-> Select Internet Site

-> FQDN = <domain name>
  • Install Postgresql (Database Server for mailman extensions)
$ sudo apt-get install postgresql 
  • Install packages needed to build Mailman and python-psycopg2 (build-essential includes make and gcc, python-dev is needed for necessary python libraries)
$ sudo apt-get install build-essential 
$ sudo apt-get install python-dev 
  • Install python-psycopg2 (needed for python connection to Postgresql)
$ sudo apt-get install python-psycopg2
Postfix Configuration

Postfix should work right-out-of-the-so-called-box provide you picked Internet Site above.

Mailman Installation
  • Download mailman 2.1.10 to your home directory on artemis.systers.org
$ cd ~ 

$ wget http://launchpad.net/mailman/2.1/2.1.10/+download/mailman-2.1.10.tgz
  • Expand the .tgz
$ tar -zxvf mailman-2.1.10.tgz

The file will expand into a directory called mailman-2.1.10 in your home directory.

  • Install the mailman group and user (We are installing this user with no shell and no home for security purposes, this is the user under which the mailman process runs.)
$ sudo groupadd mailman
$ sudo useradd -s /bin/false -g mailman mailman 
  • Create the mailman directory and set the initial permissions (This is where we will install the Mailman application)
$ sudo mkdir /usr/local/mailman
$ sudo chown -R mailman:mailman /usr/local/mailman
$ sudo chmod -R 02775 /usr/local/mailman
  • Build and install Mailman (we need to over-ride the with-url and with mailhost in mm_cfg for testing)
$ cd <to expanded mailman dir>
$ ./configure -with-cgi-id=www-data -with-mailhost=localhost -with-urlhost=localhost

$ make 
$ sudo make install 
  • Correct any permission problems (-f = fix. Run first with no -f, you must be sudo to root or mailman)
$ sudo su
$ cd /usr/local/mailman
$ bin/check_perms 
$ bin/check_perms -f
  • Secure the Archives
$ sudo su
$ cd /usr/local/mailman/archives
$ chown www-data private
$ chmod o-x private
$ exit 
  • Create the initial Site List - the name of the list needs to match the listname in mm_cfg.py
$ sudo /usr/local/mailman/bin/newlist 

Please read the page bin_newlist_bug_588028 for steps to avoid after pulling the systers-stable branch (rev 73).

Follow the prompts.

  • Integrate Mailman with Postfix
  • Add MTA = Postfix to mm_cfg.py
$ sudo vi /usr/local/mailman/Mailman/mm_cfg.py

Scroll to the bottom of the file and add:

MTA = 'Postfix'

and since we are here add the following lines (which will set up the system locally) and exchange <domain name> for a “valid” domain name

MAILMAN_SITE_LIST = <insert the name of site list created before>
#For testing purposes, delete when moved into production
DEFAULT_EMAIL_HOST = '<domain name>'
DEFAULT_URL_HOST = '<domain name>'
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
  • Generate the alias.db file
$ cd /usr/local/mailman
$ sudo bin/genaliases
$ sudo chown mailman:mailman data/aliases*
$ sudo chmod g+w data/aliases*
  • Tell Postfix where to find the mailman alias file
$ sudo vi /etc/postfix/main.cf

Go to

 alias_maps = hash:/etc/aliases

and Add:

hash:/usr/local/mailman/data/aliases

So the line looks like:

alias_maps = hash:/etc/aliases,hash:/usr/local/mailman/data/aliases
  • Reload postfix
$ sudo /etc/init.d/postfix reload 
Apache Configuration
  • Add Apache mailman specific apache configurations
$ sudo su 

$ cd /etc/apache2/sites-available

$ vi mailman

Cut and Paste the following into mailman

ScriptAlias /mailman/ /usr/local/mailman/cgi-bin/

# To access the public archives:

Alias /pipermail/ /usr/local/mailman/archives/public/

<Directory /usr/local/mailman/cgi-bin/>
    AllowOverride None
    Options ExecCGI
    AddHandler cgi-script .cgi
    Order allow,deny
    Allow from all
</Directory>
<Directory /usr/local/mailman/archives/public/>
    Options Indexes FollowSymlinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Write and Quit

$ exit

to return to your shell

  • Make the mailman site available to Apache
$ sudo a2ensite mailman
  • Reload the Apache configurations
$ sudo /etc/init.d/apache2 reload
  • Add crontab
$ cd /usr/local/mailman/cron
$ sudo crontab -u mailman crontab.in
  • Add mailman start-up script to init
cd /usr/local/mailman
$ sudo cp scripts/mailman /etc/init.d/
$ sudo update-rc.d mailman defaults
  • Create the site-password
$ sudo bin/mmsitepass <your-site-password>
  • Check permissions
$ cd /usr/local/mailman
$ sudo bin/check_perms
$ sudo bin/check_perms -f
  • Make sure your chosen <domain name> is in the list of hosts on your computer.
$ sudo vi /etc/hosts
  • Start Up Mailman!
$ sudo /etc/init.d/mailman start

Test the Default Software Installs

  • Verify Mailman/Postfix/Apache are working (create a new list etc.), take a look at the gui
  • Open up a browser and navigate to http://localhost/mailman/admin to see if the gui is working
  • Reboot to make sure the system comes up and everything starts correctly
Tips for Setting up a Local Mailserver for Testing
  • Create a few new users using
$ sudo adduser <name of new user> 
  • Install a UNIX mail program to send and recieve mail
$ sudo apt-get install mailx
  • Let the new users subscribe to one of the lists. Mailman will then send an e-mail to them for a confirmation of joining the list which can be accessed through
$ sudo su <name of user>
$ mail
  • After a few users have signed up to a list, let one of them send an e-mail to the list using the installed mail program. Check that it went through to all subscribed users.

Configure Systers' customizations

PostgreSQL Configuration
  • Edit /etc/postgresql/8.3/main/pg_hba.conf
$ sudo /etc/init.d/postgresql-8.3 stop
$ sudo vi /etc/postgresql/8.3/main/pg_hba.conf

Find this line:

#"local" is for Unix domain socket connections only
          local   all         all                              ident sameuser

Comment it out and add the following line:

           local   all         all                               md5
  • Restart Postgresql
$ sudo /etc/init.d/postgresql-8.3 start
  • Create the mailman user in the database
$ sudo su postgres
$ createuser mailman
 -> Shall the new role be a superuser? (y/n) n

 -> Shall the new role be allowed to create databases? (y/n) y

 -> Shall the new role be allowed to create more new roles? (y/n) n
  • Assign a password to the DB mailman user
$ psql (this drops you into the sql interface for modifying the postgres db)
postgres=# alter user mailman password 'mailman';
ALTER ROLE

ctrl-D (to exit psql)
ctrl-D (to go back to original user shell)
Pull Production Branch from Launchpad
  • Stop mailman
$ sudo /etc/init.d/mailman stop 
  • Pull the code from Launchpad
$ cd /usr/local/mailman
$ pwd (to make sure you are in /usr/local/mailman)
$ sudo bzr checkout --lightweight lp:systers . 
  • Note that you may want to substitute lp:systers for another branch that is more relevant to your development.
  • Also if you want to create a working branch use checkout rather then checkout –lightweight

Please see - Bazaar Branches

You will probably get a message about .moved files since you are over-writing existing files. This is ok.

  • Delete the .moved files
$ sudo su
$ find /usr/local/mailman -name "*.moved" |xargs rm 
  • Fix any permission problems
$ sudo bin/check_perms -f
  • Add machine specific settings to mm_cfg.py for testing
$ sudo vi /usr/local/mailman/Mailman/mm_cfg.py

Readd (at bottom of file):

For setting up Systers-Mailman locally (use the same “valid” domain name as earlier, exchanging this for <domain name>):

#For testing purposes, delete when moved into production
DEFAULT_EMAIL_HOST = '<domain name>'
DEFAULT_URL_HOST = '<domain name>'
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
  • Install markdown package
$ sudo aptitude install python-markdown
  • Install storm 0.12
$ sudo apt-get install python-storm 
  • Restart mailman
$ sudo /etc/init.d/mailman start 
  • Check to see that the gui still works and you can create lists etc.
  • Create a new list called “systers-admin”. This will make sure your console will not complain about this list missing later on when restarting Mailman. When trying to subscribe to this list, the GUI should look like the original Systers list online, including a field for answering three questions.
Final System Clean-up
  • Remove the software used to build mailman and python-pyscopg2 (You generally don't want compilers on production systems. Can be a security problem)
$ sudo apt-get remove --purge build-essential
$ sudo apt-get remove --purge python2.5-dev
$ sudo apt-get autoremove
 
step_by_step_system_installation.txt · Last modified: 2010/09/07 22:38 by svaksha
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki