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