Code

- Indexer Xapian, made Xapian 1.2 compatible. Needs at least Xapian 1.0.0 now.
[roundup.git] / doc / installation.txt
1 ==================
2 Installing Roundup
3 ==================
5 .. contents::
6    :depth: 2
9 Overview
10 ========
12 Broken out separately, there are several conceptual pieces to a
13 Roundup installation:
15 Roundup trackers
16  Trackers consist of issues (be they bug reports or otherwise), tracker
17  configuration file(s), web HTML files etc. Roundup trackers are initialised
18  with a "Template" which defines the fields usable/assignable on a
19  per-issue basis.  Descriptions of the provided templates are given in
20  `choosing your template`_.
22 Roundup support code
23  Installed into your Python install's lib directory.
25 Roundup scripts
26  These include the email gateway, the roundup
27  HTTP server, the roundup administration command-line interface, etc.
30 Prerequisites
31 =============
33 Roundup requires Python 2.3 or newer (but not Python 3) with a functioning
34 anydbm module. Download the latest version from http://www.python.org/.
35 It is highly recommended that users install the latest patch version
36 of python as these contain many fixes to serious bugs.
38 Some variants of Linux will need an additional "python dev" package
39 installed for Roundup installation to work. Debian and derivatives, are
40 known to require this.
42 If you're on windows, you will either need to be using the ActiveState python
43 distribution (at http://www.activestate.com/Products/ActivePython/), or you'll
44 have to install the win32all package separately (get it from
45 http://starship.python.net/crew/mhammond/win32/).
48 Optional Components
49 ===================
51 You may optionally install and use:
53 Timezone Definitions
54   Full timezone support requires pytz_ module (version 2005i or later)
55   which brings the `Olson tz database`_ into Python.  If pytz_ is not
56   installed, timezones may be specified as numeric hour offsets only.
58 An RDBMS
59   Sqlite, MySQL and Postgresql are all supported by Roundup and will be
60   used if available. One of these is recommended if you are anticipating a
61   large user base (see `choosing your backend`_ below).
63 Xapian full-text indexer
64   The Xapian_ full-text indexer is also supported and will be used by
65   default if it is available. This is strongly recommended if you are
66   anticipating a large number of issues (> 5000).
68   You may install Xapian at any time, even after a tracker has been
69   installed and used. You will need to run the "roundup-admin reindex"
70   command if the tracker has existing data.
72   Roundup requires Xapian 1.0.0 or newer.
74 pyopenssl
75   If pyopenssl_ is installed the roundup-server can be configured
76   to serve trackers over SSL. If you are going to serve roundup via
77   proxy through a server with SSL support (e.g. apache) then this is
78   unnecessary.
80 pyme
81   If pyme_ is installed you can configure the mail gateway to perform
82   verification or decryption of incoming OpenPGP MIME messages. When
83   configured, you can require email to be cryptographically signed
84   before roundup will allow it to make modifications to issues.
86 .. _Xapian: http://xapian.org/
87 .. _pytz: http://www.python.org/pypi/pytz
88 .. _Olson tz database: http://www.twinsun.com/tz/tz-link.htm
89 .. _pyopenssl: http://pyopenssl.sourceforge.net
90 .. _pyme: http://pyme.sourceforge.net
93 Getting Roundup
94 ===============
96 .. note::
97     Some systems, such as Debian and NetBSD, already have Roundup
98     installed. Try running the command "roundup-admin" with no arguments,
99     and if it runs you may skip the `Basic Installation Steps`_
100     below and go straight to `configuring your first tracker`_.
102 Download the latest version from http://roundup.sf.net/.
104 If you're using WinZIP's "classic" interface, make sure the "Use
105 folder names" check box is checked before you extract the files.
108 For The Really Impatient
109 ========================
111 If you just want to give Roundup a whirl Right Now, then simply run
112 ``roundup-demo``.
114 This will set up a simple demo tracker on your machine. [1]_
115 When it's done, it'll print out a URL to point your web browser at
116 so you may start playing. Three users will be set up:
118 1. anonymous - the "default" user with permission to do very little
119 2. demo (password "demo") - a normal user who may create issues
120 3. admin (password "admin") - an administrative user who has complete
121    access to the tracker
123 .. [1] Demo tracker is set up to be accessed by localhost browser.
124        If you run demo on a server host, please stop the demo when
125        it has shown startup notice, open file ``demo/config.ini`` with
126        your editor, change host name in the ``web`` option in section
127        ``[tracker]``, save the file, then re-run the demo program.
129 Installation
130 ============
132 Set aside 15-30 minutes. There's several steps to follow in your
133 installation:
135 1. `basic installation steps`_ if Roundup is not installed on your system
136 2. `configuring your first tracker`_ that all installers must follow
137 3. then optionally `configure a web interface`_
138 4. and optionally `configure an email interface`_
139 5. `UNIX environment steps`_ to take if you're installing on a shared
140    UNIX machine and want to restrict local access to roundup
141 6. `additional language codecs`_
143 For information about how Roundup installs, see the `administration
144 guide`_.
147 Basic Installation Steps
148 ------------------------
150 To install the Roundup support code into your Python tree and
151 Roundup scripts into /usr/bin (substitute that path for whatever is
152 appropriate on your system). You need to have write permissions
153 for these locations, eg. being root on unix::
155     python setup.py install
157 If you would like to place the Roundup scripts in a directory other
158 than ``/usr/bin``, then specify the preferred location with
159 ``--install-scripts``. For example, to install them in
160 ``/opt/roundup/bin``::
162     python setup.py install --install-scripts=/opt/roundup/bin
164 You can also use the ``--prefix`` option to use a completely different
165 base directory, if you do not want to use administrator rights. If you
166 choose to do this, you may have to change Python's search path (sys.path)
167 yourself.
170 Configuring your first tracker
171 ------------------------------
173 1. To create a Roundup tracker (necessary to do before you can
174    use the software in any real fashion), you need to set up a "tracker
175    home":
177    a. (Optional) If you intend to keep your roundup trackers
178       under one top level directory which does not exist yet,
179       you should create that directory now.  Example::
181          mkdir /opt/roundup/trackers
183    b. Either add the Roundup script location to your ``PATH``
184       environment variable or specify the full path to
185       the command in the next step.
187    c. Install a new tracker with the command ``roundup-admin install``.
188       You will be asked a series of questions.  Descriptions of the provided
189       templates can be found in `choosing your template`_ below.  Descriptions
190       of the available backends can be found in `choosing your backend`_
191       below.  The questions will be something like (you may have more
192       templates or backends available)::
194           Enter tracker home: /opt/roundup/trackers/support
195           Templates: classic
196           Select template [classic]: classic
197           Back ends: anydbm, mysql, sqlite
198           Select backend [anydbm]: anydbm
200       Note: "Back ends" selection list depends on availability of
201       third-party database modules.  Standard python distribution
202       includes anydbm module only.
204       The "support" part of the tracker name can be anything you want - it
205       is going to be used as the directory that the tracker information
206       will be stored in.
208       You will now be directed to edit the tracker configuration and
209       initial schema.  At a minimum, you must set "main :: admin_email"
210       (that's the "admin_email" option in the "main" section) "mail ::
211       host", "tracker :: web" and "mail :: domain".  If you get stuck,
212       and get configuration file errors, then see the `tracker
213       configuration`_ section of the `customisation documentation`_.
215       If you just want to get set up to test things quickly (and follow
216       the instructions in step 3 below), you can even just set the
217       "tracker :: web" variable to::
219          web = http://localhost:8080/support/
221       The URL *must* end in a '/', or your web interface *will not work*.
222       See `Customising Roundup`_ for details on configuration and schema
223       changes. You may change any of the configuration after
224       you've initialised the tracker - it's just better to have valid values
225       for this stuff now.
227    d. Initialise the tracker database with ``roundup-admin initialise``.
228       You will need to supply an admin password at this step. You will be
229       prompted::
231           Admin Password:
232                  Confirm:
234       Note: running this command will *destroy any existing data in the
235       database*. In the case of MySQL and PostgreSQL, any existing database
236       will be dropped and re-created.
238       Once this is done, the tracker has been created.
240 2. At this point, your tracker is set up, but doesn't have a nice user
241    interface. To set that up, we need to `configure a web interface`_ and
242    optionally `configure an email interface`_. If you want to try your
243    new tracker out, assuming "tracker :: web" is set to
244    ``'http://localhost:8080/support/'``, run::
246      roundup-server support=/opt/roundup/trackers/support
248    then direct your web browser at:
250      http://localhost:8080/support/
252    and you should see the tracker interface.
255 Choosing Your Template
256 ----------------------
258 Classic Template
259 ~~~~~~~~~~~~~~~~
261 The classic template is the one defined in the `Roundup Specification`_. It
262 holds issues which have priorities and statuses. Each issue may also have a
263 set of messages which are disseminated to the issue's list of nosy users.
265 Minimal Template
266 ~~~~~~~~~~~~~~~~
268 The minimal template has the minimum setup required for a tracker
269 installation. That is, it has the configuration files, defines a user database
270 and the basic HTML interface to that. It's a completely clean slate for you to
271 create your tracker on.
274 Choosing Your Backend
275 ---------------------
277 The actual storage of Roundup tracker information is handled by backends.
278 There's several to choose from, each with benefits and limitations:
280 ========== =========== ===== ==============================
281 Name       Speed       Users   Support
282 ========== =========== ===== ==============================
283 anydbm     Slowest     Few   Always available
284 sqlite     Fastest(*)  Few   May need install (PySQLite_)
285 postgresql Fast        Many  Needs install/admin (psycopg_)
286 mysql      Fast        Many  Needs install/admin (MySQLdb_)
287 ========== =========== ===== ==============================
289 **sqlite**
290   This uses the embedded database engine PySQLite_ to provide a very fast
291   backend. This is not suitable for trackers which will have many
292   simultaneous users, but requires much less installation and maintenance
293   effort than more scalable postgresql and mysql backends.
295   SQLite is supported via PySQLite versions 1.1.7, 2.1.0 and sqlite3 (the last
296   being bundled with Python 2.5+)
298   Installed SQLite should be the latest version available (3.3.8 is known
299   to work, 3.1.3 is known to have problems).
300 **postgresql**
301   Backend for popular RDBMS PostgreSQL. You must read doc/postgresql.txt for
302   additional installation steps and requirements. You must also configure
303   the ``rdbms`` section of your tracker's ``config.ini``.  It is recommended
304   that you use at least version 1.1.21 of psycopg.
305 **mysql**
306   Backend for popular RDBMS MySQL. You must read doc/mysql.txt for additional
307   installation steps and requirements. You must also configure the ``rdbms``
308   section of your tracker's ``config.ini``
310 You may defer your decision by setting your tracker up with the anydbm
311 backend (which is guaranteed to be available) and switching to one of the
312 other backends at any time using the instructions in the `administration
313 guide`_.
315 Regardless of which backend you choose, Roundup will attempt to initialise
316 a new database for you when you run the roundup-admin "initialise" command.
317 In the case of MySQL and PostgreSQL you will need to have the appropriate
318 privileges to create databases.
321 Configure a Web Interface
322 -------------------------
324 There are five web interfaces to choose from:
326 1. `web server cgi-bin`_
327 2. `cgi-bin for limited-access hosting`_
328 3. `stand-alone web server`_
329 4. `Zope product - ZRoundup`_
330 5. `Apache HTTP Server with mod_python`_
331 6. `WSGI handler`_
333 You may need to give the web server user permission to access the tracker home
334 - see the `UNIX environment steps`_ for information. You may also need to
335 configure your system in some way - see `platform-specific notes`_.
338 Web Server cgi-bin
339 ~~~~~~~~~~~~~~~~~~
341 A benefit of using the cgi-bin approach is that it's the easiest way to
342 restrict access to your tracker to only use HTTPS. Access will be slower
343 than through the `stand-alone web server`_ though.
345 If your Python isn't installed as "python" then you'll need to edit
346 the ``roundup.cgi`` script to fix the first line.
348 If you're using IIS on a Windows platform, you'll need to run this command
349 for the cgi to work (it turns on the PATH_INFO cgi variable)::
351     adsutil.vbs set w3svc/AllowPathInfoForScriptMappings TRUE
353 The ``adsutil.vbs`` file can be found in either ``c:\inetpub\adminscripts``
354 or ``c:\winnt\system32\inetsrv\adminsamples\`` or
355 ``c:\winnt\system32\inetsrv\adminscripts\`` depending on your installation.
357 More information about ISS setup may be found at:
359    http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B276494
361 Copy the ``frontends/roundup.cgi`` file to your web server's ``cgi-bin``
362 directory. You will need to configure it to tell it where your tracker home
363 is. You can do this either:
365 Through an environment variable
366   Set the variable TRACKER_HOMES to be a colon (":") separated list of
367   name=home pairs (if you're using apache, the SetEnv directive can do this)
369 Directly in the ``roundup.cgi`` file itself
370   Add your instance to the TRACKER_HOMES variable as ``'name': 'home'``
372 The "name" part of the configuration will appear in the URL and identifies the
373 tracker (so you may have more than one tracker per cgi-bin script). Make sure
374 there are no spaces or other illegal characters in it (to be safe, stick to
375 letters and numbers). The "name" forms part of the URL that appears in the
376 tracker config "tracker :: web" variable, so make sure they match. The "home"
377 part of the configuration is the tracker home directory.
379 If you're using Apache, you can use an additional trick to hide the
380 ``.cgi`` extension of the cgi script. Place the ``roundup.cgi`` script
381 wherever you want it to be, rename it to just ``roundup``, and add a
382 couple lines to your Apache configuration::
384  <Location /path/to/roundup>
385    SetHandler cgi-script
386  </Location>
389 CGI-bin for Limited-Access Hosting
390 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
392 If you are running in a shared-hosting environment or otherwise don't have
393 permissiong to edit the system web server's configuration, but can create a
394 ``.htaccess`` file then you may be able to use this approach.
396 1. Install flup_
397 2. Create a script ``roundup_stub`` in your server's ``cgi-bin`` directory
398    containing::
400     #!/usr/bin/env python
402     # if necessary modify the Python path to include the place you
403     # installed Roundup
404     #import sys
405     #sys.path.append('...')
407     # cgitb is needed for debugging in browser only
408     #import cgitb
409     #cgitb.enable()
411     # obtain the WSGI request dispatcher
412     from roundup.cgi.wsgi_handler import RequestDispatcher
413     tracker_home = '/path/to/tracker/home'
414     app = RequestDispatcher(tracker_home)
416     from flup.server.cgi import WSGIServer
417     WSGIServer(app).run()
419 3. Modify or created the ``.htaccess`` file in the desired (sub-)domain
420    directory to contain::
422     RewriteEngine On
423     RewriteBase /
424     RewriteRule ^(.*)$      /cgi-bin/roundup_stub/$1 [L]
426 Now loading the (sub-)domain in a browser should load the tracker web
427 interface. If you get a "500" error then enable the "cgitb" lines in the
428 stub to get some debugging information.
431 Stand-alone Web Server
432 ~~~~~~~~~~~~~~~~~~~~~~
434 This approach will give you faster response than cgi-bin. You may
435 investigate using ProxyPass or similar configuration in apache to have your
436 tracker accessed through the same URL as other systems.
438 The stand-alone web server is started with the command ``roundup-server``. It
439 has several options - display them with ``roundup-server -h``.
441 The tracker home configuration is similar to the cgi-bin - you may either edit
442 the script to change the TRACKER_HOMES variable or you may supply the
443 name=home values on the command-line after all the other options.
445 To make the server run in the background, use the "-d" option, specifying the
446 name of a file to write the server process id (pid) to.
449 Zope Product - ZRoundup
450 ~~~~~~~~~~~~~~~~~~~~~~~
452 ZRoundup installs as a regular Zope product. Copy the ZRoundup directory to
453 your Products directory either in INSTANCE_HOME/Products or the Zope
454 code tree lib/python/Products.
456 When you next (re)start up Zope, you will be able to add a ZRoundup object
457 that interfaces to your new tracker.
459 Apache HTTP Server with mod_python
460 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
462 `Mod_python`_ is an `Apache`_ module that embeds the Python interpreter
463 within the server.  Running Roundup this way is much faster than all
464 above options and, like `web server cgi-bin`_, allows you to use HTTPS
465 protocol.  The drawback is that this setup is more complicated.
467 The following instructions were tested on apache 2.0 with mod_python 3.1.
468 If you are using older versions, your mileage may vary.
470 Mod_python uses OS threads.  If your apache was built without threads
471 (quite commonly), you must load the threading library to run mod_python.
472 This is done by setting ``LD_PRELOAD`` to your threading library path
473 in apache ``envvars`` file.  Example for gentoo linux (``envvars`` file
474 is located in ``/usr/lib/apache2/build/``)::
476   LD_PRELOAD=/lib/libpthread.so.0
477   export LD_PRELOAD
479 Example for FreeBSD (``envvars`` is in ``/usr/local/sbin/``)::
481   LD_PRELOAD=/usr/lib/libc_r.so
482   export LD_PRELOAD
484 Next, you have to add Roundup trackers configuration to apache config.
485 Roundup apache interface uses the following options specified with
486 ``PythonOption`` directives:
488   TrackerHome:
489     defines the tracker home directory - the directory that was specified
490     when you did ``roundup-admin init``.  This option is required.
492   TrackerLanguage:
493     defines web user interface language.  mod_python applications do not
494     receive OS environment variables in the same way as command-line
495     programs, so the language cannot be selected by setting commonly
496     used variables like ``LANG`` or ``LC_ALL``.  ``TrackerLanguage``
497     value has the same syntax as values of these environment variables.
498     This option may be omitted.
500   TrackerDebug:
501     run the tracker in debug mode.  Setting this option to ``yes`` or
502     ``true`` has the same effect as running ``roundup-server -t debug``:
503     the database schema and used html templates are rebuilt for each
504     HTTP request.  Values ``no`` or ``false`` mean that all html
505     templates for the tracker are compiled and the database schema is
506     checked once at startup.  This is the default behaviour.
508   TrackerTiming:
509     has nearly the same effect as environment variable ``CGI_SHOW_TIMING``
510     for standalone roundup server.  The difference is that setting this
511     option to ``no`` or ``false`` disables timings display.  Value
512     ``comment`` writes request handling times in html comment, and
513     any other non-empty value makes timing report visible.  By default,
514     timing display is disabled.
516 In the following example we have two trackers set up in
517 ``/var/db/roundup/support`` and ``/var/db/roundup/devel`` and accessed
518 as ``https://my.host/roundup/support/`` and ``https://my.host/roundup/devel/``
519 respectively (provided Apache has been set up for SSL of course).
520 Having them share same parent directory allows us to
521 reduce the number of configuration directives.  Support tracker has
522 russian user interface.  The other tracker (devel) has english user
523 interface (default).
525 Static files from ``html`` directory are served by apache itself - this
526 is quicker and generally more robust than doing that from python.
527 Everything else is aliased to dummy (non-existing) ``py`` file,
528 which is handled by mod_python and our roundup module.
530 Example mod_python configuration::
532     #################################################
533     # Roundup Issue tracker
534     #################################################
535     # enable Python optimizations (like 'python -O')
536     PythonOptimize On
537     # let apache handle static files from 'html' directories
538     AliasMatch /roundup/(.+)/@@file/(.*) /var/db/roundup/$1/html/$2
539     # everything else is handled by roundup web UI
540     AliasMatch /roundup/([^/]+)/(?!@@file/)(.*) /var/db/roundup/$1/dummy.py/$2
541     # roundup requires a slash after tracker name - add it if missing
542     RedirectMatch permanent ^/roundup/([^/]+)$ /roundup/$1/
543     # common settings for all roundup trackers
544     <Directory /var/db/roundup/*>
545       Order allow,deny
546       Allow from all
547       AllowOverride None
548       Options None
549       AddHandler python-program .py
550       PythonHandler roundup.cgi.apache
551       # uncomment the following line to see tracebacks in the browser
552       # (note that *some* tracebacks will be displayed anyway)
553       #PythonDebug On
554     </Directory>
555     # roundup tracker homes
556     <Directory /var/db/roundup/support>
557       PythonOption TrackerHome /var/db/roundup/support
558       PythonOption TrackerLanguage ru
559     </Directory>
560     <Directory /var/db/roundup/devel>
561       PythonOption TrackerHome /var/db/roundup/devel
562     </Directory>
564 Notice that the ``/var/db/roundup`` path shown above refers to the directory
565 in which the tracker homes are stored. The actual value will thus depend on
566 your system.
568 On Windows the corresponding lines will look similar to these::
570     AliasMatch /roundup/(.+)/@@file/(.*) C:/DATA/roundup/$1/html/$2
571     AliasMatch /roundup/([^/]+)/(?!@@file/)(.*) C:/DATA/roundup/$1/dummy.py/$2
572     <Directory C:/DATA/roundup/*>
573     <Directory C:/DATA/roundup/support>
574     <Directory C:/DATA/roundup/devel>
576 In this example the directory hosting all of the tracker homes is
577 ``C:\DATA\roundup``. (Notice that you must use forward slashes in paths
578 inside the httpd.conf file!)
580 The URL for accessing these trackers then become:
581 `http://<roundupserver>/roundup/support/`` and
582 ``http://<roundupserver>/roundup/devel/``
584 Note that in order to use https connections you must set up Apache for secure
585 serving with SSL.
587 WSGI Handler
588 ~~~~~~~~~~~~
590 The WSGI handler is quite simple. The following sample code shows how
591 to use it::
593     from wsgiref.simple_server import make_server
595     # obtain the WSGI request dispatcher
596     from roundup.cgi.wsgi_handler import RequestDispatcher
597     tracker_home = 'demo'
598     app = RequestDispatcher(tracker_home)
600     httpd = make_server('', 8917, app)
601     httpd.serve_forever()
603 To test the above you should create a demo tracker with ``python demo.py``.
604 Edit the ``config.ini`` to change the web URL to "http://localhost:8917/".
607 Configure an Email Interface
608 ----------------------------
610 If you don't want to use the email component of Roundup, then remove the
611 "``nosyreaction.py``" module from your tracker "``detectors``" directory.
613 See `platform-specific notes`_ for steps that may be needed on your system.
615 There are five supported ways to get emailed issues into the
616 Roundup tracker.  You should pick ONE of the following, all
617 of which will continue my example setup from above:
619 As a mail alias pipe process
620 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
622 Set up a mail alias called "issue_tracker" as (include the quote marks):
623 "``|/usr/bin/python /usr/bin/roundup-mailgw <tracker_home>``"
624 (substitute ``/usr/bin`` for wherever roundup-mailgw is installed).
626 In some installations (e.g. RedHat Linux and Fedora Core) you'll need to
627 set up smrsh so sendmail will accept the pipe command. In that case,
628 symlink ``/etc/smrsh/roundup-mailgw`` to "``/usr/bin/roundup-mailgw``"
629 and change the command to::
631     |roundup-mailgw /opt/roundup/trackers/support
633 To test the mail gateway on unix systems, try::
635     echo test |mail -s '[issue] test' support@YOUR_DOMAIN_HERE
637 Be careful that some mail systems (postfix for example) will impost a
638 limits on processes they spawn. In particular postfix can set a file size
639 limit. *This can cause your Roundup database to become corrupted.*
642 As a custom router/transport using a pipe process (Exim4 specific)
643 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
645 The following configuration snippets for `Exim 4`_ configuration
646 implement a custom router & transport to accomplish mail delivery to
647 roundup-mailgw. A configuration for Exim3 is similar but not
648 included, since Exim3 is considered obsolete.
650 .. _Exim 4: http://www.exim.org/
652 This configuration is similar to the previous section, in that it uses
653 a pipe process. However, there are advantages to using a custom
654 router/transport process, if you are using Exim.
656 * This avoids privilege escalation, since otherwise the pipe process
657   will run as the mail user, typically mail. The transport can be
658   configured to run as the user appropriate for the task at hand. In the
659   transport described in this section, Exim4 runs as the unprivileged
660   user ``roundup``.
662 * Separate configuration is not required for each tracker
663   instance. When a email arrives at the server, Exim passes it through
664   the defined routers. The roundup_router looks for a match with one of
665   the roundup directories, and if there is one it is passed to the
666   roundup_transport, which uses the pipe process described in the
667   previous section (`As a mail alias pipe process`_).
669 The matching is done in the line::
671   require_files = /usr/bin/roundup-mailgw:ROUNDUP_HOME/$local_part/schema.py
673 The following configuration has been tested on Debian Sarge with
674 Exim4.
676 .. note::
677   Note that the Debian Exim4 packages don't allow pipes in alias files
678   by default, so the method described in the section `As a mail alias
679   pipe process`_ will not work with the default configuration. However,
680   the method described in this section does. See the discussion in
681   ``/usr/share/doc/exim4-config/README.system_aliases`` on any Debian
682   system with Exim4 installed.
684   For more Debian-specific information, see suggested addition to
685   README.Debian in
686   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=343283, which will
687   hopefully be merged into the Debian package eventually.
689 This config makes a few assumptions:
691 * That the mail address corresponding to the tracker instance has the
692   same name as the directory of the tracker instance, i.e. the mail
693   interface address corresponding to a Roundup instance called
694   ``/var/lib/roundup/trackers/mytracker`` is ``mytracker@your.host``.
696 * That (at least) all the db subdirectories of all the tracker
697   instances (ie. ``/var/lib/roundup/trackers/*/db``) are owned by the same
698   user, in this case, 'roundup'.
700 * That if the ``schema.py`` file exists, then the tracker is ready for
701   use. Another option is to use the ``config.ini`` file (this changed
702   in 0.8 from ``config.py``).
704 Macros for Roundup router/transport. Should be placed in the macros
705 section of the Exim4 config::
707   # Home dir for your Roundup installation
708   ROUNDUP_HOME=/var/lib/roundup/trackers
710   # User and group for Roundup.
711   ROUNDUP_USER=roundup
712   ROUNDUP_GROUP=roundup
714 Custom router for Roundup. This will (probably) work if placed at the
715 beginning of the router section of the Exim4 config::
717   roundup_router:
718       driver = accept
719       # The config file config.ini seems like a more natural choice, but the
720       # file config.py was replaced by config.ini in 0.8, and schema.py needs
721       # to be present too.
722       require_files = /usr/bin/roundup-mailgw:ROUNDUP_HOME/$local_part/schema.py
723       transport = roundup_transport
725 Custom transport for Roundup. This will (probably) work if placed at
726 the beginning of the router section of the Exim4 config::
728   roundup_transport:
729       driver = pipe
730       command = /usr/bin/python /usr/bin/roundup-mailgw ROUNDUP_HOME/$local_part/
731       current_directory = ROUNDUP_HOME
732       home_directory = ROUNDUP_HOME
733       user = ROUNDUP_USER
734       group = ROUNDUP_GROUP
736 As a regular job using a mailbox source
737 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
739 Set ``roundup-mailgw`` up to run every 10 minutes or so. For example
740 (substitute ``/usr/bin`` for wherever roundup-mailgw is installed)::
742   0,10,20,30,40,50 * * * * /usr/bin/roundup-mailgw /opt/roundup/trackers/support mailbox <mail_spool_file>
744 Where the ``mail_spool_file`` argument is the location of the roundup submission
745 user's mail spool. On most systems, the spool for a user "issue_tracker"
746 will be "``/var/mail/issue_tracker``".
748 As a regular job using a POP source
749 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
751 To retrieve from a POP mailbox, use a *cron* entry similar to the mailbox
752 one (substitute ``/usr/bin`` for wherever roundup-mailgw is
753 installed)::
755   0,10,20,30,40,50 * * * * /usr/bin/roundup-mailgw /opt/roundup/trackers/support pop <pop_spec>
757 where pop_spec is "``username:password@server``" that specifies the roundup
758 submission user's POP account name, password and server.
760 On windows, you would set up the command using the windows scheduler.
762 As a regular job using an IMAP source
763 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
765 To retrieve from an IMAP mailbox, use a *cron* entry similar to the
766 POP one (substitute ``/usr/bin`` for wherever roundup-mailgw is
767 installed)::
769   0,10,20,30,40,50 * * * * /usr/bin/roundup-mailgw /opt/roundup/trackers/support imap <imap_spec>
771 where imap_spec is "``username:password@server``" that specifies the roundup
772 submission user's IMAP account name, password and server. You may
773 optionally include a mailbox to use other than the default ``INBOX`` with
774 "``imap username:password@server mailbox``".
776 If you have a secure (ie. HTTPS) IMAP server then you may use ``imaps``
777 in place of ``imap`` in the command to use a secure connection.
779 As with the POP job, on windows, you would set up the command using the
780 windows scheduler.
783 UNIX Environment Steps
784 ----------------------
786 Each tracker ideally should have its own UNIX group, so create
787 a UNIX group (edit ``/etc/group`` or your appropriate NIS map if
788 you're using NIS).  To continue with my examples so far, I would
789 create the UNIX group 'support', although the name of the UNIX
790 group does not have to be the same as the tracker name.  To this
791 'support' group I then add all of the UNIX usernames who will be
792 working with this Roundup tracker.  In addition to 'real' users,
793 the Roundup email gateway will need to have permissions to this
794 area as well, so add the user your mail service runs as to the
795 group (typically "mail" or "daemon").  The UNIX group might then
796 look like::
798      support:*:1002:jblaine,samh,geezer,mail
800 If you intend to use the web interface (as most people do), you
801 should also add the username your web server runs as to the group.
802 My group now looks like this::
804      support:*:1002:jblaine,samh,geezer,mail,apache
806 The tracker "db" directory should be chmod'ed g+sw so that the group can
807 write to the database, and any new files created in the database will be owned
808 by the group.
810 If you're using the mysql or postgresql backend then you'll need to ensure
811 that the tracker user has appropriate permissions to create/modify the
812 database. If you're using roundup.cgi, the apache user needs permissions
813 to modify the database.  Alternatively, explicitly specify a database login
814 in ``rdbms`` -> ``user`` and ``password`` in ``config.ini``.
816 An alternative to the above is to create a new user who has the sole
817 responsibility of running roundup. This user:
819 1. runs the CGI interface daemon
820 2. runs regular polls for email
821 3. runs regular checks (using cron) to ensure the daemon is up
822 4. optionally has no login password so that nobody but the "root" user
823    may actually login and play with the roundup setup.
825 If you're using a Linux system (e.g. Fedora Core) with SELinux enabled,
826 you will need to ensure that the db directory has a context that
827 permits the web server to modify and create files. If you're using the
828 mysql or postgresql backend you may also need to update your policy to
829 allow the web server to access the database socket.
832 Additional Language Codecs
833 --------------------------
835 If you intend to send messages to Roundup that use Chinese, Japanese or
836 Korean encodings the you'll need to obtain CJKCodecs from
837 http://cjkpython.berlios.de/
840 Public Tracker Considerations
841 -----------------------------
843 If you run a public tracker, you will eventually have to think about
844 dealing with spam entered through both the web and mail interfaces.
846 The `customisation documentation`_ has a simple detector that will block
847 a lot of spam attempts. Look for the example "Preventing SPAM".
850 Maintenance
851 ===========
853 Read the separate `administration guide`_ for information about how to
854 perform common maintenance tasks with Roundup.
857 Upgrading
858 =========
860 Read the separate `upgrading document`_, which describes the steps needed to
861 upgrade existing tracker trackers for each version of Roundup that is
862 released.
865 Further Reading
866 ===============
868 If you intend to use Roundup with anything other than the default
869 templates, if you would like to hack on Roundup, or if you would
870 like implementation details, you should read `Customising Roundup`_.
873 Running Multiple Trackers
874 =========================
876 Things to think about before you jump off the deep end and install
877 multiple trackers, which involve additional URLs, user databases, email
878 addresses, databases to back up, etc.
880 1. Do you want a tracker per product you sell/support? You can just add
881    a new property to your issues called Product, and filter by that. See
882    the customisation example `adding a new field to the classic schema`_.
883 2. Do you want to track internal software development issues and customer
884    support issues separately? You can just set up an additional "issue"
885    class called "cust_issues" in the same tracker, mimicing the normal
886    "issue" class, but with different properties. See the customisation
887    example `tracking different types of issues`_.
890 Platform-Specific Notes
891 =======================
893 Windows command-line tools
894 --------------------------
896 To make the command-line tools accessible in Windows, you need to update
897 the "Path" environment variable in the Registry via a dialog box.
899 On Windows 2000 and later:
901 1) Press the "Start" button.
902 2) Choose "Settings"
903 3) Choose "Control Panel"
904 4) Choose "System"
905 5) Choose "Advanced"
906 6) Choose "Environmental Variables"
907 7) Add: "<dir>\Scripts" to the "Path" environmental variable.
909 Where <dir> in 7) is the root directory (e.g., ``C:\Python22\Scripts``)
910 of your Python installation.
912 I understand that in XP, 2) above is not needed as "Control
913 Panel" is directly accessible from "Start".
915 I do not believe this is possible to do in previous versions of Windows.
918 Windows Server
919 --------------
921 To have the Roundup web server start up when your machine boots up, there
922 are two different methods, the scheduler and installing the service.
925 1. Using the Windows scheduler
926 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
928 Set up the following in Scheduled Tasks (note, the following is for a
929 cygwin setup):
931 **Run**
933     ``c:\cygwin\bin\bash.exe -c "roundup-server TheProject=/opt/roundup/trackers/support"``
935 **Start In**
937     ``C:\cygwin\opt\roundup\bin``
939 **Schedule**
941     At System Startup
943 To have the Roundup mail gateway run periodically to poll a POP email address,
944 set up the following in Scheduled Tasks:
946 **Run**
948     ``c:\cygwin\bin\bash.exe -c "roundup-mailgw /opt/roundup/trackers/support pop roundup:roundup@mail-server"``
950 **Start In**
952     ``C:\cygwin\opt\roundup\bin``
954 **Schedule**
956     Every 10 minutes from 5:00AM for 24 hours every day
958     Stop the task if it runs for 8 minutes
961 2. Installing the roundup server as a Windows service
962 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
964 This is more Windows oriented and will make the Roundup server run as
965 soon as the PC starts up without any need for a login or such. It will
966 also be available in the normal Windows Administrative Tools.
968 For this you need first to create a service ini file containing the
969 relevant settings.
971 1. It is created if you execute the following command from within the
972    scripts directory (notice the use of backslashes)::
974      roundup-server -S -C <trackersdir>\server.ini -n <servername> -p 8080 -l <trackersdir>\trackerlog.log software=<trackersdir>\Software
976    where the item ``<trackersdir>`` is replaced with the physical directory
977    that hosts all of your trackers. The ``<servername>`` item is the name
978    of your roundup server PC, such as w2003srv or similar.
980 2. Next open the now created file ``C:\DATA\roundup\server.ini`` file
981    (if your ``<trackersdir>`` is ``C:\DATA\roundup``).
982    Check the entries for correctness, especially this one::
984     [trackers]
985     software = C:\DATA\Roundup\Software
987    (this is an example where the tracker is named software and its home is
988    ``C:\DATA\Roundup\Software``)
990 3. Next give the commands that actually installs and starts the service::
992     roundup-server -C C:\DATA\Roundup\server.ini -c install
993     roundup-server -c start
995 4. Finally open the AdministrativeTools/Services applet and locate the
996    Roundup service entry. Open its properties and change it to start
997    automatically instead of manually.
999 If you are using Apache as the webserver you might want to use it with
1000 mod_python instead to serve out Roundup. In that case see the mod_python
1001 instructions above for details.
1004 Sendmail smrsh
1005 --------------
1007 If you use Sendmail's ``smrsh`` mechanism, you will need to tell
1008 smrsh that roundup-mailgw is a valid/trusted mail handler
1009 before it will work.
1011 This is usually done via the following 2 steps:
1013 1. make a symlink in ``/etc/smrsh`` called ``roundup-mailgw``
1014    which points to the full path of your actual ``roundup-mailgw``
1015    script.
1017 2. change your alias to ``"|roundup-mailgw <tracker_home>"``
1020 Linux
1021 -----
1023 Make sure you read the instructions under `UNIX environment steps`_.
1026 Solaris
1027 -------
1029 You'll need to build Python.
1031 Make sure you read the instructions under `UNIX environment steps`_.
1034 Problems? Testing your Python...
1035 ================================
1037 .. note::
1038    The ``run_tests.py`` script is packaged in Roundup's source distribution
1039    - users of the Windows installer, other binary distributions or
1040    pre-installed Roundup will need to download the source to use it.
1042    Remember to have a database user 'rounduptest' prepared (with
1043    password 'rounduptest'). This user
1044    must have at least the rights to create and drop databases.
1045    Documentation: details on `adding MySQL users`_,
1046    for PostgreSQL you want to call the ``createuser`` command with the
1047    ``-d`` option to allow database creation.
1049 Once you've unpacked roundup's source, run ``python run_tests.py`` in the
1050 source directory and make sure there are no errors. If there are errors,
1051 please let us know!
1053 If the above fails, you may be using the wrong version of python. Try
1054 ``python2 run_tests.py`` or ``python2.X run_tests.py`` where ``X`` is in
1055 the set 3,4,5,6 depending on the version(s) of python installed.
1056 If that works, you will need to substitute ``python2`` or ``python2.X``
1057 for ``python`` in all further commands you use in relation to Roundup --
1058 from installation and scripts.
1061 .. _`table of contents`: index.html
1062 .. _`user guide`: user_guide.html
1063 .. _`roundup specification`: spec.html
1064 .. _`tracker configuration`: customizing.html#tracker-configuration
1065 .. _`customisation documentation`: customizing.html
1066 .. _`Adding a new field to the classic schema`:
1067    customizing.html#adding-a-new-field-to-the-classic-schema
1068 .. _`Tracking different types of issues`:
1069    customizing.html#tracking-different-types-of-issues
1070 .. _`customising roundup`: customizing.html
1071 .. _`upgrading document`: upgrading.html
1072 .. _`administration guide`: admin_guide.html
1075 .. _External hyperlink targets:
1077 .. _apache: http://httpd.apache.org/
1078 .. _flup: http://pypi.python.org/pypi/flup
1079 .. _mod_python: http://www.modpython.org/
1080 .. _MySQLdb: http://sourceforge.net/projects/mysql-python
1081 .. _Psycopg: http://initd.org/software/initd/psycopg
1082 .. _pysqlite: http://pysqlite.org/
1083 .. _`adding MySQL users`:
1084     http://dev.mysql.com/doc/refman/5.1/en/adding-users.html