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

« back to all changes in this revision

Viewing changes to doc/man/install.rst

  • Committer: William Grant
  • Date: 2009-06-29 03:44:08 UTC
  • mto: This revision was merged to the branch mainline in revision 1322.
  • Revision ID: grantw@unimelb.edu.au-20090629034408-qsb04s1ta1n5zr0y
Document user creation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
   along with this program; if not, write to the Free Software
16
16
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
17
 
18
 
.. _ref-install:
19
 
 
20
18
************
21
19
Installation
22
20
************
28
26
might work too. Debian/Ubuntu package names are given after the name of the
29
27
software.
30
28
 
31
 
.. If this list changes, you also need to change the list below, and
32
 
   the list in bin/ivle-dev-setup.
33
 
 
34
29
* Ubuntu 8.04 or later (other distros should work with some tweaking, but are untested)
35
 
* Apache 2.x (``apache2``) with modules:
 
30
* Apache 2.x with modules:
36
31
   + mod_python (``libapache2-mod-python``)
37
32
   + mod_dav_svn and mod_authz_svn (``libapache2-svn``)
38
 
* Python 2.5 (``python2.5``) or 2.6 (``python2.6``) with modules:
 
33
* Python 2.5 or 2.6 with modules:
39
34
   + cjson (``python-cjson``)
40
35
   + ConfigObj (``python-configobj``)
41
36
   + docutils (``python-docutils``)
44
39
   + Genshi (``python-genshi``)
45
40
   + psycopg2 (``python-psycopg2``)
46
41
   + pysvn (``python-svn``)
 
42
   + Routes (``python-routes``)
47
43
   + Storm (``python-storm``)
48
44
* jQuery (``libjs-jquery``)
49
45
* PostgreSQL 8.3 or later (``postgresql``)
55
51
Master versus slave servers
56
52
===========================
57
53
 
58
 
IVLE is normally deployed in a cluster of several machines, split into
59
 
two different roles: master and slave.
60
 
 
61
 
There must be exactly one master server per cluster. The master normally
62
 
runs the PostgreSQL database server, the Subversion server, and the IVLE User
63
 
Management Server (``ivle-usrmgt-server``). It might also export shared data
64
 
directories to the slaves over NFS.
65
 
 
66
 
There may be any number of slaves in a cluster. They run the IVLE web
67
 
application, which also starts console host processes. Each slave makes use
68
 
of the shared services on the master.
69
 
 
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
54
Installing from a Debian package
75
55
================================
76
56
 
77
 
.. _database-setup:
78
 
 
79
 
 
80
57
Installing from source
81
58
======================
82
59
 
83
 
When setting up a development IVLE environment on Ubuntu 9.04 or later,
84
 
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: ::
86
 
 
87
 
   bzr get lp:ivle
88
 
 
89
 
This will create a new directory, ``ivle``, containing a pristine
90
 
source tree. The remaining steps assume that you are in this new
91
 
directory.
92
 
 
93
 
The ``ivle-dev-setup`` script will configure PostgreSQL, Apache, IVLE
94
 
and the filesystem to cooperate, getting you most of the way to a
95
 
working system in just one step: ::
96
 
 
97
 
   bin/ivle-dev-setup
98
 
 
99
 
.. warning::
100
 
   This reconfigures parts of your system, and has the potential to
101
 
   break other applications using Apache or PostgreSQL. It may also
102
 
   fail to execute if you have existing incompatible configurations
103
 
   of those services.
104
 
   
105
 
 
106
 
This may take a few minutes, and will ask you to confirm installation
107
 
of the dependency packages.
108
 
 
109
 
Upon completion, you must build a self-contained jail in which to run
110
 
untrusted user code. ``ivle-dev-setup`` will have configured most of
111
 
the necessary settings, but you may wish to use a local Ubuntu mirror
112
 
to improve speed or minimise download costs. If you don't wish to use
113
 
a special mirror, you may omit the first step. ::
114
 
 
115
 
   sudo ivle-config --jail/mirror http://url.to.mirror/ubuntu
116
 
   sudo ivle-buildjail -r
117
 
 
118
 
.. warning::
119
 
   ``ivle-buildjail`` will download a large volume of package data --
120
 
   potentially some hundreds of megabytes.
121
 
 
122
 
``ivle-buildjail`` will download, unpack and install a minimal Ubuntu
123
 
system and configure it for IVLE usage. This could take a while.
124
 
 
125
 
Once the jail has been successfully built, IVLE is up and running,
126
 
but with no user accounts or other data in place. For development
127
 
or demonstration purposes, sample data (including fictitious users,
128
 
subjects, and projects) can be loaded.
129
 
 
130
 
For other environments, it may be more appropriate to start with an
131
 
empty database and just create users as required.
132
 
 
133
 
To load the sample data: ::
134
 
 
135
 
   sudo ivle-loadsampledata examples/db/sample.sql
136
 
 
137
 
.. warning::
138
 
   If you answer 'yes' to the ``ivle-loadsampledata`` prompt, any
139
 
   existing data in your IVLE database will be **permanently
140
 
   destroyed**.
141
 
 
142
 
... or to add a new admin user: ::
143
 
 
144
 
   sudo ivle-adduser --admin -p password username 'Full Name'
145
 
 
146
 
You should then be able to browse to http://ivle.localhost/, and
147
 
log in with username ``admin`` and password ``password``, or the
148
 
username and password that you gave to ``ivle-adduser``.
149
 
 
150
 
 
151
 
Manual steps
152
 
------------
153
 
 
154
 
If the automatic installation scripts do not work, or if you want more
155
 
control over the whole process, these manual steps are probably for
156
 
you. But you need not read this section at all if you were able to log
157
 
