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

1164.2.7 by Matt Giuca
Added doc/man/(config|install).rst. Bit more of man/index.rst.
1
.. IVLE - Informatics Virtual Learning Environment
2
   Copyright (C) 2007-2009 The University of Melbourne
3
4
.. This program is free software; you can redistribute it and/or modify
5
   it under the terms of the GNU General Public License as published by
6
   the Free Software Foundation; either version 2 of the License, or
7
   (at your option) any later version.
8
9
.. This program is distributed in the hope that it will be useful,
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
   GNU General Public License for more details.
13
14
.. You should have received a copy of the GNU General Public License
15
   along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
1348 by David Coles
Configuration documentation - fixing a few references
18
.. _ref-install:
19
1164.2.7 by Matt Giuca
Added doc/man/(config|install).rst. Bit more of man/index.rst.
20
************
21
Installation
22
************
23
1164.2.9 by Matt Giuca
doc/man: More headings!
24
System requirements
1164.2.7 by Matt Giuca
Added doc/man/(config|install).rst. Bit more of man/index.rst.
25
===================
26
1164.2.14 by William Grant
Add dependencies to docs.
27
Given versions are those on which IVLE is known to work; earlier versions
28
might work too. Debian/Ubuntu package names are given after the name of the
29
software.
30
1408 by William Grant
Update installation docs to prefer use of ivle-dev-setup.
31
.. If this list changes, you also need to change the list below, and
32
   the list in bin/ivle-dev-setup.
1164.2.41 by Matt Giuca
doc/man/install: Added package names for Apache and Python. Added a full apt-get install command to save typing.
33
1164.2.14 by William Grant
Add dependencies to docs.
34
* Ubuntu 8.04 or later (other distros should work with some tweaking, but are untested)
1164.2.41 by Matt Giuca
doc/man/install: Added package names for Apache and Python. Added a full apt-get install command to save typing.
35
* Apache 2.x (``apache2``) with modules:
1164.2.14 by William Grant
Add dependencies to docs.
36
   + mod_python (``libapache2-mod-python``)
37
   + mod_dav_svn and mod_authz_svn (``libapache2-svn``)
1164.2.41 by Matt Giuca
doc/man/install: Added package names for Apache and Python. Added a full apt-get install command to save typing.
38
* Python 2.5 (``python2.5``) or 2.6 (``python2.6``) with modules:
1164.2.14 by William Grant
Add dependencies to docs.
39
   + cjson (``python-cjson``)
40
   + ConfigObj (``python-configobj``)
41
   + docutils (``python-docutils``)
42
   + epydoc (``python-epydoc``)
1164.2.24 by William Grant
Add FormEncode to dependencies, and sort alphabetically.
43
   + FormEncode (``python-formencode``)
44
   + Genshi (``python-genshi``)
45
   + psycopg2 (``python-psycopg2``)
46
   + pysvn (``python-svn``)
1164.2.14 by William Grant
Add dependencies to docs.
47
   + Storm (``python-storm``)
48
* jQuery (``libjs-jquery``)
49
* PostgreSQL 8.3 or later (``postgresql``)
50
* Subversion (``subversion``)
51
* debootstrap (``debootstrap``)
1164.2.25 by William Grant
Need rsync too.
52
* rsync (``rsync``)
1164.2.14 by William Grant
Add dependencies to docs.
53
* GCC and related build machinery (``build-essential``)
1164.2.7 by Matt Giuca
Added doc/man/(config|install).rst. Bit more of man/index.rst.
54
1164.2.9 by Matt Giuca
doc/man: More headings!
55
Master versus slave servers
56
===========================
57
1164.2.7 by Matt Giuca
Added doc/man/(config|install).rst. Bit more of man/index.rst.
58
Installing from a Debian package
59
================================
60
1349 by Matt Giuca
Added sample data infrastructure, with a little bit of sample data. The sample data is in examples/db/sample.sql. Documentation in doc/man/sample.rst details the infrastructure for importing and exporting sample data.
61
.. _database-setup:
62
1408 by William Grant
Update installation docs to prefer use of ivle-dev-setup.
63
1164.2.7 by Matt Giuca
Added doc/man/(config|install).rst. Bit more of man/index.rst.
64
Installing from source
65
======================
66
1408 by William Grant
Update installation docs to prefer use of ivle-dev-setup.
67
When setting up a development IVLE environment on Ubuntu 9.04 or later,
68
there are scripts to automate most of the process. First get and extract
69
a release, or check out the latest code from the bzr branch: ::
70
71
   bzr get lp:ivle
