~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to doc/man/install.rst

  • Committer: William Grant
  • Date: 2010-02-26 07:41:19 UTC
  • Revision ID: grantw@unimelb.edu.au-20100226074119-9kfkvp9uc9vk59mq
Increment version to 1.0rc2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
of the shared services on the master.
69
69
 
70
70
For a small instance a slave may be run on the same machine as the master.
71
 
This is the setup described on this page.
72
 
 
73
 
 
74
 
Installing from a Debian package
75
 
================================
76
 
 
77
 
.. _database-setup:
 
71
This is the setup described in the source installation section, while the
 
72
Ubuntu package installation section describes a multi-node configuration.
78
73
 
79
74
 
80
75
Installing from source
82
77
 
83
78
When setting up a development IVLE environment on Ubuntu 9.04 or later,
84
79
there are scripts to automate most of the process. First get and extract
85
 
a release, or check out the latest code from the bzr branch: ::
 
80
`a release tarball <https://launchpad.net/ivle/+download>`, or check out
 
81
the latest code from the Bazaar branch: ::
86
82
 
87
83
   bzr get lp:ivle
88
84
 
90
86
source tree. The remaining steps assume that you are in this new
91
87
directory.
92
88
 
 
89
 
 
90
Automated setup
 
91
---------------
 
92
 
93
93
The ``ivle-dev-setup`` script will configure PostgreSQL, Apache, IVLE
94
94
and the filesystem to cooperate, getting you most of the way to a
95
95
working system in just one step: ::
166
166
    python-formencode python-genshi python-psycopg2 python-svn python-storm \
167
167
    libjs-jquery postgresql subversion debootstrap rsync build-essential
168
168
 
169
 
While installing from a distribution package is often a better idea for
170
 
users, developers will need to install from a plain source tree.
171
 
 
172
 
To get the tree, either grab and extract a release tarball, or get the
173
 
very latest code using bzr: ::
174
 
 
175
 
   bzr get lp:ivle
176
 
 
177
 
You should then change into the new source directory.
178
 
 
179
169
As IVLE needs to compile some binaries, you must first build, then
180
 
install it: ::
 
170
install it. From the source directory created earlier: ::
181
171
 
182
172
   ./setup.py build
183
173
   sudo ./setup.py install
184
174
 
185
 
Unlike the package, you will have to manually set up the database and
186
 
configuration.
 
175
 
 
176
Setting up the database
 
177
~~~~~~~~~~~~~~~~~~~~~~~
187
178
 
188
179
First, it is recommended that you create a separate database user for IVLE.
189
180
You may use any name for the user. ::
208
199
   sudo ivle-config
209
200
 
210
201
 
211
 
Basic configuration
212
 
===================
213
 
 
214
 
.. Note: Place here only the configuration required to get the system
215
 
   installed and running. Any further configuration should go in config.rst.
 
202
Creating the data tree
 
203
~~~~~~~~~~~~~~~~~~~~~~
216
204
 
217
205
IVLE needs a directory hierarchy in which to store filesystem data, which
218
206
by default lives in ``/var/lib/ivle``. Create it now. ::
221
209
 
222
210
 
223
211
Configuring the jail environment
224
 
--------------------------------
 
212
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
225
213
 
226
214
You will require a self-contained jail environment in which to safely
227
215
execute student code. 
233
221
   devmode = True
234
222
   suite = jaunty # Replace this with the codename of your Ubuntu release.
235
223
   mirror = http://url.to.archive/mirror # Replace with a fast Ubuntu mirror.
236
 
   extra_packages = python-configobj, python-svn, python-cjson
237
224
 
238
225
.. TODO: Move this around a bit, as the config options required differ for
239
226
   the packaged version.
244
231
 
245
232
   sudo ivle-buildjail -r
246
233
 
 
234
 
247
235
Configuring Apache
248
 
------------------
 
236
~~~~~~~~~~~~~~~~~~
249
237
 
250
238
IVLE makes use of two Apache virtual hosts: one for the application itself,
251
239
and one for the Subversion services. There are example configuration files
262
250
 
263
251
 
264
252
Configuring hostname resolution
265
 
--------------------------------
 
253
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
266
254
 
267
255
All of IVLE's hostnames need to be resolvable from the local system. For a
268
256
production environment, this would be done in DNS. For a development system,
281
269
 
282
270
 
