What you need to install digilib

Installation

On Linux

  1. Make shure Java JDK is installed
  2. Create a base directory for docuserver (the default used here is /docuserver) and for the web interface (/docuserver/www).
  3. Unpack the digilib-core package in the web interface directory (/docuserver/www). This will create the digilib directory digitallibrary.
  4. (optional) Unpack the digilib-ext package in the docuserver directory.
  5. Unpack Jakarta tomcat 4.0.1 in /opt This should produce a directory /opt/jakarta-tomcat-4.0.1. Create a link /opt/tomcat to the new directory.
  6. Unpack the configuration files package digilib-tomconf in the tomcat directory.
  7. Adjust hostname and HTML-base directory in the file server.xml (in the directory /opt/tomcat/conf, see below for details))
  8. Adjust the path to the JDK and its options in catalina.sh (in the directory /opt/tomcat/bin, see below for details)
  9. (optional) For SuSE Linux you can use the startup skript tomcat/bin/rctomcat to start and stop the tomcat server. Copy the script into /etc/init.d as tomcat and set runlevel links accordingly.
  10. (optional) Set the tomcat directory and all files to be owned by the user wwwrun (or whatever your webserver runs) and use this account to start the tomcat server.

Configuration

Tomcat

catalina.sh

The file catalina.sh (in /opt/tomcat/bin has been modified to provide the path to the JDK and runtime options for the Java VM. Somewhere at the beginning of the file are two lines like this:

export JAVA_HOME=/usr/local/lib/IBMJava2-13
export CATALINA_OPTS="-mx512m"

Adjust the JAVA_HOME path to point to your Java JDK installation directory. You can adjust the memory used by the Java VM with the -mx512m option.

You can delete those two lines if you set these variables in your shell before starting tomcat in that same shell. These lines are needed if you want to use the startup script for linux mentioned above.

server.xml

The environment of the tomcat server is configured in the file server.xml in /opt/tomcat/conf. Extensive documentation about all options can by found on the webpages of the tomcat project.

A minimal configuration file for running digilib is provided in the digilib-tomconf package. For standard operation only a few adjustments have to be made. The configuration file should look like this:

<!-- Digilib Server Configuration File -->

<Server port="8005" shutdown="SHUTDOWN" debug="0">

  <!-- Define an Apache-Connector Service -->
  <Service name="Tomcat-Docuserver">

    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
               port="8080" minProcessors="5" maxProcessors="75"
               acceptCount="10" debug="0" connectionTimeout="60000"/>

    <!-- Replace "localhost" with what your Apache "ServerName" is set to -->
    <Engine className="org.apache.catalina.connector.warp.WarpEngine"
     name="Apache" debug="1" appBase="webapps" defaultHost="hera.unibe.ch">

      <!-- Global logger unless overridden at lower levels -->
      <Logger className="org.apache.catalina.logger.FileLogger"
              prefix="apache_log." suffix=".txt"
              timestamp="true"/>

      <!-- Define the default virtual host. Hostname must match the engine's. -->
      <Host name="hera.unibe.ch" debug="0" appBase="/docuserver/www">

        <Context path="/docuserver/digitallibrary" docBase="/docuserver/www/digitallibrary" debug="0" reloadable="false">
	</Context>

      </Host>

      <!-- Because this Realm is here, an instance will be shared globally -->
      <Realm className="org.apache.catalina.realm.MemoryRealm" />

    </Engine>

  </Service>

</Server>

You can change the portnumber of your server to be something other than 8080 in the port property. If you want to use the default webserver port 80 you have to run tomcat as the root user (it is less secure to do this!).

You have to change the occurences of hera.unibe.ch (in the defaultHost and name properties) to your hostname.

Then you can adjust the /docuserver/www path to the directory where you installed the digilib-core package. You should not change the path property but only the appBase and docBase properties!

tomcat-users.xml

All passwords and usernames have to be set up in the file tomcat-users.xml in /opt/tomcat/conf if you want to use authentication in digilib. The file looks like this:

<tomcat-users>
  <user name="tomcat" password="tomcat" roles="tomcat" />
  <user name="role1"  password="tomcat" roles="role1"  />
  <user name="both"   password="tomcat" roles="tomcat,role1" />
</tomcat-users>

A user is identified by a name and password. These two elements have to be entered in a authentication form presented by the browser when accessing a restricted resource. A user can have one or more roles. These roles will be used by digilib to decide if an authenticated user is allowed to access a document (see digilib-auth.xml below).

tomcat has to be restarted before changes to tomcat-users.xml have effect!

Digilib

web.xml

The deployment of the digilib servlets and JSPs is defined in the file web.xml in the WEB-INF subdirectory of the digilib directory (/docuserver/www/digitallibrary/WEB-INF).

The only parameter you might have to adjust is the position of the digilib configuration file. The parameter occurs twice in the file and looks like this:

<!-- parameters to the servlet -->
<init-param>
  <param-name>config-file</param-name>
  <param-value>
    /docuserver/www/digitallibrary/WEB-INF/digilib-config.xml
  </param-value>
</init-param>

Change the path to where you installed the configuration files.

Make shure to change the parameter in both places! It is needed both for the servlet and the JSP pages!

digilib-config.xml

The main configuration for digilib is digilib-config.xml. It's position is defined by the config-file init-parameter to the servlets (see above).

In the configuration file you can set several paths and options. The file looks like this:

<!-- Digilib servlet config file -->

<digilib-config>
  <parameter name="debug-level" value="0" />

  <!--  Image to be sent to indicate general failure. -->
  <parameter name="error-image" value="/docuserver/images/icons/broken.gif" />

  <!--  Image to be sent to indicate authorization failure. -->
  <parameter name="denied-image" value="/docuserver/images/icons/alert.red.gif" />

  <!-- List of directories where images are searched.
       Directories with low-resolution images are first in list. -->
  <parameter name="basedir-list" value="/docuserver/scaled/small:/docuserver/images:/docuserver/scans/quellen" />

  <!-- Restrict access to authorized users.
       User authentication and roles are provided by the servlet container 
       (see tomcat-users.xml).
       Authorization for resources (directories) is evaluated by the servlet 
       (see auth-file). -->
  <parameter name="use-authorization" value="true" />

  <!-- 	  URL location of XML file with authorization requirements. -->
  <parameter name="auth-file" value="/docuserver/www/digitallibrary/WEB-INF/digilib-auth.xml" />

  <!-- Part of URL to indicate authenticated access to Tomcat. -->
  <parameter name="auth-url-path" value="authenticated/" />
</digilib-config>

You have to adjust the basedir-list parameter to the directories where your images are installed. You need only one directory if you do not have prescaled low resolution versions of your images.

You can supply your own images for the "error" and "access denied" messages by the servlet. Standard images will be used if these parameters are undefined.

The auth-file parameter has to point to the authorization configuration file (see below).

digilib-auth.xml

The digilib access authorization is defined in the file defined by the auth-file parameter (usually digilib-auth.xml in WEB-INF).

The file has two parts diglib-paths and diglib-addresses. It looks like this:

<auth-config>

  <digilib-paths>
    <!-- 
      A user must supply one of the roles under "role"
      to access the directory "name".
      Roles under "role" must be separated by comma only (no spaces).  
    -->
    <path name="histast/eastwood-collection" role="eastwood-coll" />
    <path name="ptolemaios_geo" role="ptolemaios-geo" />
  </digilib-paths>

  <digilib-addresses>
    <!-- 
      A computer with an ip address that matches "ip"
      is automatically granted all roles under "role".
      The ip address is matched from the left (in full quads).
      Roles under "role" must be separated by comma only (no spaces). 
    -->
    <address ip="127" role="local" />
    <address ip="130.92.68" role="eastwood-coll,ptolemaios-geo" />
    <address ip="130.92.151" role="ALL" />
  </digilib-addresses>

</auth-config>

diglib-paths defines restricted directories and the roles needed for access. The roles are defined with the users in tomcat-users.xml (see above). All subdirectories of the given directories have the same restrictions. All directories not listed here (and not subdirectories of listed directories) are freely accessible.

diglib-addresses defines hosts or networks of computers that are automatically authenticated without username and password. Hosts can be assigned roles. The special keyword ALL authorizes for everything. If the role assigned to the computer is not sufficient to access a resource the user will be asked for username and password.


robert.casties@philo.unibe.ch
Last modified: Thu Jan 17 19:12:01 CET 2002