72
73
This will create a new directory, ``ivle``, containing a pristine
74
source tree. The remaining steps assume that you are in this new
75
directory.
76
77
The ``ivle-dev-setup`` script will configure PostgreSQL, Apache, IVLE
78
and the filesystem to cooperate, getting you most of the way to a
79
working system in just one step: ::
80
81
   bin/ivle-dev-setup
82
83
.. warning::
84
   This reconfigures parts of your system, and has the potential to
85
   break other applications using Apache or PostgreSQL. It may also
86
   fail to execute if you have existing incompatible configurations
87
   of those services.
88
   
89
90
This may take a few minutes, and will ask you to confirm installation
91
of the dependency packages.
92
93
Upon completion, you must build a self-contained jail in which to run
94
untrusted user code. ``ivle-dev-setup`` will have configured most of
95
the necessary settings, but you may wish to use a local Ubuntu mirror
96
to improve speed or minimise download costs. If you don't wish to use
97
a special mirror, you may omit the first step. ::
98
99
   sudo ivle-config --jail/mirror http://url.to.mirror/ubuntu
100
   sudo ivle-buildjail -r
101
102
.. warning::
103
   ``ivle-buildjail`` will download a large volume of package data --
104
   potentially some hundreds of megabytes.
105
106
``ivle-buildjail`` will download, unpack and install a minimal Ubuntu
107
system and configure it for IVLE usage. This could take a while.
108
109
Once the jail has been successfully built, IVLE is up and running,
110
but with no user accounts or other data in place. For development
111
or demonstration purposes, sample data (including fictitious users,
112
subjects, and projects) can be loaded.
113
114
For other environments, it may be more appropriate to start with an
115
empty database and just create users as required.
116
117
To load the sample data: ::
118
119
   sudo ivle-loadsampledata examples/db/sample.sql
120
121
.. warning::
122
   If you answer 'yes' to the ``ivle-loadsampledata`` prompt, any
123
   existing data in your IVLE database will be **permanently
124
   destroyed**.
125
126
... or to add a new admin user: ::
127
128
   sudo ivle-adduser --admin -p password username 'Full Name'
129
130
You should then be able to browse to http://ivle.localhost/, and
1459 by William Grant
Correct the default username in the install docs.
131
log in with username ``admin`` and password ``password``, or the
1408 by William Grant
Update installation docs to prefer use of ivle-dev-setup.
132
username and password that you gave to ``ivle-adduser``.
133
134
135
Manual steps
136
------------
137
138
If the automatic installation scripts do not work, or if you want more
139
control over the whole process, these manual steps are probably for
140
you. But you need not read this section at all if you were able to log
141
in after following the steps above.
142
143
.. If this list changes, you also need to change the list above, and
144
   the command in bin/ivle-dev-setup.
1164.2.41 by Matt Giuca
doc/man/install: Added package names for Apache and Python. Added a full apt-get install command to save typing.
145
146
If you want to grab all of the required packages in one command, use::
147
148
    sudo apt-get install apache2 libapache2-mod-python libapache2-svn \
149
    python2.6 python-cjson python-configobj python-docutils python-epydoc \
1355 by William Grant
Drop python-routes dependency.
150
    python-formencode python-genshi python-psycopg2 python-svn python-storm \
151
    libjs-jquery postgresql subversion debootstrap rsync build-essential
1164.2.41 by Matt Giuca
doc/man/install: Added package names for Apache and Python. Added a full apt-get install command to save typing.
152
1164.2.15 by William Grant
Add some initial installation docs.
153
While installing from a distribution package is often a better idea for
154
users, developers will need to install from a plain source tree.
155
156
To get the tree, either grab and extract a release tarball, or get the
157
very latest code using bzr: ::
158
159
   bzr get lp:ivle
