Initial Server Set-up
  • Install Ubuntu 8.04 LTS
  • 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:

-> Select Internet Site

-> FQDN = localhost
  • 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>
$ sudo ./configure -with-cgi-id=www-data -with-mailhost=localhost -with-url-host=localhost

$ sudo 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 
  • 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:

MAILMAN_SITE_LIST = 'mailman-admin'
#For testing purposes, delete when moved into production
DEFAULT_EMAIL_HOST = 'localhost'
DEFAULT_URL_HOST = 'localhost'

For setting up the system locally use this:

MAILMAN_SITE_LIST = 'mailman-admin'
#For testing purposes, delete when moved into production
DEFAULT_EMAIL_HOST = 'localhost'
DEFAULT_URL_HOST = 'localhost'
  • 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
$ /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
  • 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
  • Navigate to localhost/mailman/admin to see if the gui is working
  • Reboot to make sure the system comes up and everything starts correctly

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 . 

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:

#For testing purposes, delete when moved into production
DEFAULT_EMAIL_HOST = 'localhost'
DEFAULT_URL_HOST = 'localhost'
  • Restart mailman
$ sudo /etc/init.d/mailman start 
  • Check to see that the gui still works and you can create lists etc.
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_-_production.txt · Last modified: 2009/05/27 16:07 by jenred
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki