source: trunk/doc/src/docbook/admin/installation.xml @ 7548

Last change on this file since 7548 was 7548, checked in by Nicklas Nordborg, 4 years ago

Fixes #2134: Deprecate secondary storage

Code and documentatation has been updated.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 63.1 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE chapter PUBLIC
3    "-//Dawid Weiss//DTD DocBook V3.1-Based Extension for XML and graphics inclusion//EN"
4    "../../../../lib/docbook/preprocess/dweiss-docbook-extensions.dtd">
5<!--
6  $Id: installation.xml 7548 2018-12-10 11:53:32Z nicklas $
7
8  Copyright (C) 2007 Jari Häkkinen, Peter Johansson, Nicklas Nordborg, Martin Svensson
9  Copyright (C) 2008 Jari Häkkinen, Nicklas Nordborg, Martin Svensson
10  Copyright (C) 2009 Jari Häkkinen, Nicklas Nordborg
11  Copyright (C) 2010, 2011, 2012 Nicklas Nordborg
12  Copyright (C) 2013 Jari Häkkinen, Nicklas Nordborg
13
14  This file is part of BASE - BioArray Software Environment.
15  Available at http://base.thep.lu.se/
16
17  BASE is free software; you can redistribute it and/or
18  modify it under the terms of the GNU General Public License
19  as published by the Free Software Foundation; either version 3
20  of the License, or (at your option) any later version.
21
22  BASE is distributed in the hope that it will be useful,
23  but WITHOUT ANY WARRANTY; without even the implied warranty of
24  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25  GNU General Public License for more details.
26
27  You should have received a copy of the GNU General Public License
28  along with BASE. If not, see <http://www.gnu.org/licenses/>.
29-->
30
31<chapter id="installation">
32
33  <title>Installation and upgrade instructions</title>
34
35  <note>
36    <para>
37    These instructions apply only to the BASE release which this
38    document is a part of. The instructions here assume
39    that <ulink url="http://tomcat.apache.org/">Apache Tomcat 8</ulink> is used
40    on the server side. Other servlet engines may work but we only
41    test with Tomcat.
42    </para>
43  </note>
44
45  <sect1 id="installation.upgrade">
46    <title>Upgrade instructions</title>
47
48    <important id="installation.upgrade.important">
49      <title>Important information for upgrading to BASE 3.14</title>
50      <para>
51        This section list some important information that may or may not
52        apply when upgrading from the <emphasis>previous</emphasis> BASE
53        release to the current release (eg. 3.13 to 3.14). If you are
54        upgrading from a BASE installation that is older (3.0-3.12)
55        you should also read <xref linkend="appendix.update_warnings" />.
56      </para>
57
58      <bridgehead>The db.driver setting is no longer used</bridgehead>
59      <para>
60        The JDBC driver to use is now found automatically based on
61        the <constant>db.url</constant> setting in the <filename>base.config</filename>
62        file. The <constant>db.driver</constant> setting can be removed.
63      </para>
64     
65      <bridgehead>The (very) old Authenticator API has been removed</bridgehead>
66      <para>
67        The <code>net.sf.basedb.core.authentication.Authenticator</code>
68        interface and other related code that was deprecated in BASE 3.3
69        has been removed. Systems that still use old authentication code
70        need to replace this with a newer version before updating.
71      </para>
72     
73      <bridgehead>Changes to the authentication system</bridgehead>
74      <para>
75        The authentication system has been updated to make it easier to
76        install more than one external authentication manager. The changes
77        are backwards compatible and existing authentication managers should
78        still work as before as long as they are the only ones installed.
79        However, the existing authentication managers will probably not work
80        well if more than one is installed since they lack some features that
81        are neccessary in order to cooperate with other managers. Before installing
82        more than one authentication manager it is recommended that they are
83        updated to newer versions.
84      </para>
85     
86      <para>
87        Newer authentication managers typically no longer provide support for
88        password authentication. If the intention is that some users still should be
89        able to login with username+password, it is recommended that the
90        <guilabel>Password login form</guilabel> is enabled. Go to
91        <menuchoice>
92          <guimenu>Administrate</guimenu>
93          <guisubmenu>Plug-ins &amp; extensions</guisubmenu>
94          <guimenuitem>Overview</guimenuitem>
95        </menuchoice> and locate the <guilabel>Login form customization</guilabel>
96        extension point to find it.
97      </para>
98     
99      <bridgehead>Java 11</bridgehead>
100      <para>
101        Java 8 is still the only officially supported version, but our intention
102        is to switch to Java 11 (or later) some time in the near future (2019).
103        We have made some initial tests with Java 11 and believe that BASE should
104        work. However, it requires an extra installation step:
105      </para>
106      <para>
107        Copy the JAR-files located in <filename>&lt;base-dir&gt;/misc/java11/</filename>
108        to the <filename>&lt;base-dir&gt;/www/WEB-INF/lib/</filename> directory.
109        If you are running a BASE server today it might be a good idea to
110        be prepared by setting up a test environment that is running a clone of
111        the main server under Java 11.
112      </para>
113     
114      <bridgehead>Secondary storage</bridgehead>
115      <para>
116        The <guilabel>Secondary storage</guilabel> feature has been deprecated
117        and will be removed in a future release. The recommendation is to replace
118        this feature with an external files solution instead.
119      </para>
120     
121    </important>
122   
123    <para>
124      As always, backup your database before attempting an
125      upgrade. The BASE team performs extensive testing before
126      releasing a new version of BASE but there are always a
127      possibility for unexpected events during upgrades. In upgrades
128      requiring a change in the underlying database there is no
129      (supported) way to revert to a previous version of BASE using
130      BASE tools, you need to use your backup for this use case.
131    </para>
132
133    <para>
134      The strategy here is to install the new BASE release to another
135      directory than the one in use. This requires transfer of
136      configuration settings to the new install but more on that
137      below.
138    </para>
139
140    <variablelist>
141      <varlistentry>
142        <term>Shut down the Tomcat server</term>
143        <listitem>
144          <para>
145            If the BASE application is not shut down already, it is
146            time to do it now. Do something like <command>sudo
147            /etc/init.d/tomcat8.0 stop</command>
148          </para>
149         
150          <tip>
151            <title>Notify logged in users!</title>
152            <para>
153              If there are users logged in to your BASE server, it may
154              be nice of you to notify them a few minutes prior to shutting
155              down the BASE server. See <xref linkend="installation.broadcast" />.
156            </para>
157          </tip>
158        </listitem>
159      </varlistentry>
160
161      <varlistentry>
162        <term>Rename your current server</term>
163        <listitem>
164          <para>
165            Rename your current BASE installation <command>mv
166              /path/to/base /path/to/base_old</command>.
167          </para>
168        </listitem>
169      </varlistentry>
170
171      <varlistentry>
172        <term>Download and unpack BASE</term>
173        <listitem>
174          <para>
175            There are several ways to download BASE. Please refer to
176            section <xref linkend="resources.home_page.download"/> for
177            information on downloading BASE, and select the item
178            matching your download option:
179          </para>
180
181          <variablelist>
182            <varlistentry>
183              <term><emphasis>Pre-compiled package</emphasis></term>
184              <listitem>
185                <para>
186                  If you selected to download a pre-compiled package,
187                  unpack the downloaded file with <command>tar zxpf
188                  base-...tar.gz</command>.
189                </para>
190              </listitem>
191            </varlistentry>
192
193            <varlistentry>
194              <term><emphasis>Source package</emphasis></term>
195              <listitem>
196                <para>
197                  If you selected to download a source package, unpack
198                  the downloaded file with <command>tar zxpf
199                  base-...src.tar.gz</command>. Change to the new
200                  directory, and issue <command>ant
201                  package.bin</command>. This will create a binary
202                  package in the current directory. Unpack this new
203                  package (outside of the source file hierarchy).
204                </para>
205              </listitem>
206            </varlistentry>
207
208            <varlistentry>
209              <term><emphasis>Subversion checkout</emphasis></term>
210              <listitem>
211                <para>
212                  This option is for advanced users only and is not
213                  covered here. Please refer to
214                  <ulink url="http://base.thep.lu.se/wiki/BuildingBase" /> for information on
215                  this download option.
216                </para>
217              </listitem>
218            </varlistentry>
219
220          </variablelist>
221        </listitem>
222
223      </varlistentry>
224
225      <varlistentry>
226        <term>Transfer files and settings</term>
227        <listitem>
228          <para>
229            Settings from the previous installation must be
230            transferred to the new installation. This is most easily
231            done by comparing the configuration files from the
232            previous install with the new files. Do not just copy the
233            old files to the new install since new options may have
234            appeared.
235          </para>
236          <para>
237            In the main BASE configuration file,
238            <filename>&lt;base-dir&gt;/www/WEB-INF/classes/base.config</filename>,
239            fields that needs to be transferred are usually
240            <emphasis>db.username</emphasis>,
241            <emphasis>db.password</emphasis>,
242            and <emphasis>userfiles</emphasis>.
243          </para>
244          <para>
245            Local settings in the raw data
246            tables, <filename>&lt;base-dir&gt;/www/WEB-INF/classes/raw-data-types.xml</filename>,
247            may need to be transferred. This also includes all files in
248            the <filename>&lt;base-dir&gt;/www/WEB-INF/classes/raw-data-types</filename> and
249            <filename>&lt;base-dir&gt;/www/WEB-INF/classes/extended-properties</filename>
250            directories.
251          </para>
252        </listitem>
253      </varlistentry>
254
255      <varlistentry>
256        <term>Updating database schema</term>
257        <listitem>
258          <para>
259            It is recommended that you also perform an update of your
260            database schema.  Running the update scripts are not
261            always necessary when upgrading BASE, but the running the
262            update scripts are safe even in cases when there is no
263            need to run them. Change directory
264            to <filename
265            class="directory">&lt;base-dir&gt;/bin/</filename> and issue
266<programlisting>
267sh ./updatedb.sh [base_root_login] <emphasis>base_root_password</emphasis>
268</programlisting>
269            where <emphasis>base_root_login</emphasis> is the login
270            for the root user and <emphasis>base_root_password</emphasis> is the
271            password. The login is optional. If not specified,
272            <constant>root</constant> is used as the login.
273          </para>
274        </listitem>
275      </varlistentry>
276
277      <varlistentry>
278        <term>Start Tomcat</term>
279        <listitem>
280          <para>
281            Start the Tomcat server: <command>sudo
282              /etc/init.d/tomcat8.0 start</command>
283          </para>
284        </listitem>
285      </varlistentry>
286
287    </variablelist>
288
289    <para>
290      Done! Upgrade of BASE is finished.
291    </para>
292
293  </sect1>      <!-- Upgrade instructions -->
294
295  <sect1 id="installation.main">
296    <title>Installation instructions</title>
297
298    <variablelist>
299
300      <varlistentry>
301        <term>Java</term>
302        <listitem>
303          <para>
304            Download and install Java SE 8, available from
305            <ulink url="http://www.oracle.com/technetwork/java/javase/downloads/index.html" />.
306            You can select either the JDK or the JRE version.
307          </para>
308         
309          <note>
310            <title>What about Java 11 (or later)?</title>
311            <para>
312            Java SE 8 is the officially supported version since BASE 3.6.
313            We have made some initial tests with Java 11 and we believe it to
314            be working. The plan is to switch to Java 11 (or later)
315            some time in the near future (2019). If you are setting up a new
316            BASE installation, you might as well try that with Java 11
317            already now. It requires an extra installation step:
318            </para>
319            <para>
320            Copy the JAR-files located in <filename>&lt;base-dir&gt;/misc/java11/</filename>
321            to the <filename>&lt;base-dir&gt;/www/WEB-INF/lib/</filename> directory.
322            </para>
323          </note>
324
325        </listitem>
326      </varlistentry>
327
328      <varlistentry>
329        <term>Set up an SQL database</term>
330        <listitem>
331          <para>
332            BASE
333            utilise <ulink
334            url="http://www.hibernate.org/">Hibernate</ulink> for
335            object persistence to a relational database. Hibernate
336            supports many database engines, but so far we only work
337            with <ulink url="http://www.mysql.com">MySQL</ulink>
338            and <ulink
339            url="http://www.postgresql.org/">PostgreSQL</ulink>.
340          </para>
341
342          <variablelist>
343            <varlistentry>
344              <term>MySQL</term>
345              <listitem>
346                <para>
347                  Download and install MySQL (tested with version
348                  5.5), available from
349                  <ulink url="http://www.mysql.com/" />. You need to
350                  be able to connect to the server over TCP, so
351                  the <emphasis>skip-networking</emphasis> option
352                  must <command>not</command> be used. The InnoDB
353                  table engine is also needed, so do not disable them
354                  (not that you would) but you may want to tune the
355                  InnoDB behaviour before creating BASE
356                  databases. BASE comes pre-configured for MySQL so
357                  there is no need to change database settings in the
358                  BASE configuration files.
359                </para>
360              </listitem>
361            </varlistentry>
362            <varlistentry>
363              <term>PostgreSQL</term>
364              <listitem>
365                <para>
366                  PostgreSQL 9.3 seems to be working very well with
367                  BASE and Hibernate. Download and install PostgreSQL,
368                  available from
369                  <ulink url="http://www.postgresql.org/" />. You must edit
370                  your <filename>&lt;base-dir&gt;/www/WEB-INF/classes/base.config</filename>
371                  file. Uncomment the settings for PostgreSQL and
372                  comment out the settings for MySQL.
373                </para>
374              </listitem>
375            </varlistentry>
376          </variablelist>
377
378        </listitem>
379      </varlistentry>
380
381      <varlistentry id="installation.main.database">
382        <term>BASE (database engine)</term>
383        <listitem>
384          <para>
385            The database names (base2 and base2dynamic are used here),
386            the <emphasis>db_user</emphasis>, and the
387            <emphasis>db_password</emphasis> can be changed during the
388            creation of the databases. It is recommended to change the
389            <emphasis>db_password</emphasis>, the other changes are
390            optional and can be made if desired. The database names,
391            the <emphasis>db_user</emphasis>, and the
392            <emphasis>db_password</emphasis> are needed below when
393            configuring BASE.
394          </para>
395          <note>
396            Note that the <emphasis>db_user</emphasis> name and
397            <emphasis>db_password</emphasis> set here is used
398            internally by BASE in communication with the database and
399            is never used to log on to the BASE application.
400          </note>
401          <important>
402            <title>The database must use the UTF-8 character set</title>
403            <para>
404              Otherwise there will be a problem with storing values
405              that uses characters outside the normal Latin1 range,
406              for example unit-related such as µ (micro) and Ω (ohm).
407            </para>
408          </important>
409          <variablelist>
410            <varlistentry>
411              <term>MySQL</term>
412              <listitem>
413                <para>
414                  Create a new database for BASE, and add a
415                  <emphasis>db_user</emphasis> with at least
416                  <emphasis>SELECT</emphasis>, <emphasis>INSERT</emphasis>,
417                  <emphasis>UPDATE</emphasis>, <emphasis>DELETE</emphasis>,
418                  <emphasis>CREATE</emphasis>, <emphasis>DROP</emphasis>,
419                  <emphasis>INDEX</emphasis>,
420                  and <emphasis>ALTER</emphasis> permission for the
421                  new database. To do this, connect to your MySQL
422                  server and issue the next lines:
423<programlisting>CREATE DATABASE base2 DEFAULT CHARACTER SET utf8;
424CREATE DATABASE base2dynamic DEFAULT CHARACTER SET utf8;
425GRANT ALL ON base2.* TO db_user@localhost IDENTIFIED BY 'db_password';
426GRANT ALL ON base2dynamic.* TO db_user@localhost;</programlisting>
427                </para>             
428                <para>
429                  If you download BASE (instructions below) you find a file
430                  <filename>&lt;base-dir&gt;/misc/sql/createdb.mysql.sql</filename>
431                  that contains the above statements and can be used
432                  by the <filename>mysql</filename> command-line tool
433                  (remember to edit the <emphasis>db_user</emphasis>,
434                  <emphasis>db_password</emphasis>, and the database
435                  names in the script file before executing the
436                  command): <command>mysql -uroot -p &lt;
437                  &lt;base-dir&gt;/misc/sql/createdb.mysql.sql</command>. The
438                  header in the script file contains further
439                  information about the script.
440                </para>
441              </listitem>
442            </varlistentry>
443            <varlistentry>
444              <term>PostgreSQL</term>
445              <listitem>
446                <para>
447                  Create a new database for BASE, and add a
448                  <emphasis>db_user</emphasis> with the proper
449                  privileges. To do this, log in as your PostgreSQL
450                  user and issue these lines (omit comments):
451<programlisting>createuser db_user -P
452  # this will prompt for an password for the new user, and issue two
453  # more question that should be answered with character 'n' for no.
454createdb --owner db_user --encoding UTF8 base2
455psql base2
456  # this will start the psql command line tool. Issue the next line
457  # within the tool and quit with a '\q'.
458CREATE SCHEMA "dynamic" AUTHORIZATION "db_user";</programlisting>
459
460                  If you download BASE (instructions below) you find a file
461                  <filename>&lt;base-dir&gt;/misc/sql/createdb.postgresql.sql</filename>
462                  that contains the above statements and can be used
463                  by the <filename>psql</filename> command-line tool:
464                  <command>psql -f
465                  &lt;base-dir&gt;/misc/sql/createdb.posgres.sql
466                  template1</command> The header in the script file
467                  contains further information about the script.
468                </para>
469              </listitem>
470            </varlistentry>
471          </variablelist>
472        </listitem>
473      </varlistentry>
474
475      <varlistentry>
476        <term>BASE (download and unpacking)</term>
477        <listitem>
478          <para>
479            <ulink
480            url="http://base.thep.lu.se/wiki/DownloadPage">Download
481            BASE</ulink> and unpack the downloaded file,
482            i.e. <command>tar zxpf base-...tar.gz</command>. If you
483            prefer to have the bleeding edge version of BASE, perform
484            a checkout of the source from the subversion repository
485            (subversion checkout instructions at
486            <ulink url="http://base.thep.lu.se/wiki/DownloadPage">BASE
487            trac site</ulink>).
488          </para>
489          <para>
490            If you choose to download the binary package, skip to the
491            next item. The rest of us, read on and compile BASE. If
492            you downloaded a source distribution, unpack the
493            downloaded file <command>tar zxpf
494            base-...src.tar.gz</command>, or you may have performed a
495            subversion checkout.  Change to the 'root' base2
496            directory, and issue <command>ant
497            package.bin</command>. This will create a binary package
498            in the base2 'root' directory. Unpack this new package
499            (outside of the source file hierarchy), and from now on
500            the instructions are the same irrespective where you got
501            the binary package.
502          </para>
503          <para>
504            <emphasis>This section is intended for advanced users and
505              programmers only. In cases when you want to change the
506              BASE code and try out personalised features it may be
507              advantageous to run the tweaked BASE server against the
508              development tree. Instructions on how to accomplish this
509              is available in the
510              <ulink
511              url="http://base.thep.lu.se/wiki/BuildingBase">building
512              BASE document</ulink>. When you return back after
513              compiling in the subversion tree you can follow the
514              instruction here (with obvious changes to
515              paths).</emphasis>
516          </para>
517        </listitem>
518      </varlistentry>
519
520      <varlistentry>
521        <term>BASE (file storage setup)</term>
522        <listitem>
523          <para>
524            An area for file storage must be setup. Create an empty
525            directory in a proper location in your file system. Set
526            the owner of the created directory to the user the Tomcat
527            server will be running as. Tomcat server set up
528            instructions will follow below. Remember this location for
529            later use. The default location is <filename>/usr/local/base2/files</filename>.
530          </para>
531        </listitem>
532      </varlistentry>
533     
534      <varlistentry>
535        <term>BASE (plug-in setup)</term>
536        <listitem>
537          <para>
538            An area for plug-in and extensions installation must be setup.
539            Create an empty directory in a proper location in your file system,
540            and make sure that the user that the Tomcat
541            server will be running as has read permission in this
542            directory. Tomcat server set up instructions will follow
543            below. Remember this location for
544            later use. The default location is <filename>/usr/local/base2/plugins</filename>.
545          </para>
546        </listitem>
547      </varlistentry>
548
549      <varlistentry id="installation.main.configuration">
550        <term>BASE (configuration)</term>
551        <listitem>
552          <para>
553            Basic BASE configuration is done in
554            <filename>&lt;base-dir&gt;/www/WEB-INF/classes/base.config</filename>:
555            <itemizedlist>
556              <listitem>
557                Uncomment the database engine section that match your setup.
558              </listitem>
559              <listitem>
560                Modify the <emphasis>db.url</emphasis>,
561                <emphasis>db.dynamic.catalog</emphasis>,
562                <emphasis>db.username</emphasis>,
563                and <emphasis>db.password</emphasis> settings to match
564                your choice above. (<emphasis>database host and
565                database name (e.g. base2)</emphasis>,
566                <emphasis>e.g. base2dynamic</emphasis>,
567                <emphasis>db_user</emphasis>, and
568                <emphasis>db_password</emphasis>, respectively.)
569              </listitem>
570              <listitem>
571                Modify the <emphasis>userfiles</emphasis> setting to
572                match your choice in file storage setup above.
573              </listitem>
574              <listitem>
575                Modify the <emphasis>plugins.dir</emphasis> setting to
576                match your choice in plug-in setup above.
577              </listitem>
578            </itemizedlist>
579            See the <xref linkend="appendix.base.config"/> for more
580            information about the settings in
581            the <filename>base.config</filename> file.
582          </para>
583          <para>
584            <emphasis>Optional but recommended.</emphasis> You may want
585            to modify extended properties to fit your needs. Extended
586            properties are defined in
587            <filename>&lt;base-dir&gt;/www/WEB-INF/classes/extended-properties.xml</filename>.
588            There is an
589            administrator <ulink
590            url="http://base.thep.lu.se/chrome/site/doc/historical/admin/extended-properties.html">document
591            discussing extended properties</ulink> available. If you
592            plan to perform a migration of a BASE version 1.2 database you
593            should probably not remove any extended properties
594            columns (this is not tested so the outcome is currently
595            undefined). However, adding columns does not affect
596            migration.
597          </para>
598        </listitem>
599      </varlistentry>
600
601      <varlistentry>
602        <term>BASE (database initialisation)</term>
603        <listitem>
604          <para>
605            Change directory to
606            <filename class="directory">&lt;base-dir&gt;/bin</filename>
607            and execute the following commands:
608        <programlisting>
609sudo ./initdb.sh [base_root_login] base_root_password
610</programlisting>
611          </para>
612
613          <para>
614            In the first command sudo is required because a file will
615            be created in the directory defined by
616            <emphasis>userfiles</emphasis> above. If the directory is
617            writable by you then sudo is not needed.
618          </para>
619
620          <important>
621            <para>
622            The <emphasis>base_root_login</emphasis> and
623            <emphasis>base_root_password</emphasis> you use here
624            is given to the BASE web application root user account.
625            The <emphasis>base_root_login</emphasis> is optional. If
626            not specified, <constant>root</constant> is used for
627            the login.
628            </para>
629          </important>
630
631          <para>
632            If the initialisation script fails, it is probably a
633            problem related to the underlying database. Make sure that
634            the database accepts network connection and make sure that
635            <emphasis>db_user</emphasis> has proper credentials. You
636            may also get a <emphasis>Permission denied</emphasis> on
637            file <filename>extension-settings.xml</filename> if you do
638            not have write permission to the directory defined by
639            variable <emphasis>userfiles</emphasis> in file
640            <filename>base.config</filename>. If the initialisation
641            fails on <filename>extension-settings.xml</filename> you
642            must drop the database and recreate the database as
643            described in <xref linkend="installation.main.database"/>.
644          </para>
645        </listitem>
646      </varlistentry>
647
648      <varlistentry>
649        <term>Tomcat</term>
650        <listitem>
651          <para>
652            Download and install Apache Tomcat 8
653            available from <ulink url="http://tomcat.apache.org" />.
654          </para>
655
656          <important>
657            <para>
658              As of BASE 3.6 we are only supporting Tomcat 8.
659              Tomcat 7 may work, but there is no guarantee.
660            </para>
661          </important>
662
663          <para>
664            There are a few configuration options that are needed to
665            make Tomcat work properly with BASE. The options are set in the
666            <code>CATALINA_OPTS</code> environment variable.
667          </para>
668         
669          <itemizedlist>
670            <listitem>
671              <para>
672                Increase the amount of memory that Tomcat is allowed to use. The default setting is
673                usually not enough. To give Tomcat 1 gigabyte, use <code>-Xmx1G</code>.
674              </para>
675            </listitem>
676            <listitem>
677              <para>
678                Disable strict parsing of JSP files.
679                <code>-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false</code>
680              </para>
681            </listitem>
682            <listitem>
683              <para>
684                Unless you have manually downloaded and installed JAI (Java Advanced
685                Imaging) native acceleration libraries (see <ulink 
686                url="http://java.sun.com/javase/technologies/desktop/media/jai/" />)
687                it is a good idea to disable the native acceleration of JAI.
688                <code>-Dcom.sun.media.jai.disableMediaLib=true</code>
689              </para>
690            </listitem>
691            <listitem>
692              <para>
693                Enable headless mode if your are setting up a server which doesn't have
694                a display device connected to it. <code>-Djava.awt.headless=true</code>.
695              </para>
696            </listitem>
697          </itemizedlist>
698         
699          <para>
700            Depending on your system there are probably several ways to set the
701            the <code>CATALINA_OPTS</code> variable. One suggestion is to add the following
702            line (as a single line) close to the top of the <filename>catalina.sh</filename> 
703            script that comes with Tomcat (directory <filename
704            class="directory">bin</filename>):
705<programlisting>CATALINA_OPTS="-Xmx1G
706-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false
707-Dcom.sun.media.jai.disableMediaLib=true
708-Djava.awt.headless=true"</programlisting>
709          </para>
710          <para>
711            For more information about Tomcat options see
712            <ulink url="http://tomcat.apache.org/tomcat-8.0-doc/index.html" />.
713          </para>
714        </listitem>
715      </varlistentry>
716
717      <varlistentry>
718        <term>BASE and Tomcat</term>
719        <listitem>
720          <para>
721            Do the following:
722            <itemizedlist>
723              <listitem>
724                <para>
725                  Either move the <filename
726                  class="directory">&lt;base-dir&gt;/www</filename>
727                  directory to the Tomcat <filename
728                  class="directory">webapps</filename> directory or
729                  create a symbolic link from the Tomcat <filename
730                  class="directory">webapps</filename> directory to
731                  the <filename
732                  class="directory">&lt;base-dir&gt;/www</filename>
733                  directory
734<programlisting>cd /path/to/tomcat/webapps
735ln -s /path_to_base/www base2</programlisting>
736                </para>
737              </listitem>
738              <listitem>
739                <para>
740                  Make sure that user Tomcat is running as can read
741                  all objects in the directory defined by
742                  <emphasis>plugins.dir</emphasis> in file
743                  <filename>base.config</filename>.
744                </para>
745              </listitem>
746              <listitem>
747                <para>
748                  Make sure that user Tomcat is running as owns (i.e.,
749                  can read, write, delete and create) all objects in
750                  the directory, as well as the directory itself,
751                  defined by <emphasis>userfiles</emphasis> in file
752                  <filename>base.config</filename>.
753                </para>
754              </listitem>
755              <listitem>
756                <para>
757                  If you plan to install extensions you should make
758                  sure that the <filename
759                  class="directory">&lt;base-dir&gt;/www/extensions</filename>
760                  directory is writable by the user account Tomcat is
761                  running as.
762                </para>
763              </listitem>
764            </itemizedlist>
765          </para>
766          <para>
767            and finalise with start, or restart, Tomcat, and try
768            http://hostname:8080/base2 (change
769            <emphasis>hostname</emphasis> to your hostname and
770            <emphasis>base2</emphasis> if you selected another name
771            for the BASE Tomcat application) in your favourite
772            browser. The BASE log-in page should appear after a few
773            seconds.
774          </para>
775        </listitem>
776      </varlistentry>
777
778      <varlistentry>
779        <term>BASE, Apache, and Apache/Tomcat connector</term>
780        <listitem>
781          <para>
782            <emphasis>This step is optional</emphasis>.
783          </para>
784          <para>
785            If you want run the Tomcat server through the Apache web
786            server, you need to install the Apache version 2 web
787            server, available
788            from <ulink url="http://httpd.apache.org/" />,
789            and a apache-tomcat connector, available
790            from <ulink
791            url="http://tomcat.apache.org/connectors-doc/index.html" />
792          </para>
793        </listitem>
794      </varlistentry>
795
796      <varlistentry>
797        <term>Setup done!</term>
798        <listitem>
799          <para>
800            Happy BASEing. Now you can log on to your BASE server as
801            user <emphasis>root</emphasis> (use
802            the <emphasis>base_root_password</emphasis> from the
803            database initialisation step above). You should begin with
804            creating a couple user accounts, for more information on
805            how to create user accounts please refer to
806            <xref linkend="accounts"/>.
807          </para>
808        </listitem>
809      </varlistentry>
810
811    </variablelist>
812
813  </sect1>      <!-- Installation instructions -->
814
815  <sect1 id="installation.jobagents">
816    <title>Installing job agents</title>
817
818    <para>
819      It is important to understand that the BASE application can be
820      spread on to several computers. The main BASE application is
821      serving HTTP requests, the underlying database engine is
822      providing storage and persistence of data, and job agents can be
823      installed on computers that will serve the BASE installation
824      with computing power and perform analysis and run plug-ins. In a
825      straight forward setup one computer provides all services needed
826      for running BASE. From this starting point it is easy to add
827      computers to shares load from the BASE server by installing job
828      agents on these additional computers.
829    </para>
830
831    <para>
832      A job agent is a program running on a computer regularly
833      checking the BASE job queue for jobs awaiting execution. When
834      the job agent finds a job that it is enabled to execute, it
835      loads the plug-in and executes it. Job agents will in this way
836      free up resources on the BASE application server, and thus allow
837      the BASE server to concentrate on serving web pages. Job agents
838      are optional and must be installed and setup
839      separately. However, BASE is prepared for job agent setup and to
840      utilise the agents, but the agent are not required.
841    </para>
842
843    <para>
844      A job agent supports many configuration options that are not
845      supported by the internal job queue. For example, you can
846      <itemizedlist>
847        <listitem>
848          <para>
849            Specify exactly which plug-ins each job agent should be
850            able to execute.
851          </para>
852        </listitem>
853        <listitem>
854          <para>
855            Give some plug-ins higher priority than other plug-ins.
856          </para>
857        </listitem>
858        <listitem>
859          <para>
860            Specify which users/groups/projects should be able to use
861            a specific job agent.
862          </para>
863        </listitem>
864        <listitem>
865          <para>
866            Override memory settings and more for each plug-in.
867          </para>
868        </listitem>
869        <listitem>
870          <para>
871            Execute plug-ins in separate processes. Thus, a misbehaving
872            plug-in cannot bring the main application server down.
873          </para>
874        </listitem>
875        <listitem>
876          <para>
877            Add more computers with job agents as needed.
878          </para>
879        </listitem>
880      </itemizedlist>
881      All these options make it possible to create a very flexible
882      setup. For example one job agent can be assigned for importing
883      data only, another job agent can be assigned for running
884      analysis plug-ins for specific project only, and a third may be a
885      catch-all job agent that performs all low-priority jobs.
886    </para>
887
888    <sect2 id="installation.jobagents.serverside">
889      <title>BASE application server side setup</title>
890      <para>
891        <variablelist>
892          <varlistentry>
893            <term>Make sure the internal job queue doesn't execute all plug-ins</term>
894            <listitem>
895              <para>
896                The setting <command>jobqueue.internal.runallplugins</command>
897                should be set to <command>false</command> for the
898                BASE server. This setting is found in
899                the <filename>&lt;base-dir&gt;/www/WEB-INF/classes/base.config</filename>
900                file. The changes will not take effect until the
901                application server is restarted.
902              </para>
903
904            </listitem>
905          </varlistentry>
906          <varlistentry id="installation.jobagent.user_account">
907            <term>Enable the job agent user account</term>
908            <listitem>
909              <para>
910                During installation of BASE a user account is created
911                for the job agent. This account is used by the job
912                agents to log on to BASE. The account is disabled by
913                default and must be enabled. Enable the account and
914                set a password using the BASE web interface.
915                The same password must also be set in the
916                <filename>jobagent.properties</filename> file, see
917                item
918                <xref linkend="installation.jobagent.client.properties"/>
919                below.
920              </para>
921            </listitem>
922          </varlistentry>
923        </variablelist>
924      </para>
925    </sect2>
926
927    <sect2 id="installation.jobagents.database">
928      <title>Database server setup</title>
929      <para>
930        <variablelist>
931          <varlistentry id="installation.jobagent.database">
932            <term>Create a user account on the database</term>
933            <listitem>
934              <para>
935                This is the similar to granting database access for
936                the BASE server user in the in the regular BASE
937                installation, cf.
938                <xref
939                linkend="installation.main.database"/>.
940                You must create an account in the database that is
941                allowed to connect from the job agent server. MySQL
942                example:
943<programlisting>GRANT ALL ON base2.* TO db_user@job.agent.host IDENTIFIED BY 'db_password';
944GRANT ALL ON base2dynamic.* TO db_user@job.agent.host;</programlisting>
945
946                Replace <command>job.agent.host</command> with the
947                host name of the server that is going to run the job
948                agent. You should also set password. This password is
949                used in item
950                <xref linkend="installation.jobagent.client.config"/>
951                below in job agent server setup. You can use the same
952                database user and password as in the regular database
953                setup.
954              </para>
955            </listitem>
956          </varlistentry>
957        </variablelist>
958      </para>
959    </sect2>
960
961    <sect2 id="installation.jobagents.client">
962      <title>Job agent client setup</title>
963      <para>
964        <variablelist>
965          <varlistentry>
966            <term>Download and unpack a regular BASE distribution</term>
967            <listitem>
968              <para>
969                You <emphasis>must</emphasis> use the same version on
970                the web server and all job agents. You find the
971                downloads at
972                <ulink
973                url="http://base.thep.lu.se/wiki/DownloadPage">http://base.thep.lu.se/wiki/DownloadPage</ulink>
974              </para>
975            </listitem>
976          </varlistentry>
977          <varlistentry id="installation.jobagent.client.config">
978            <term>Edit the <filename>base.config</filename> file</term>
979            <listitem>
980              <para>
981                The <filename>&lt;base-dir&gt;/www/WEB-INF/classes/base.config</filename>
982                file must be configured as in regular BASE
983                installation, cf.
984                <xref
985                linkend="installation.main.configuration"/>,
986                to use the same database as the web server
987                application. The most important settings are
988                <itemizedlist>
989                  <listitem>
990                    <para>
991                      <command>db.username</command>: The database
992                      user you created in item
993                      <xref
994                      linkend="installation.jobagent.database"/>
995                      above.
996                    </para>
997                  </listitem>
998                  <listitem>
999                    <para>
1000                      <command>db.password</command>: The password for
1001                      the user.
1002                    </para>
1003                  </listitem>
1004                  <listitem>
1005                    <para>
1006                      <command>db.url</command>: The connection url to
1007                      the database.
1008                    </para>
1009                  </listitem>
1010                  <listitem>
1011                    <para>
1012                      <command>userfiles</command>: The path to the
1013                      directory where user files are located. This
1014                      directory must be accessible from all job
1015                      agents, i.e., by nfs or other file system
1016                      sharing method.
1017                    </para>
1018                  </listitem>
1019                  <listitem>
1020                    <para>
1021                      <command>plugins.dir</command>: The path to the
1022                      directory where plug-ins are located. This
1023                      directory must be accessible from all job
1024                      agents, i.e., by nfs or other file system
1025                      sharing method.
1026                    </para>
1027                  </listitem>
1028                </itemizedlist>
1029                See the <xref linkend="appendix.base.config"/> for
1030                more information about the settings in
1031                the <filename>base.config</filename> file.
1032              </para>
1033            </listitem>
1034          </varlistentry>
1035          <varlistentry id="installation.jobagent.client.properties">
1036            <term>Edit
1037            the <filename>jobagent.properties</filename> file</term>
1038            <listitem>
1039              <para>
1040                The <filename>&lt;base-dir&gt;/www/WEB-INF/classes/jobagent.properties</filename>
1041                file contains settings for the job agent. The most
1042                important ones to specify value for are
1043                <itemizedlist>
1044                  <listitem>
1045                    <para>
1046                      <command>agent.password</command>: The password
1047                      you set for the job agent user account in item
1048                      <xref
1049                      linkend="installation.jobagent.user_account"/>
1050                      above.
1051                    </para>
1052                  </listitem>
1053                  <listitem>
1054                    <para>
1055                      <command>agent.id</command>: An ID that must be
1056                      unique for each job agent accessing the BASE application.
1057                    </para>
1058                  </listitem>
1059                  <listitem>
1060                    <para>
1061                      <command>agent.remotecontrol</command>: The
1062                      name or ip address of the web server if you want it
1063                      to be able to display info about running
1064                      jobs. The job agent will only allow connections
1065                      from computers specified in this setting.
1066                    </para>
1067                  </listitem>
1068                </itemizedlist>
1069              </para>
1070              <para>
1071                The <filename>jobagent.properties</filename> file
1072                contains many more configuration options. See
1073                the <xref linkend="appendix.jobagent.properties"/> for
1074                more information.
1075              </para>
1076            </listitem>
1077          </varlistentry>
1078          <varlistentry>
1079            <term>Register the job agent</term>
1080            <listitem>
1081              <para>
1082                From the <filename>bin</filename> directory, register
1083                the job agent with
1084                <programlisting>./jobagent.sh register</programlisting>
1085              </para>
1086            </listitem>
1087          </varlistentry>
1088          <varlistentry>
1089            <term>Start the job agent</term>
1090            <listitem>
1091              <para>
1092                From the <filename>bin</filename> directory, start the
1093                job agent with
1094                <programlisting>./jobagent.sh start &amp;</programlisting>
1095              </para>
1096              <para>
1097                See the <xref linkend="appendix.jobagent.sh"/>
1098                for more information about what you can do
1099                with the job agent command line interface.
1100              </para>
1101            </listitem>
1102          </varlistentry>
1103        </variablelist>
1104      </para>
1105    </sect2>
1106
1107
1108    <sect2 id="installation.jobagents.configuration">
1109      <title>Configuring the job agent</title>
1110   
1111      <para>
1112        A job agent will not execute a plug-in unless the administrator
1113        has configured the job agent to do so. There are two things that
1114        must be done:
1115      </para>
1116     
1117      <itemizedlist>
1118        <listitem>
1119        <para>
1120          Share the job agent to the users, groups and project that should be
1121          able to use it. If the job agent is not shared, only the owner of
1122          job agent is allowed to use it. Use the regular <guilabel>Share</guilabel>
1123          functionality to specify which users/groups/projects
1124          should be able to use the job agent. You must give
1125          them at least <command>USE</command> permission.
1126          To give all users permission to the job agent share it
1127          to the <command>EVERYONE</command> group.
1128        </para>
1129        </listitem>
1130       
1131        <listitem>
1132        <para>
1133          Selecting plug-ins that the job agent should handle. This can be
1134          done either from the plug-in pages or from the job agent pages. To register
1135          a plug-in with one or more job agents from the plug-in pages, go
1136          to the edit view of the plug-in and select the <guilabel>Job
1137          agents</guilabel> tab. To do the same from the job agent pages,
1138          go to the edit view of the job agent and select
1139          the <guilabel>Plugins</guilabel> tab. The registration dialogues
1140          are very similar but only the plug-in side of registration is
1141          described here. The major difference is that it is not possible
1142          to enable/disable the internal job queue for plug-in when using
1143          the jobagent side of the registration.
1144        </para>
1145        </listitem>
1146      </itemizedlist>
1147   
1148      <figure id="plugins.figures.jobagents">
1149        <title>Select job agents for a plug-in</title>
1150        <screenshot>
1151          <mediaobject>
1152            <imageobject><imagedata 
1153              scalefit="1" width="100%"
1154              fileref="figures/plugin_jobagents.png" format="PNG"
1155              /></imageobject>
1156          </mediaobject>
1157        </screenshot>
1158      </figure>
1159   
1160      <helptext external_id="plugindefinition.jobagents" 
1161        title="Job agents">
1162       
1163        <para>
1164          Use this tab to specify which job agents the plug-in is
1165          installed and allowed to be executed on.
1166        </para>
1167       
1168        <variablelist>
1169        <varlistentry>
1170          <term><guilabel>Run this plugin on</guilabel></term>
1171          <listitem>
1172            <para>
1173              You may select if the internal job queue should execute the
1174              plug-in or not.
1175            </para>
1176          </listitem>
1177        </varlistentry>
1178        <varlistentry>
1179          <term><guilabel>Job agents</guilabel></term>
1180          <listitem>
1181            <para>
1182              A list with the job agents where the plug-in is installed and
1183              allowed to be executed. Select a job agent in this list to display
1184              more configuration options for the plug-in.
1185            </para>
1186          </listitem>
1187        </varlistentry>
1188        <varlistentry>
1189          <term><guilabel>Add job agents</guilabel></term>
1190          <listitem>
1191            <para>
1192              Use this button to open a pop-up window for selecting
1193              job agents.
1194            </para>
1195          </listitem>
1196        </varlistentry>
1197        <varlistentry>
1198          <term><guilabel>Remove</guilabel></term>
1199          <listitem>
1200            <para>
1201              Remove the selected plug-in from the list.
1202            </para>
1203          </listitem>
1204        </varlistentry>
1205        </variablelist>
1206       
1207        <para>
1208          The following properties are only displayed when a
1209          job agent has been selected in the list. Each job agent may have it's
1210          own settings of these properties. If you leave the values unspecified
1211          the job agent will use the default values specified on the
1212          <guilabel>Plugin</guilabel> tab.
1213        </para>
1214       
1215        <variablelist>
1216        <varlistentry>
1217          <term><guilabel>Max memory</guilabel></term>
1218          <listitem>
1219            <para>
1220              The maximum amount of memory the plug-in is allowed to use.
1221              Add around 40MB for the Java run-time environment and BASE.
1222              If not specified Java will choose it's default value which is 64MB.
1223            </para>
1224          </listitem>
1225        </varlistentry>
1226        <varlistentry>
1227          <term><guilabel>Trusted</guilabel></term>
1228          <listitem>
1229            <para>
1230              If the plug-in should be executed in a protected or
1231              unprotected environment. Currently, BASE only supports
1232              running plug-ins in an unprotected environment.
1233            </para>
1234          </listitem>
1235        </varlistentry>
1236        <varlistentry>
1237          <term><guilabel>Priority boost</guilabel></term>
1238          <listitem>
1239            <para>
1240              Used to give a plug-in higher priority in the job queue.
1241              Values between 0 and 10 are allowed. A higher value will
1242              give the plug-in higher priority. The priority boost is useful
1243              if we, for example, want to use one server mainly for importing
1244              data. By giving all import plugins a priority boost they will
1245              be executed before all other jobs, which will have to wait
1246              until there are no more waiting imports.
1247            </para>
1248          </listitem>
1249        </varlistentry>
1250        </variablelist>
1251       
1252        <seeother>
1253          <other external_id="plugindefinition.edit">Plug-in properties</other>
1254          <other external_id="plugindefinition.edit.permissions">Plug-in permissions</other>
1255        </seeother>
1256      </helptext>
1257    </sect2>
1258
1259  </sect1>      <!-- job agent setup -->
1260
1261  <sect1 id="installation.serverconfigurations">
1262    <title>Server configurations</title>
1263    <para>
1264      Some server configurations can be done when the installation process is finished and
1265      BASE is up and running. Log into BASE with administration rights and then
1266      open the configuration dialog from menu
1267      <menuchoice>
1268        <guimenu>Administrate</guimenu>
1269        <guimenuitem>Server settings</guimenuitem>
1270      </menuchoice>.
1271      Each tab in the configuration dialog-window is described below.
1272    </para>
1273   
1274      <figure id="installation.figures.serverconfiguration">
1275        <title>Server configuration</title>
1276        <screenshot>
1277          <mediaobject>
1278            <imageobject><imagedata 
1279              fileref="figures/server_configuration.png" format="PNG"
1280              /></imageobject>
1281          </mediaobject>
1282        </screenshot>
1283      </figure>
1284     
1285    <variablelist>
1286      <varlistentry>
1287        <term>
1288          <guilabel>File transfer</guilabel>
1289        </term>
1290        <listitem>
1291          <helptext external_id="serverconfig.filetransfer" title="File transfer rate">
1292            <variablelist>
1293              <varlistentry>
1294                <term><guilabel>Max upload rate</guilabel></term>
1295                <listitem>
1296                  <para>
1297                    This is a limit of how many bytes of data that should be
1298                    transferred per second when uploading files to BASE. Prefixes
1299                    like k, M or G can be used for larger values, just like
1300                    described in the tab. The limit is per ongoing upload
1301                    and the default value is 100MB/s.
1302                  </para>
1303                </listitem>
1304              </varlistentry>
1305              <varlistentry>
1306                <term><guilabel>Max download rate</guilabel></term>
1307                <listitem>
1308                  <para>
1309                    This is a limit of how many bytes of data that should be
1310                    transferred per second when downloading files from BASE. Prefixes
1311                    like k, M or G can be used for larger values. The limit is per ongoing
1312                    download and the default value is unlimited.
1313                  </para>
1314                </listitem>
1315              </varlistentry>
1316              <varlistentry>
1317                <term><guilabel>Unlimited</guilabel></term>
1318                <listitem>
1319                  <para>
1320                    Check one or both to not limit the upload/download transfer rate.
1321                    In this case, the Internet connection of the server is the limit.
1322                  </para>
1323                </listitem>
1324              </varlistentry>
1325            </variablelist>
1326          </helptext>
1327        </listitem>
1328      </varlistentry>
1329      <varlistentry>
1330        <term>
1331          <guilabel>About</guilabel>
1332        </term>
1333        <listitem>
1334          <helptext external_id="serverconfig.about"
1335            title="Information about the server">
1336            <variablelist>
1337              <varlistentry>
1338                <term><guilabel>Administrator name</guilabel></term>
1339                <listitem>
1340                  <para>
1341                    Name of the responsible administrator. The name is displayed
1342                    at the bottom of each page in BASE and in the about-dialog.
1343                  </para>
1344                </listitem>
1345              </varlistentry>
1346              <varlistentry>
1347                <term><guilabel>Administrator email</guilabel></term>
1348                <listitem>
1349                  <para>
1350                    An email which the administrator can be contacted on. The
1351                    administrator name, visible at the bottom of each page, will
1352                    be linked to this email address.
1353                  </para>
1354                </listitem>
1355              </varlistentry>
1356              <varlistentry>
1357                <term><guilabel>About</guilabel></term>
1358                <listitem>
1359                  <para>
1360                    Text written in this field is displayed in the
1361                    <guilabel>About this server</guilabel> section on the login
1362                    page and in the about-dialog window. We recommend changing the
1363                    default Latin text to something meaningful, or remove it
1364                    to hide the section completely.
1365                  </para>
1366                </listitem>
1367              </varlistentry>
1368            </variablelist>
1369          </helptext>
1370        </listitem>
1371      </varlistentry>
1372      <varlistentry>
1373        <term>
1374          <guilabel>Get account</guilabel>
1375        </term>
1376        <listitem>
1377          <helptext external_id="serverconfig.getaccount"
1378            title="Instructions to get an account">
1379            <para>
1380              A description what a user should do to get
1381              an account on the particular BASE server. This text is linked
1382              to the <guilabel>Get an account!</guilabel> link on the login
1383              page. We recommend that the Latin text is replaced with some useful
1384              information, or that it is removed to hide the link.
1385            </para>
1386          </helptext>
1387        </listitem>
1388      </varlistentry>
1389      <varlistentry>
1390        <term>
1391          <guilabel>Forgotten password</guilabel>
1392        </term>
1393        <listitem>
1394          <helptext external_id="serverconfig.password"
1395            title="Instructions when password is forgotten.">
1396            <para>
1397              A description what a user should do if the password is forgotten.
1398              This text is linked
1399              to the <guilabel>Forgot your password?</guilabel> link on the login
1400              page. We recommend that the Latin text is replaced with some useful
1401              information, or that it is removed to hide the link.
1402            </para>
1403          </helptext>
1404        </listitem>
1405      </varlistentry>
1406      <varlistentry>
1407        <term>
1408          <guilabel>Links</guilabel>
1409        </term>
1410        <listitem>
1411          <helptext external_id="serverconfig.links" title="Configurable links">
1412            <para>
1413              External configurable link-types inside BASE.
1414              <note>
1415                <para>
1416                  Only link-types that have been set will be visible in the web
1417                  client.
1418                </para>
1419              </note>
1420            </para>
1421            <variablelist>
1422              <varlistentry>
1423                <term><guilabel>Help</guilabel></term>
1424                <listitem>
1425                  <para>
1426                    Links to where the help text is located. By default
1427                    this is set to the documentation for the latest released
1428                    BASE version on the BASE web site,
1429                    <ulink
1430                      url="http://base.thep.lu.se/chrome/site/doc/html/index.html">
1431                      http://base.thep.lu.se/chrome/site/doc/html/index.html</ulink>.
1432                   
1433                    If you want the documentation for a specific version you will
1434                    have to setup a site for that yourself and then change the link
1435                    to that site. The documentation is included in the downloaded package
1436                    in the directory <filename>&lt;basedir&gt;/doc/html</filename>.
1437                  </para>
1438                </listitem>
1439              </varlistentry>
1440              <varlistentry>
1441                <term>
1442                  <guilabel>FAQ</guilabel>
1443                </term>
1444                <listitem>
1445                  <para>Where frequently asked questions can be found. Empty by default.</para>
1446                </listitem>
1447              </varlistentry>
1448              <varlistentry>
1449                <term>
1450                  <guilabel>Report a bug</guilabel>
1451                </term>
1452                <listitem>
1453                  <para>
1454                    Where the user could report bugs, feature request or
1455                    perhaps other feedback that concerns the program. As default
1456                    this is set to the feedback section on BASE web site,
1457                    <ulink url="http://base.thep.lu.se/#Feedback">http://base.thep.lu.se/#Feedback</ulink>.
1458                    Note that users must login in order to submit information.
1459                  </para>
1460                </listitem>
1461              </varlistentry>
1462            </variablelist>
1463          </helptext>
1464        </listitem>
1465      </varlistentry>
1466    </variablelist>
1467   
1468    <sect2 id="installation.broadcast">
1469      <title>Sending a broadcast message to logged in users</title>
1470
1471      <para>
1472        It is possible to send a message to all logged in user.
1473        Open the
1474        <menuchoice>
1475          <guimenu>Administrate</guimenu>
1476          <guimenuitem>Broadcast message</guimenuitem>
1477        </menuchoice> dialog box.
1478      </para>
1479     
1480      <figure id="installation.figures.broadcast">
1481        <title>Broadcast message</title>
1482        <screenshot>
1483          <mediaobject>
1484            <imageobject><imagedata 
1485              fileref="figures/broadcast_message.png" format="PNG"
1486              /></imageobject>
1487          </mediaobject>
1488        </screenshot>
1489      </figure>
1490     
1491      <helptext external_id="broadcast.message" title="Broadcast message">
1492        <para>
1493        This dialog allows you to specify a message that is sent to all
1494        logged in users as well as on the login form. It is also possible
1495        to "disable" login.
1496        </para>
1497        <variablelist>
1498        <varlistentry>
1499          <term><guilabel>Title</guilabel></term>
1500          <listitem>
1501            <para>
1502            The title of the message. It should be a short and concise to
1503            avoid confusion. The title will be displayed on a lot of places
1504            and a user may have to click on it to read the more detailed
1505            message.
1506            </para>
1507          </listitem>
1508        </varlistentry>
1509        <varlistentry>
1510          <term><guilabel>Disable login</guilabel></term>
1511          <listitem>
1512            <para>
1513            Mark this check-box to try to prevent new users from logging in. To
1514            avoid problems that can be caused by blocking the server admin out,
1515            the login is not completely disabled. Any user can still login but
1516            only after by-passing several warnings.
1517            </para>
1518          </listitem>
1519        </varlistentry>
1520        <varlistentry>
1521          <term><guilabel>Message</guilabel></term>
1522          <listitem>
1523            <para>
1524            If needed, a longer message giving more information. Users may
1525            have to click on a link to be able to see the complete message.
1526            </para>
1527          </listitem>
1528        </varlistentry>
1529        </variablelist>
1530       
1531        <note>
1532          The message will be enabled until it is manually removed by saving
1533          an empty form, or until the Tomcat server is restarted. Since the
1534          message is only kept in memory, a restart will always remove it.
1535        </note>
1536     
1537      </helptext>
1538     
1539    </sect2>
1540   
1541  </sect1>
1542
1543  <sect1 id="installation.migrate">
1544    <title>Migrating from MySQL to PostgreSQL</title>
1545   
1546    <para>
1547      It is possible to migrate a BASE installation on a MySQL database to a
1548      PostgreSQL database. In a real-world scenario a migration is probably coupled
1549      with a hardware upgrade, i.e. the MySQL installation is on one (the old) server
1550      and the PostgreSQL installation is on another (the new) server. While
1551      this is not any problem per se, it requires a few extra steps to ensure that
1552      everything has been moved to the new server. There are three main steps involved:
1553    </para>
1554   
1555    <variablelist>
1556      <varlistentry>
1557        <term>Export</term>
1558        <listitem>
1559          <para>
1560          The first step is to export all data in the existing database. Use
1561          the following procedure:
1562          </para>
1563         
1564          <orderedlist>
1565            <listitem>
1566              <para>
1567              Upgrade to the latest BASE release. This is recommended since
1568              it probably has fewer bugs.
1569              </para>
1570            </listitem>
1571
1572            <listitem>
1573              <para>
1574              Make sure that no other processes are writing to the database
1575              when the export is running. Shut down Tomcat and all job agents.
1576              It may also be a good idea to ensure that no backup scripts or
1577              other external programs are reading from the database at the same
1578              time. If the database is large, this may affect performance due to
1579              increased disk I/O.
1580              </para>
1581            </listitem>
1582           
1583            <listitem>
1584              <para>
1585              Create a temporary working directory in a suitable
1586              location. This directory will be used for storing the
1587              exported data. Disk I/O performance may be better if
1588              this directory is on a different disk than what the
1589              database is using. Ensure that the location has enough
1590              free space to hold all data from the BASE database. The dump
1591              typically uses less than 10% of the disk space used by the
1592              MySQL tables.
1593              </para>
1594            </listitem>
1595
1596            <listitem>
1597              <para>
1598              Make sure that you have configured migration-specific settings
1599              in the <filename>base.config</filename> file. In most cases the
1600              default settings should be good, but if you are experiencing
1601              performance problems it may be necessary to change some settings.
1602              See <xref linkend="appendix.base.config.migrate" /> for more
1603              information.
1604              </para>
1605            </listitem>
1606
1607            <listitem>           
1608              <para>
1609                Start the export by changing to the <filename
1610                class="directory">&lt;base-dir&gt;/bin/</filename>
1611                directory and execute:
1612              </para>
1613<programlisting>
1614./migrate.sh export <replaceable>/path/to/migration/dir</replaceable>
1615</programlisting>
1616              <para>
1617                where <replaceable>/path/to/migration/dir</replaceable>
1618                is replaced with the path to the working directory created above.
1619                Depending on the size of the BASE installation the export may
1620                take a long time.
1621              </para>
1622            </listitem>
1623          </orderedlist>
1624         
1625          <note>
1626            <para>
1627              Make sure that the migration working directory is empty to perform
1628              a full export. Existing files in the directory causes the corresponding
1629              tables to be skipped. This can be useful when debugging and after a
1630              server crash, since the export will resume where it stopped. Just make
1631              sure that the database hasn't been modified in the meantime.
1632            </para>
1633          </note>
1634          <warning>
1635            <para>
1636            When exporting, make sure that no other process is updating the
1637            database since that may create an inconsistent snapshot. The
1638            export process does not lock the database or take any other means
1639            to protect it against concurrent modifications.
1640            </para>
1641          </warning>
1642        </listitem>
1643      </varlistentry>
1644     
1645      <varlistentry>
1646        <term>Moving data</term>
1647        <listitem>
1648          <para>
1649          This step is about moving the data from the old BASE server to the
1650          new BASE server. If the migration is taking place on a single server,
1651          this step can probably be skipped.
1652          </para>
1653         
1654          <orderedlist>
1655            <listitem>
1656              <para>
1657              Download and unpack the BASE software on the new server. Make sure that you are
1658              using the same version as on the old server. It is also important that
1659              the database is identically configured. Pay special attention
1660              to the <filename>extended-properties.xml</filename> and
1661              <filename>raw-data-types.xml</filename> files and any files
1662              in the <filename
1663              class="directory">&lt;base-dir&gt;/WEB-INF/classes/extended-properties</filename>
1664              and <filename
1665              class="directory">&lt;base-dir&gt;/WEB-INF/classes/raw-data-types</filename>
1666              directories.
1667              The import program protects against some mistakes by comparing
1668              the column names from the export with the column names in the new
1669              database, but it will, for example, not check that data types match.
1670              </para>
1671             
1672              <tip>
1673                The easiest way to do this is to simply copy the BASE installation
1674                from the old server to the new server. Then, go through the
1675                configuration files and make sure that paths are correct.
1676              </tip>
1677             
1678            </listitem>
1679         
1680            <listitem>
1681              <para>
1682              Move user files from the old server to the new server. Make sure that
1683              the <property>userfiles</property> setting in <filename>base.config</filename>
1684              is correct.
1685              </para>
1686            </listitem>
1687           
1688            <listitem>
1689              <para>
1690              Move plug-ins from the old server to the new server. Make sure that
1691              the <property>plugins.dir</property> setting in <filename>base.config</filename>
1692              is correct.
1693              </para>
1694            </listitem>
1695
1696            <listitem>
1697              <para>
1698              Check other settings in <filename>base.config</filename> and
1699              other configuration files for settings that may be affected by
1700              the move.
1701              </para>
1702            </listitem>
1703         
1704          </orderedlist>
1705         
1706        </listitem>
1707      </varlistentry>
1708     
1709      <varlistentry>
1710        <term>Import</term>
1711        <listitem>
1712          <para>
1713            When everything has been moved and is properly configured it is
1714            time to start with the import.
1715          </para>
1716         
1717          <orderedlist>
1718            <listitem>
1719              <para>
1720              Create a new empty database following the
1721              instructions in <xref linkend="installation.main.database" />.
1722              Make the corresponding changes in <filename>base.config</filename>
1723              so that the BASE installation points to the new database.
1724              Also, make sure that you have configured migration-specific settings
1725              in the <filename>base.config</filename> file. In most cases the
1726              default settings should be good, but if you are experiencing
1727              performance problems it may be necessary to change some settings.
1728              See <xref linkend="appendix.base.config.migrate" /> for more
1729              information.
1730              </para>
1731            </listitem>
1732         
1733            <listitem>
1734              <para>
1735              Read the
1736              <ulink url="http://www.postgresql.org/docs/9.1/interactive/populate.html">http://www.postgresql.org/docs/9.1/interactive/populate.html</ulink>
1737              document from the PostgreSQL documentation and consider implementing some
1738              of the tips. The migration script makes sure that no indexes or foreign
1739              key constraints are active during the data import, but the tips about memory,
1740              checkpoint intervals, WAL archiving, etc. (section 14.4.5 and on) can be useful.
1741              It may also be a good idea to turn off the auto-vacuum daemon during the import.
1742              </para>
1743            </listitem>
1744           
1745            <listitem>
1746              <para>
1747                Start the import by changing to the <filename
1748                class="directory">&lt;base-dir&gt;/bin/</filename>
1749                directory and execute:
1750              </para>
1751<programlisting>
1752./migrate.sh import <replaceable>/path/to/migration/dir</replaceable>
1753</programlisting>
1754              <para>
1755                where <replaceable>/path/to/migration/dir</replaceable>
1756                is replaced with the path to the directory where
1757                the exported data is stored. Depending on
1758                the size of the BASE installation this may take a long time.
1759              </para>
1760             
1761              <note>
1762                <title>Installations with separate web and database servers</title>
1763                <para>
1764                Both export and import may be executed against remote MySQL/PostgreSQL
1765                servers without limitation. The migration working directory need only
1766                to be accessible by the BASE migration program.
1767                </para>
1768              </note>
1769             
1770            </listitem>
1771           
1772            <listitem>
1773              <para>
1774              Restart Tomcat and verify that the migration was successful. Eg.
1775              check that you can log in to BASE, that you can access files,
1776              that plug-ins are working, etc. Then, shut everything down again.
1777              </para>
1778            </listitem>
1779
1780            <listitem>
1781              <para>
1782              Setup backup procedures for the new server. Verify that the
1783              backup is working before starting up Tomcat again.         
1784              Restart any job agents (make sure that the are configured to use
1785              the new server). When everything is up and running again, the
1786              <replaceable>/path/to/migration/dir</replaceable> directory
1787              and all files can be deleted.
1788              </para>
1789            </listitem>
1790          </orderedlist>
1791       
1792        </listitem>
1793      </varlistentry>
1794    </variablelist>
1795   
1796  </sect1>
1797
1798</chapter>
Note: See TracBrowser for help on using the repository browser.