160
161
You should then change into the new source directory.
162
163
As IVLE needs to compile some binaries, you must first build, then
164
install it: ::
165
166
   ./setup.py build
167
   sudo ./setup.py install
168
169
Unlike the package, you will have to manually set up the database and
170
configuration.
171
1164.2.46 by Matt Giuca
doc/man/install: New instructions for setting up Postgres DB and user. Now the database is created under the new username, so there are no problems when IVLE runs as a different database user.
172
First, it is recommended that you create a separate database user for IVLE.
173
You may use any name for the user. ::
174
175
   sudo -u postgres createuser ivleuser     # Answer 'n' to all questions
176
   sudo -u postgres psql -c "ALTER USER ivleuser WITH ENCRYPTED PASSWORD 'ivle-password';"
177
178
Now, you must create a PostgreSQL database, and populate it with the
179
IVLE schema. You may use any name for the database (here we use ``ivle``). ::
180
181
   sudo -u postgres createdb -O ivleuser ivle
1164.2.15 by William Grant
Add some initial installation docs.
182
   sudo -u postgres createlang plpgsql ivle
1164.2.46 by Matt Giuca
doc/man/install: New instructions for setting up Postgres DB and user. Now the database is created under the new username, so there are no problems when IVLE runs as a different database user.
183
   psql -h localhost -W ivle ivleuser < userdb/users.sql
1164.2.15 by William Grant
Add some initial installation docs.
184
185
The configuration wizard - ``ivle-config`` - will ask you a series of
1164.2.46 by Matt Giuca
doc/man/install: New instructions for setting up Postgres DB and user. Now the database is created under the new username, so there are no problems when IVLE runs as a different database user.
186
questions. You should give the database username and password as configured
187
above. Apart from database settings, the defaults should be correct
1164.2.15 by William Grant
Add some initial installation docs.
188
for a development system. If deploying IVLE properly - particularly on
189
multiple nodes - several options will need to be changed. Watching
190
carefully, run: ::
191
192
   sudo ivle-config
193
194
1164.2.7 by Matt Giuca
Added doc/man/(config|install).rst. Bit more of man/index.rst.
195
Basic configuration
196
===================
197
198
.. Note: Place here only the configuration required to get the system
199
   installed and running. Any further configuration should go in config.rst.
200
1164.2.15 by William Grant
Add some initial installation docs.
201
IVLE needs a directory hierarchy in which to store filesystem data, which
202
by default lives in ``/var/lib/ivle``. Create it now. ::
203
204
   sudo ivle-createdatadirs
205
1164.2.22 by William Grant
Document configuration of the jail creation process.
206
207
Configuring the jail environment
208
--------------------------------
1164.2.15 by William Grant
Add some initial installation docs.
209
210
You will require a self-contained jail environment in which to safely
1164.2.22 by William Grant
Document configuration of the jail creation process.
211
execute student code. 
212
Before you can actually build the jail, a few configuration options are
1164.2.42 by Matt Giuca
doc/man/install: Minor confusion avoidance.
213
needed. Open up ``/etc/ivle/ivle.conf``, and find the ``[jail]`` section
214
(**not** the ``[[jails]]`` section).
1164.2.22 by William Grant
Document configuration of the jail creation process.
215
Add to it: ::
216
217
   devmode = True
218
   suite = jaunty # Replace this with the codename of your Ubuntu release.
219
   mirror = http://url.to.archive/mirror # Replace with a fast Ubuntu mirror.
220
   extra_packages = python-configobj, python-svn, python-cjson
221
1164.2.28 by William Grant
Add a TODO about jailbuilding instructions for the packages.
222
.. TODO: Move this around a bit, as the config options required differ for
223
   the packaged version.
224
1164.2.22 by William Grant
Document configuration of the jail creation process.
225
Now we can actually build the jail. The creation process basically downloads
226
a minimal Ubuntu system and installs it in ``/var/lib/ivle/jails/__base__``.
227
Note that this could download a couple of hundred megabytes. ::
228
229
   sudo ivle-buildjail -r
1164.2.15 by William Grant
Add some initial installation docs.
230
1164.2.16 by William Grant
Add docs on configuring Apache.
231
Configuring Apache
232
------------------
233
234
IVLE makes use of two Apache virtual hosts: one for the application itself,
235
and one for the Subversion services. There are example configuration files
236
in ``examples/config/apache.conf`` and ``examples/config/apache-svn.conf``,
1408 by William Grant
Update installation docs to prefer use of ivle-dev-setup.
237
which will run IVLE at http://ivle.localhost/.
1164.2.16 by William Grant
Add docs on configuring Apache.
238
239
On a Debian or Ubuntu system, just copy those two files into
240
``/etc/apache2/sites-available`` under appropriate names (eg. ``ivle`` and
241
``ivle-svn``). Then you need to activate them: ::
242
243
   sudo a2ensite ivle
244
   sudo a2ensite ivle-svn
245
   sudo /etc/init.d/apache2 reload
246
247
1164.2.17 by William Grant
Add /etc/hosts augmentation docs.
248
Configuring hostname resolution
249
--------------------------------
250
251
All of IVLE's hostnames need to be resolvable from the local system. For a
252
production environment, this would be done in DNS. For a development system,
1164.2.22 by William Grant
Document configuration of the jail creation process.
253
this is usually done in ``/etc/hosts``. Add this line to that file: ::
1164.2.17 by William Grant
Add /etc/hosts augmentation docs.
254
255
   127.0.1.1 ivle.localhost public.ivle.localhost svn.ivle.localhost
256
1164.2.18 by William Grant
Also edit /etc/hosts inside the jail.
257
Code running inside the jail environment also needs to be able to resolve
258
those names. Add, to ``/var/lib/ivle/jails/__base_build__/etc/hosts``: ::
259
260
   127.0.1.1 svn.ivle.localhost
261
262
Then refresh the active copy of the jail: ::
263
264
   sudo ivle-buildjail
265
1164.2.20 by William Grant
Document installation of the usrmgt-server init script.
266
267
Configuring the user management server
268
--------------------------------------
269
270
You need to have the IVLE user management server (``usrmgt-server``) running
271
for many parts of IVLE to operate properly, so it should be configured to
272
start on boot. There is an example init script in
273
``examples/config/usrmgt-server.init``. For Debian or Ubuntu, copy it to
1164.2.44 by Matt Giuca
doc/man/install: Conflicting advice for installing usrmgt-server init script. Now recommend installation to /etc/init.d/ivle-usrmgt-server.
274
``/etc/init.d/ivle-usrmgt-server``. Start it now, and set it to start
275
automatically: ::
1164.2.20 by William Grant
Document installation of the usrmgt-server init script.
276
1164.2.44 by Matt Giuca
doc/man/install: Conflicting advice for installing usrmgt-server init script. Now recommend installation to /etc/init.d/ivle-usrmgt-server.
277
   sudo /etc/init.d/ivle-usrmgt-server start
278
   sudo update-rc.d ivle-usrmgt-server defaults 99
1164.2.20 by William Grant
Document installation of the usrmgt-server init script.
279
1164.2.27 by William Grant
Document user creation.
280
281
Creating the initial user
282
-------------------------
283
1164.2.30 by William Grant
Document creating an admin user, now issue #151 is fixed.
284
The final step in getting a usable IVLE set up is creating a user. You'll
285
probably want admin privileges - if not, drop the ``--admin``. ::
286
1164.2.45 by Matt Giuca
doc/man/install: s/ivle-makeuser/ivle-adduser/g.
287
   sudo ivle-adduser --admin -p password username 'Full Name'
1164.2.27 by William Grant
Document user creation.
288
1408 by William Grant
Update installation docs to prefer use of ivle-dev-setup.
289
You should then be able to browse to http://ivle.localhost/, and
1164.2.27 by William Grant
Document user creation.
290
log in with that username and password.
291
1359 by Matt Giuca
Added a script ivle-loadsampledata.
292
*Alternatively*, you may wish to import the IVLE sample data, for a complete
293
working IVLE environment (not for production use). See :ref:`sample-data`.
294
1164.2.7 by Matt Giuca
Added doc/man/(config|install).rst. Bit more of man/index.rst.
295
.. note::
296
   For more advanced configuration, see :ref:`Configuring IVLE
297
   <ref-configuring-ivle>`.