283
271
Configuring the user management server
284
 
--------------------------------------
 
272
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
285
273
 
286
274
You need to have the IVLE user management server (``usrmgt-server``) running
287
275
for many parts of IVLE to operate properly, so it should be configured to
295
283
 
296
284
 
297
285
Creating the initial user
298
 
-------------------------
 
286
~~~~~~~~~~~~~~~~~~~~~~~~~
299
287
 
300
288
The final step in getting a usable IVLE set up is creating a user. You'll
301
289
probably want admin privileges - if not, drop the ``--admin``. ::
302
290
 
303
 
   sudo ivle-adduser --admin -p password username 'Full Name'
 
291
   sudo ivle-adduser --admin -p PASSWORD USERNAME 'FULL NAME'
304
292
 
305
293
You should then be able to browse to http://ivle.localhost/, and
306
294
log in with that username and password.
311
299
.. note::
312
300
   For more advanced configuration, see :ref:`Configuring IVLE
313
301
   <ref-configuring-ivle>`.
 
302
 
 
303
 
 
304
 
 
305
Installing from an Ubuntu package
 
306
=================================
 
307
 
 
308
IVLE is packaged in `a Launchpad PPA <https://launchpad.net/~unimelb-ivle/+archive/production>`_,
 
309
providing a more managed installation and upgrade mechanism than a source
 
310
installation.
 
311
 
 
312
These instructions document the process to install a production-ready
 
313
multi-node IVLE cluster. They expect that you have three domain names:
 
314
one for the main IVLE web UI, one for the Subversion service, and one
 
315
for serving user files publicly.
 
316
 
 
317
.. warning::
 
318
   By design the public domain may have arbitrary user-generated content
 
319
   served. Because of this, it should not have any domain with sensitive
 
320
   cookies as a suffix, including the main IVLE web UI. Be very careful
 
321
   with your choice here.
 
322
 
 
323
 
 
324
Shared setup
 
325
------------
 
326
 
 
327
All master and slave nodes need to have access to the IVLE PPA.
 
328
`Visit it <https://launchpad.net/~unimelb-ivle/+archive/production>`_ and
 
329
follow the installation instructions on all involved systems.
 
330
 
 
331
 
 
332
Master setup
 
333
------------
 
334
 
 
335
Setting up the database server
 
336
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
337
 
 
338
The master server runs the central IVLE PostgreSQL database. ::
 
339
 
 
340
   sudo apt-get install postgresql
 
341
 
 
342
Ubuntu's default PostgreSQL configuration doesn't permit remote access,
 
343
so we need to tweak it to allow password access from our slave. In
 
344
``/etc/postgresql/8.3/main/postgresql.conf``, find the ``listen_addresses``
 
345
option, and ensure it is set to ``*``. In
 
346
``/etc/postgresql/8.3/main/pg_hba.conf`` add a line like the following to the
 
347
end. This example will allow any host in the ``1.2.3.4/24`` subnet to
 
348
authenticate with a password as the ``ivle`` user to the ``ivle`` database. ::
 
349
 
 
350
   host    ivle        ivle        1.2.3.4/24      md5
 
351
 
 
352
Then restart PostgreSQL, and the slaves should be able to see the database. ::
 
353
 
 
354
   sudo /etc/init.d/postgresql-8.3 restart
 
355
 
 
356
 
 
357
Installing and configuring IVLE
 
358
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
359
 
 
360
We can now install IVLE. The installation process will ask you a few questons.
 
361
Answer that this host is a **master**, let it generate a random usrmgt-server
 
362
secret, elect to manage the database with ``dbconfig-common``, and use a
 
363
random password. ::
 
364
 
 
365
   sudo apt-get install ivle
 
366
 
 
367
Once that's done, we have a couple of additional configuration items to set:
 
368
the URLs discussed earlier. Open up ``/etc/ivle/ivle.conf``, 
 
369
and replace ``public.ivle.localhost`` and ``svn.ivle.localhost`` with the
 
370
correct domain names.
 
371
 
 
372
Make sure you restart the ``usrmgt-server`` afterwards, or newly created users
 
373
may inherit the old domain names. ::
 
374
 
 
375
   sudo /etc/init.d/usrmgt-server restart
 
376
 
 
377
 
 
378
Sharing data between the servers
 
379
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
380
 
 
381
As well as its relational database, IVLE has a data hierarchy on the
 
