Code

merge from maintenance branch
[roundup.git] / doc / installation.txt
1 ==================
2 Installing Roundup
3 ==================
5 :Version: $Revision: 1.30 $
7 .. contents::
10 Overview
11 ========
13 Broken out separately, there are several conceptual pieces to a
14 Roundup installation:
16 Roundup trackers
17  Trackers consist of issues (be they bug reports or otherwise), tracker
18  configuration file(s), web HTML files etc. Roundup trackers are initialised
19  with a "Template" which defines the fields usable/assignable on a
20  per-issue basis.  Descriptions of the provided templates are given in
21  `choosing your template`_.
23 Roundup support code
24  Installed into your Python install's lib directory
26 Roundup scripts
27  These include the email gateway, the roundup
28  HTTP server, the roundup administration command-line interface, etc.
31 Prerequisites
32 =============
34 Python 2.1.1 or newer with a functioning anydbm or bsddb module. Download the
35 latest version from http://www.python.org/. It is highly recommended that
36 users install the latest patch version of python - 2.1.3 or 2.2.1 - as these
37 contain many fixes to serious bugs.
39 If you want to use Berkeley DB bsddb3 with Roundup, use version 3.3.0 or
40 later. Download the latest version from http://pybsddb.sourceforge.net/.
43 Getting Roundup
44 ===============
46 Download the latest version from http://roundup.sf.net/.
48 Testing your Python
49 -------------------
51 Once you've unpacked roundup's source, run ``python ./run_tests`` in the
52 source directory and make sure there are no errors.
53 If there are errors, please let us know!
55 If the above fails, you may be using the wrong version of python. Try
56 ``python2 ./run_tests``. If that works, you will need to substitute
57 ``python2`` for ``python`` in all further commands you use in relation to
58 Roundup -- from installation and scripts.
61 Installation
62 ============
64 Set aside 15-30 minutes. Please make sure you're using a supported version of
65 Python -- see `testing your python`_. There's four steps to follow in your
66 installation:
68 1. `basic installation steps`_ that all installers must follow
69 2. then optionally `configure a web interface`_
70 3. and optionally `configure an email interface`_
71 4. `shared environment steps`_ to take if you're installing on a shared
72    UNIX machine and want to restrict local access to roundup
74 Most users will only need to follow the first step, since the environment will
75 be a trusted one.
78 Basic Installation Steps
79 ------------------------
81 1. To install the Roundup support code into your Python tree and
82    Roundup scripts into /usr/local/bin::
84        python setup.py install
86    If you would like to place the Roundup scripts in a directory other
87    than ``/usr/local/bin``, then specify the preferred location with
88    ``--install-script``. For example, to install them in
89    ``/opt/roundup/bin``::
91        python setup.py install --install-scripts=/opt/roundup/bin
93 2. To create a Roundup tracker (necessary to do before you can
94    use the software in any real fashion):
96    a. (Optional) If you intend to keep your roundup trackers
97       under one top level directory which does not exist yet,
98       you should create that directory now.  Example::
100          mkdir /opt/roundup/trackers
102    b. Either add the Roundup script location to your ``PATH``
103       environment variable or specify the full path to
104       the command in the next step.
106    c. Install a new tracker with the command ``roundup-admin install``.
107       You will be asked a series of questions.  Descriptions of the provided
108       templates can be found in `choosing your template`_ below.  Descriptions
109       of the available backends can be found in `choosing your backend`_
110       below.  The questions will be something like (you may have more
111       templates or backends available)::
113           Enter tracker home: /opt/roundup/trackers/support
114           Templates: classic
115           Select template [classic]: classic
116           Back ends: anydbm, bsddb
117           Select backend [anydbm]: anydbm
119       You will now be directed to edit the tracker configuration and
120       initial schema.  At a minimum, you must set ``MAILHOST``,
121       ``TRACKER_WEB``, ``MAIL_DOMAIN`` and ``ADMIN_EMAIL``. If you just want
122       to get set up to test things quickly, you can even just set the
123       TRACKER_WEB variable to::
125          TRACKER_WEB = 'http://localhost:8080/support/'
127       See `Customising Roundup`_ for details on configuration
128       and schema changes. Note that you may change any of the configuration
129       after you've initialised the tracker - it's just better to have valid
130       values for this stuff now.
132    d. Initialise the tracker database with ``roundup-admin initialise``.
133       You will need to supply an admin password at this step. You will be
134       prompted::
136           Admin Password:
137                  Confirm:
139       Once this is done, the tracker has been created.
141 3. At this point, your tracker is set up, but doesn't have a nice user
142    interface. To set that up, we need to `configure a web interface`_ and
143    optionally `configure an email interface`_. To quickly test the web
144    interface, assuming ``TRACKER_WEB`` is set to
145    ``'http://localhost:8080/support/'``::
147      roundup-server -p 8080 support=/opt/roundup/trackers/support
149    then direct your web browser at:
151      http://locahost:8080/support/
153    and you should see the tracker interface.
156 Choosing Your Template
157 ----------------------
159 Classic Template
160 ~~~~~~~~~~~~~~~~
162 The classic template is the one defined in the `Roundup Specification`_. It
163 holds issues which have priorities and statuses. Each issue may also have a
164 set of messages which are disseminated to the issue's list of nosy users.
166 Minimal Template
167 ~~~~~~~~~~~~~~~~
169 The minimal template has the minimum setup required for a tracker
170 installation. That is, it has the configuration files, defines a user database
171 and the basic HTML interface to that. It's a completely clean slate for you to
172 create your tracker on.
175 Choosing Your Backend
176 ---------------------
178 The actual storage of Roundup tracker information is handled by backends.
179 There's several to choose from, each with benefits and limitations:
181 **anydbm**
182   This backend is guaranteed to work on any system that Python runs on. It
183   will generally choose the best dbm backend that is available on your system
184   (from the list dbhash, gdbm, dbm, dumbdbm). It is the least scaleable of all
185   backends, but performs well enough for a smallish tracker (a couple of
186   thousand issues, under fifty users, ...).
187 **bsddb**
188   This effectively the same as anydbm, but uses the bsddb backend. This allows
189   it to gain some performance and scaling benefits.
190 **bsddb3**
191   Again, this effectively the same as anydbm, but uses the bsddb3 backend.
192   This allows it to gain some performance and scaling benefits.
193 **sqlite**
194   This uses the SQLite_ embedded RDBMS to provide a fast, scaleable backend.
195   There are no limitations, and it's much faster and more scaleable than the
196   dbm backends.
197 **metakit**
198   This backend is implemented over the metakit_ storage system, using Mk4Py as
199   the interface. It scales much better than the dbm backends.
200 **gadfly**
201   This is a proof-of-concept relational database backend, not really intended
202   for actual production use, although it can be. It uses the Gadfly RDBMS
203   to store data. It is unable to perform string searches due to gadfly not
204   having a LIKE operation. It should scale well, assuming a client/server
205   setup is used. It's much slower than even the dbm backends.
207 Note: you may set your tracker up with the anydbm backend (which is guaranteed
208 to be available) and switch to one of the other backends at any time using the
209 instructions in the `maintenance documentation`_.
212 Configure a Web Interface
213 -------------------------
215 There are three web interfaces to choose from:
217 1. `web server cgi-bin`_
218 2. `stand-alone web server`_
219 3. `Zope product - ZRoundup`_
221 You may need to give the web server user permission to access the tracker home
222 - see the `shared environment steps`_ for information.
225 Web Server cgi-bin
226 ~~~~~~~~~~~~~~~~~~
228 A benefit of using the cgi-bin approach is that it's the easiest way to
229 restrict access to your tracker to only use HTTPS. Access will be slower
230 than through the `stand-alone web server`_ though.
232 Copy the ``cgi-bin/roundup.cgi`` file to your web server's ``cgi-bin``
233 directory. You will need to configure it to tell it where your tracker home
234 is. You can do this either:
236 through an environment variable
237  set the variable TRACKER_HOMES to be a colon (":") separated list of
238  name=home pairs (if you're using apache, the SetEnv directive can do this)
239 directly in the ``roundup.cgi`` file itself
240  add your instance to the TRACKER_HOMES variable as ``'name': 'home'``
242 The "name" part of the configuration will appear in the URL and identifies the
243 tracker (so you may have more than one tracker per cgi-bin script). Make sure
244 there are no spaces or other illegal characters in it (to be safe, stick to
245 letters and numbers). The "name" forms part of the URL that appears in the
246 tracker config TRACKER_WEB variable, so make sure they match. The "home"
247 part of the configuration is the tracker home directory.
249 Stand-alone Web Server
250 ~~~~~~~~~~~~~~~~~~~~~~
252 This approach will give you the fastest of the three web interfaces. You may
253 investigate using ProxyPass or similar configuration in apache to have your
254 tracker accessed through the same URL as other systems.
256 The stand-alone web server is started with the command ``roundup-server``. It
257 has several options - display them with ``roundup-server -h``.
259 The tracker home configuration is similar to the cgi-bin - you may either edit
260 the script to change the TRACKER_HOMES variable or you may supply the
261 name=home values on the command-line after all the other options.
263 To make the server run in the background, use the "-d" option, specifying the
264 name of a file to write the server process id (pid) to.
267 Zope Product - ZRoundup
268 ~~~~~~~~~~~~~~~~~~~~~~~
270 ZRoundup installs as a regular Zope product. Copy the ZRoundup directory to
271 your Products directory either in INSTANCE_HOME/Products or the Zope
272 code tree lib/python/Products.
274 When you next (re)start up Zope, you will be able to add a ZRoundup object
275 that interfaces to your new tracker.
278 Configure an Email Interface
279 ----------------------------
281 If you don't want to use the email component of Roundup, then remove the
282 "``nosyreator.py``" module from your tracker "``detectors``" directory.
284 There are three supported ways to get emailed issues into the
285 Roundup tracker.  You should pick ONE of the following, all
286 of which will continue my example setup from above:
288 As a mail alias pipe process 
289 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291 Set up a mail alias called "issue_tracker" as (include the quote marks):
292 "``|/usr/bin/python /usr/local/bin/roundup-mailgw <tracker_home>``"
294 In some installations (e.g. RedHat 6.2 I think) you'll need to set up smrsh so
295 sendmail will accept the pipe command. In that case, symlink
296 ``/etc/smrsh/roundup-mailgw`` to "``/usr/local/bin/roundup-mailgw``" and change
297 the command to::
299     |roundup-mailgw /opt/roundup/trackers/support
300  
301 To test the mail gateway on unix systems, try::
303     echo test |mail -s '[issue] test' support@YOUR_DOMAIN_HERE
305 As a regular cron job using a mailbox source
306 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308 Set ``roundup-mailgw`` up to run every 10 minutes or so. For example::
310   10 * * * * /usr/local/bin/roundup-mailgw /opt/roundup/trackers/support mailbox <mail_spool_file>
312 Where the ``mail_spool_file`` argument is the location of the roundup submission
313 user's mail spool. On most systems, the spool for a user "issue_tracker"
314 will be "``/var/mail/issue_tracker``".
316 As a regular cron job using a POP source
317 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
319 To retrieve from a POP mailbox, use a similar cron entry to the mailbox one::
321   10 * * * * /usr/local/bin/roundup-mailgw /opt/roundup/trackers/support pop <pop_spec>
322     
323 where pop_spec is "``username:password@server``" that specifies the roundup
324 submission user's POP account name, password and server.
327 Shared Environment Steps
328 ------------------------
330 Each tracker ideally should have its own UNIX group, so create
331 a UNIX group (edit ``/etc/group`` or your appropriate NIS map if
332 you're using NIS).  To continue with my examples so far, I would
333 create the UNIX group 'support', although the name of the UNIX
334 group does not have to be the same as the tracker name.  To this
335 'support' group I then add all of the UNIX usernames who will be
336 working with this Roundup tracker.  In addition to 'real' users,
337 the Roundup email gateway will need to have permissions to this
338 area as well, so add the user your mail service runs as to the
339 group.  The UNIX group might then look like::
341      support:*:1002:jblaine,samh,geezer,mail
343 If you intend to use the web interface (as most people do), you
344 should also add the username your web server runs as to the group.
345 My group now looks like this::
347      support:*:1002:jblaine,samh,geezer,mail,apache
349 The tracker "db" directory should be chmod'ed g+sw so that the group can
350 write to the database, and any new files created in the database will be owned
351 by the group.
353 An alternative to the above is to create a new user who has the sole
354 responsibility of running roundup. This user:
356 1. runs the CGI interface daemon
357 2. runs regular polls for email
358 3. runs regular checks (using cron) to ensure the daemon is up
359 4. optionally has no login password so that nobody but the "root" user
360    may actually login and play with the roundup setup.
363 Maintenance
364 ===========
366 Read the separate `maintenance documentation`_ for information about how to
367 perform common maintenance tasks with Roundup.
370 Upgrading
371 =========
373 Read the separate `upgrading document`_, which describes the steps needed to
374 upgrade existing tracker trackers for each version of Roundup that is
375 released.
378 Further Reading
379 ===============
381 If you intend to use Roundup with anything other than the defualt
382 templates, if you would like to hack on Roundup, or if you would
383 like implementation details, you should read `Customising Roundup`_.
386 Platform-Specific Notes
387 =======================
389 Sendmail smrsh
390 --------------
392 If you use Sendmail's ``smrsh`` mechanism, you will need to tell
393 smrsh that roundup-mailgw is a valid/trusted mail handler
394 before it will work.
396 This is usually done via the following 2 steps:
398 1. make a symlink in ``/etc/smrsh`` called ``roundup-mailgw``
399    which points to the full path of your actual ``roundup-mailgw``
400    script.
402 2. change your alias to ``"|roundup-mailgw <tracker_home>"``
405 Linux
406 -----
408 Python 2.1.1 as shipped with SuSE7.3 might be missing module
409 ``_weakref``.
411 -------------------------------------------------------------------------------
413 Back to `Table of Contents`_
415 Next: `Getting Started`_
417 .. _`table of contents`: index.html
418 .. _`getting started`: getting_started.html
419 .. _`roundup specification`: spec.html
420 .. _`customising roundup`: customizing.html
421 .. _`upgrading document`: upgrading.html
422 .. _`maintenance documentation`: maintenance.html
423 .. _sqlite: http://www.hwaci.com/sw/sqlite/
424 .. _metakit: http://www.equi4.com/metakit/