in after following the steps above.
158
 
 
159
 
.. If this list changes, you also need to change the list above, and
160
 
   the command in bin/ivle-dev-setup.
161
 
 
162
 
If you want to grab all of the required packages in one command, use::
163
 
 
164
 
    sudo apt-get install apache2 libapache2-mod-python libapache2-svn \
165
 
    python2.6 python-cjson python-configobj python-docutils python-epydoc \
166
 
    python-formencode python-genshi python-psycopg2 python-svn python-storm \
167
 
    libjs-jquery postgresql subversion debootstrap rsync build-essential
168
 
 
169
60
While installing from a distribution package is often a better idea for
170
61
users, developers will need to install from a plain source tree.
171
62
 
185
76
Unlike the package, you will have to manually set up the database and
186
77
configuration.
187
78
 
188
 
First, it is recommended that you create a separate database user for IVLE.
189
 
You may use any name for the user. ::
190
 
 
191
 
   sudo -u postgres createuser ivleuser     # Answer 'n' to all questions
192
 
   sudo -u postgres psql -c "ALTER USER ivleuser WITH ENCRYPTED PASSWORD 'ivle-password';"
193
 
 
194
 
Now, you must create a PostgreSQL database, and populate it with the
195
 
IVLE schema. You may use any name for the database (here we use ``ivle``). ::
196
 
 
197
 
   sudo -u postgres createdb -O ivleuser ivle
 
79
.. TODO: Separate IVLE PostgreSQL account.
 
80
 
 
81
First you must create a PostgreSQL database, and populate it with the
 
82
IVLE schema. You may use any name for the database. ::
 
83
 
 
84
   sudo -u postgres createdb ivle
198
85
   sudo -u postgres createlang plpgsql ivle
199
 
   psql -h localhost -W ivle ivleuser < userdb/users.sql
 
86
   sudo -u postgres psql -d ivle < userdb/users.sql
200
87
 
201
88
The configuration wizard - ``ivle-config`` - will ask you a series of
202
 
questions. You should give the database username and password as configured
203
 
above. Apart from database settings, the defaults should be correct
 
89
questions. Apart from database settings, the defaults should be correct
204
90
for a development system. If deploying IVLE properly - particularly on
205
91
multiple nodes - several options will need to be changed. Watching
206
92
carefully, run: ::
226
112
You will require a self-contained jail environment in which to safely
227
113
execute student code. 
228
114
Before you can actually build the jail, a few configuration options are
229
 
needed. Open up ``/etc/ivle/ivle.conf``, and find the ``[jail]`` section
230
 
(**not** the ``[[jails]]`` section).
 
115
needed. Open up ``/etc/ivle/ivle.conf``, and find the ``[jail]`` section.
231
116
Add to it: ::
232
117
 
233
118
   devmode = True
235
120
   mirror = http://url.to.archive/mirror # Replace with a fast Ubuntu mirror.
236
121
   extra_packages = python-configobj, python-svn, python-cjson
237
122
 
238
 
.. TODO: Move this around a bit, as the config options required differ for
239
 
   the packaged version.
240
 
 
241
123
Now we can actually build the jail. The creation process basically downloads
242
124
a minimal Ubuntu system and installs it in ``/var/lib/ivle/jails/__base__``.
243
125
Note that this could download a couple of hundred megabytes. ::
250
132
IVLE makes use of two Apache virtual hosts: one for the application itself,
251
133
and one for the Subversion services. There are example configuration files
252
134
in ``examples/config/apache.conf`` and ``examples/config/apache-svn.conf``,
253
 
which will run IVLE at http://ivle.localhost/.
 
135
which will run IVLE at ``http://ivle.localhost/``.
254
136
 
255
137
On a Debian or Ubuntu system, just copy those two files into
256
138
``/etc/apache2/sites-available`` under appropriate names (eg. ``ivle`` and
287
169
for many parts of IVLE to operate properly, so it should be configured to
288
170
start on boot. There is an example init script in
289
171
``examples/config/usrmgt-server.init``. For Debian or Ubuntu, copy it to
290
 
``/etc/init.d/ivle-usrmgt-server``. Start it now, and set it to start
291
 
automatically: ::
 
172
``/etc/init.d/ivle``. Start it now, and set it to start automatically: ::
292
173
 
293
 
   sudo /etc/init.d/ivle-usrmgt-server start
294
 
   sudo update-rc.d ivle-usrmgt-server defaults 99
 
174
   sudo /etc/init.d/usrmgt-server start
 
175
   sudo update-rc.d usrmgt-server defaults 99
295
176
 
296
177
 
297
178
Creating the initial user
298
179
-------------------------
299
180
 
300
 
The final step in getting a usable IVLE set up is creating a user. You'll
301
 
probably want admin privileges - if not, drop the ``--admin``. ::
302
 
 
303
 
   sudo ivle-adduser --admin -p password username 'Full Name'
304
 
 
305
 
You should then be able to browse to http://ivle.localhost/, and
 
181
.. TODO: Cover making the user an admin, one issue #151 is resolved.
 
182
 
 
183
The final step in getting a usable IVLE set up is creating a user. ::
 
184
 
 
185
   sudo ivle-makeuser username 'Full Name' -p password
 
186
 
 
187
You should then be able to browse to ``http://ivle.localhost/``, and
306
188
log in with that username and password.
307
189
 
308
 
*Alternatively*, you may wish to import the IVLE sample data, for a complete
309
 
working IVLE environment (not for production use). See :ref:`sample-data`.
310
 
 
311
190
.. note::
312
191
   For more advanced configuration, see :ref:`Configuring IVLE
313
192
   <ref-configuring-ivle>`.