382
fileystem. Two part of this (``/var/lib/ivle/jails`` and
 
383
``/var/lib/ivle/sessions``) must be shared between the master and all of the
 
384
slaves. It doesn't matter how you achieve this, but a reasonable method is
 
385
described here: exporting over NFS from the master.
 
386
 
 
387
We'll first create a tree (``/export/ivle`` in this example, but it can be
 
388
whatever you want) to be exported to the slaves, move the existing data
 
389
directories into it, and symlink them back into place. ::
 
390
 
 
391
   sudo mkdir /export/ivle
 
392
   sudo mv /var/lib/ivle/{sessions,jails} /export/ivle
 
393
   sudo ln -s /export/ivle/{sessions,jails} /var/lib/ivle
 
394
 
 
395
Next install an NFS server. ::
 
396
 
 
397
   sudo apt-get install nfs-kernel-server
 
398
 
 
399
Now we can export the directory we created earlier across the network.
 
400
Add something like the following line to ``/etc/exports``. ``someslave``
 
401
should be replaced with the hostname, IP address, or subnet of your
 
402
slave(s). ::
 
403
 
 
404
   /export/ivle         someslave(rw,sync)
 
405
 
 
406
Make sure you inform the kernel of the new export. ::
 
407
 
 
408
   sudo exportfs -a
 
409
 
 
410
 
 
411
Configuring Apache
 
412
~~~~~~~~~~~~~~~~~~
 
413
 
 
414
The master serves Subversion repositories through Apache on the Subversion
 
415
domain name that was discussed above. ::
 
416
 
 
417
   sudo cp /usr/share/doc/ivle/apache-svn.conf /etc/apache2/sites-available/ivle-svn
 
418
   sudo a2ensite ivle-svn
 
419
 
 
420
Edit ``/etc/apache2/sites-available/ivle-svn``, ensuring that the
 
421
``ServerName`` matches your chosen domain name. Then reload Apache's
 
422
configuration. ::
 
423
 
 
424
   sudo /etc/init.d/apache2 reload
 
425
 
 
426
 
 
427
Setting up a jail environment
 
428
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
429
 
 
430
IVLE requires that a base jail be provided, on top of which all of the
 
431
individual user jails are constructed in order to safely execute user code.
 
432
 
 
433
We need to change some configuration options before we can build a working
 
434
jail. First set the mirror and Ubuntu release -- make sure you replace the
 
435
URL and release code name with an Ubuntu mirror and your Ubuntu release. ::
 
436
 
 
437
   sudo ivle-config --jail/mirror http://url.to.mirror/ubuntu --jail/suite hardy
 
438
 
 
439
Now comes the ugly bit: we need to tell the jail builder where to get the
 
440
IVLE code that must be present in the jail. If you're using the production
 
441
PPA, the following ``/etc/ivle/ivle.conf`` snippet will work. If you're not,
 
442
you'll have to replace the ``extra_keys`` and ``extra_sources`` values ::
 
443
 
 
444
   [jail]
 
445
   extra_keys = '''
 
446
   -----BEGIN PGP PUBLIC KEY BLOCK-----
 
447
   Version: SKS 1.0.10
 
448
   
 
449
   mI0ES2pQKAEEANiscebT7+SFnvpN8nABcwT5nEV6psUOF8CcIIrz3iv6b6wA3lYd0DzbD7RD
 
450
   fs1MNriEHHgqPF6EUhGrkk1165Oqi+lULdjgL0Fzi3GFvLV9F8+BtL3wt3+MM7YC+aTS1nhF
 
451
   dQcPpnhNAJagW5gR4dIc4w87sNquxgCdJeJn/N3XABEBAAG0KkxhdW5jaHBhZCBVbml2ZXJz
 
452
   aXR5IG9mIE1lbGJvdXJuZSBJVkxFIFBQQYi2BBMBAgAgBQJLalAoAhsDBgsJCAcDAgQVAggD
 
453
   BBYCAwECHgECF4AACgkQVwp7ATtnautCMgP8C6PbLNyx9akgbiwhakFfGaEbxGFCo1EAUE7v
 
454
   FgdelJSEkeQLAn4WoANpixuojNi++PEDis22S4tz+ZC6G0dRU9Pcc1bb4xUgphR83QTcufH7
 
455
   5EagfTf5lLIWaLdg5f/NeuHHrKvwKvPVkNJ3ShQejFB/xWGpqe2Rr7Rscm9lT0Q=
 
456
   =TJYw
 
457
   -----END PGP PUBLIC KEY BLOCK-----
 
458
   '''
 
459
   extra_packages = ivle-services,
 
460
   extra_sources = deb http://ppa.launchpad.net/unimelb-ivle/production/ubuntu hardy main,
 
461
 
 
462
Now we can build the jail. This will download lots of packages, and install
 
463
a minimal Ubuntu system in ``/var/lib/ivle/jails/__base__``. ::
 
464
 
 
465
   sudo ivle-buildjail -r
 
466
 
 
467
You should now have a functional master.
 
468
 
 
469
 
 
470
Creating the initial user
 
471
~~~~~~~~~~~~~~~~~~~~~~~~~
 
472
 
 
473
The last master step for getting a usable IVLE set up is creating a user.
 
474
You'll probably want admin privileges - if not, drop the ``--admin``. ::
 
475
 
 
476
   sudo ivle-adduser --admin -p PASSWORD USERNAME 'FULL NAME'
 
477
 
 
478
You can then visit your IVLE web UI domain and login in with the username
 
479
and password.
 
480
 
 
481
 
 
482
Slave setup
 
483
-----------
 
484
 
 
485
Installing and configuring IVLE
 
486
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
487
 
 
488
We need to tell the database configuration assistant that we want to connect
 
489
to a remote database. The second command will also ask you whether you want to
 
490
store administrative passwords: say no here. ::
 
491
 
 
492
   sudo apt-get install dbconfig-common
 
493
   sudo dpkg-reconfigure dbconfig-common
 
494
 
 
495
We are going to need some details from the master for authentication purposes.
 
496
Grab the ``password`` value from the ``database`` section, and the ``magic``
 
497
value from the ``usrmgt`` section of the master's ``/etc/ivle/ivle.conf``.
 
498
 
 
499
Now we can install IVLE. Advise the installer that this machine is not a
 
500
master, and use the details retrieved from the master to answer the rest of
 
501
the questions. ::
 
502
 
 
503
   sudo apt-get install ivle
 
504
 
 
505
Once the installation has completed, make the same configuration changes as on
 
506
the master: set the domain names in ``ivle.conf`` to real values.
 
507
 
 
508
For maximum performance, you should also set the ``version`` value in the
 
509
``media`` section. The exact string is not important, as long as the value is
 
510
identical on every slave, and changed on each upgrade. It is used to make
 
511
static file URLs unique, so clients can cache them indefinitely. The IVLE
 
512
version is conventionally used as this string.
 
513
 
 
514
 
 
515
Getting access to the shared data
 
516
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
517
 
 
518
We need to mount the shared components of the IVLE data hierarchy from the
 
519
master. If you've used the suggested method, follow these instructions.
 
520
Otherwise you'll have to work it out for yourself.
 
521
 
 
522
First install the NFS common utilities, required for NFS mounts. ::
 
523
 
 
524
   sudo apt-get install nfs-common
 
525
 
 
526
Now we can add the mount to ``/etc/fstab``. Something like this should do: ::
 
527
 
 
528
  themaster:/export/ivle /export/ivle nfs defaults 0 0
 
529
 
 
530
Then mount the filesystem, and link the shared directories into the
 
531
hierarchy. ::
 
532
 
 
533
   mount -a
 
534
   ivle-createdatadirs
 
535
   rmdir /var/lib/ivle/{sessions,jails}
 
536
   ln -s /export/ivle/{sessions,jails} /var/lib/ivle
 
537
 
 
538
 
 
539
Configuring Apache
 
540
~~~~~~~~~~~~~~~~~~
 
541
 
 
542
The slaves use Apache to serve the main IVLE web UI and public user files.
 
543
Let's activate the configuration now. ::
 
544
 
 
545
   sudo cp /usr/share/doc/ivle/apache.conf /etc/apache2/sites-available/ivle
 
546
   sudo a2ensite ivle
 
547
 
 
548
Now edit ``/etc/apache2/sites-available/ivle``, and ensure that the
 
549
``ServerName`` matches your chosen IVLE web UI domain name, and
 
550
``ServerAlias`` your public name. Then reload Apache's configuration. ::
 
551
 
 
552
   sudo /etc/init.d/apache2 reload