annotate src/site/markdown/digilib-config.md @ 8:de31af0ad401

more doc for the website.
author casties
date Wed, 04 Sep 2013 09:08:17 +0200
parents cf3abd6ff312
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
ee158994651f updating to markdown
casties
parents:
diff changeset
1 # Configuring digilib
ee158994651f updating to markdown
casties
parents:
diff changeset
2
ee158994651f updating to markdown
casties
parents:
diff changeset
3 ## digilib-config.xml
ee158994651f updating to markdown
casties
parents:
diff changeset
4
ee158994651f updating to markdown
casties
parents:
diff changeset
5 The main configuration for digilib is `digilib-config.xml` in the `WEB-INF`
ee158994651f updating to markdown
casties
parents:
diff changeset
6 directory in the webapp.
8
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
7 (If you really need a different location you can define it in the `config-file`
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
8 init-parameter to the Servlet.)
5
ee158994651f updating to markdown
casties
parents:
diff changeset
9
ee158994651f updating to markdown
casties
parents:
diff changeset
10 In the XML-based configuration file you can set several paths and options.
ee158994651f updating to markdown
casties
parents:
diff changeset
11
ee158994651f updating to markdown
casties
parents:
diff changeset
12 You have to adjust the **`basedir-list`** parameter to the directories
ee158994651f updating to markdown
casties
parents:
diff changeset
13 where your images are installed. The directory path has to be an absolute
ee158994651f updating to markdown
casties
parents:
diff changeset
14 path following the conventions of your operating system (a relative path
ee158994651f updating to markdown
casties
parents:
diff changeset
15 is taken to be relative to the web application directory).
ee158994651f updating to markdown
casties
parents:
diff changeset
16
8
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
17 You need only one directory if you don't want to provide pre-scaled low resolution
5
ee158994651f updating to markdown
casties
parents:
diff changeset
18 versions of your images. If you have pre-scaled images the directory with the
ee158994651f updating to markdown
casties
parents:
diff changeset
19 high-resolution images must be the first entry in the list.
ee158994651f updating to markdown
casties
parents:
diff changeset
20
ee158994651f updating to markdown
casties
parents:
diff changeset
21 Documentation on the directory layout and on using pre-scaled images is
ee158994651f updating to markdown
casties
parents:
diff changeset
22 [here](image-directories.md).
ee158994651f updating to markdown
casties
parents:
diff changeset
23
ee158994651f updating to markdown
casties
parents:
diff changeset
24 A minimal configuration looks like this:
ee158994651f updating to markdown
casties
parents:
diff changeset
25
ee158994651f updating to markdown
casties
parents:
diff changeset
26 <!-- Digilib servlet config file -->
ee158994651f updating to markdown
casties
parents:
diff changeset
27 <digilib-config>
ee158994651f updating to markdown
casties
parents:
diff changeset
28 <!-- List of directories where images are searched.
ee158994651f updating to markdown
casties
parents:
diff changeset
29 The authoritative directory with the high-resolution images
ee158994651f updating to markdown
casties
parents:
diff changeset
30 is first in list. -->
ee158994651f updating to markdown
casties
parents:
diff changeset
31 <parameter name="basedir-list" value="/docuserver/images" />
ee158994651f updating to markdown
casties
parents:
diff changeset
32 </digilib-config>
ee158994651f updating to markdown
casties
parents:
diff changeset
33
8
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
34 A more customized configuration may look like this (for a full list of
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
35 configuration options use the source:
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
36 [1](http://hg.berlios.de/repos/digilib/file/default/common/src/main/java/digilib/conf/DigilibConfiguration.java)
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
37 [2](http://hg.berlios.de/repos/digilib/file/default/servlet/src/main/java/digilib/conf/DigilibServletConfiguration.java)
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
38 [3](http://hg.berlios.de/repos/digilib/file/default/servlet3/src/main/java/digilib/conf/DigilibServlet3Configuration.java)
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
39 ):
5
ee158994651f updating to markdown
casties
parents:
diff changeset
40
ee158994651f updating to markdown
casties
parents:
diff changeset
41 <!-- Digilib servlet config file -->
ee158994651f updating to markdown
casties
parents:
diff changeset
42 <digilib-config>
ee158994651f updating to markdown
casties
parents:
diff changeset
43 <!-- Image to be sent to indicate general failure. -->
ee158994651f updating to markdown
casties
parents:
diff changeset
44 <parameter name="error-image" value="/docuserver/images/icons/broken.gif" />
ee158994651f updating to markdown
casties
parents:
diff changeset
45
ee158994651f updating to markdown
casties
parents:
diff changeset
46 <!-- Image to be sent to indicate authorization failure. -->
ee158994651f updating to markdown
casties
parents:
diff changeset
47 <parameter name="denied-image" value="/docuserver/images/icons/alert.red.gif" />
ee158994651f updating to markdown
casties
parents:
diff changeset
48
8
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
49 <!-- Image to be sent to indicate file-not-found. -->
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
50 <parameter name="notfound-image" value="/docuserver/images/icons/notfound.gif" />
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
51
5
ee158994651f updating to markdown
casties
parents:
diff changeset
52 <!-- List of directories where images are searched.
ee158994651f updating to markdown
casties
parents:
diff changeset
53 The authoritative directory with the high-resolution images
ee158994651f updating to markdown
casties
parents:
diff changeset
54 is first in list. -->
ee158994651f updating to markdown
casties
parents:
diff changeset
55 <parameter name="basedir-list" value="/docuserver/images:/docuserver/scaled/small" />
ee158994651f updating to markdown
casties
parents:
diff changeset
56
ee158994651f updating to markdown
casties
parents:
diff changeset
57 <!-- mimimum amount of scaling done with antialiasing -->
ee158994651f updating to markdown
casties
parents:
diff changeset
58 <parameter name="subsample-minimum" value="2"/>
ee158994651f updating to markdown
casties
parents:
diff changeset
59
ee158994651f updating to markdown
casties
parents:
diff changeset
60 <!-- default interpolation quality (0=worst) -->
8
de31af0ad401 more doc for the website.
casties
parents: 7
diff changeset
61 <parameter name="default-quality" value="2"/>
5
ee158994651f updating to markdown
casties
parents:
diff changeset
62
ee158994651f updating to markdown
casties
parents:
diff changeset
63 <!-- is sending whole image files with mo=file allowed? -->
ee158994651f updating to markdown
casties
parents:
diff changeset
64 <parameter name="sendfile-allowed" value="true" />
ee158994651f updating to markdown
casties
parents:
diff changeset
65
ee158994651f updating to markdown
casties
parents:
diff changeset
66 <!-- the a maximum size of any sent image. (0 means no limit) -->
ee158994651f updating to markdown
casties
parents:
diff changeset
67 <parameter name="max-image-size" value="0" />
ee158994651f updating to markdown
casties
parents:
diff changeset
68
ee158994651f updating to markdown
casties
parents:
diff changeset
69 <!-- number of working threads -->
ee158994651f updating to markdown
casties
parents:
diff changeset
70 <parameter name="worker-threads" value="2" />
ee158994651f updating to markdown
casties
parents:
diff changeset
71
ee158994651f updating to markdown
casties
parents:
diff changeset
72 <!-- number of waiting requests in queue -->
ee158994651f updating to markdown
casties
parents:
diff changeset
73 <parameter name="max-waiting-threads" value="20" />
ee158994651f updating to markdown
casties
parents:
diff changeset
74
ee158994651f updating to markdown
casties
parents:
diff changeset
75 <!-- Restrict access to authorized users.
ee158994651f updating to markdown
casties
parents:
diff changeset
76 User authentication and roles are provided by the servlet container
ee158994651f updating to markdown
casties
parents:
diff changeset
77 (see tomcat-users.xml).
ee158994651f updating to markdown
casties
parents:
diff changeset
78 Authorization for resources (directories) is evaluated by the servlet
ee158994651f updating to markdown
casties
parents:
diff changeset
79 (see auth-file). -->
ee158994651f updating to markdown
casties
parents:
diff changeset
80 <parameter name="use-authorization" value="false"/>
ee158994651f updating to markdown
casties
parents:
diff changeset
81
ee158994651f updating to markdown
casties
parents:
diff changeset
82 <!-- Location of XML file with authorization requirements. -->
ee158994651f updating to markdown
casties
parents:
diff changeset
83 <parameter name="auth-file" value="digilib-auth.xml"/>
ee158994651f updating to markdown
casties
parents:
diff changeset
84
ee158994651f updating to markdown
casties
parents:
diff changeset
85 <!-- Part of URL to indicate authenticated access to Tomcat. -->
ee158994651f updating to markdown
casties
parents:
diff changeset
86 <parameter name="auth-url-path" value="authenticated/"/>
ee158994651f updating to markdown
casties
parents:
diff changeset
87
ee158994651f updating to markdown
casties
parents:
diff changeset
88 <!-- use mapping of "virtual directories" to real directories on the server -->
ee158994651f updating to markdown
casties
parents:
diff changeset
89 <parameter name="use-mapping" value="false"/>
ee158994651f updating to markdown
casties
parents:
diff changeset
90
ee158994651f updating to markdown
casties
parents:
diff changeset
91 <!-- location of XML mapping file -->
ee158994651f updating to markdown
casties
parents:
diff changeset
92 <parameter name="mapping-file" value="digilib-map.xml"/>
ee158994651f updating to markdown
casties
parents:
diff changeset
93
ee158994651f updating to markdown
casties
parents:
diff changeset
94 <!-- location of logger config file -->
ee158994651f updating to markdown
casties
parents:
diff changeset
95 <parameter name="log-config-file" value="log4j-config.xml"/>
ee158994651f updating to markdown
casties
parents:
diff changeset
96 </digilib-config>
ee158994651f updating to markdown
casties
parents:
diff changeset
97
ee158994651f updating to markdown
casties
parents:
diff changeset
98 You can supply your own icons for the "error" and "access denied"
ee158994651f updating to markdown
casties
parents:
diff changeset
99 messages by the servlet. Standard images will be used if these
ee158994651f updating to markdown
casties
parents:
diff changeset
100 parameters are not defined.
ee158994651f updating to markdown
casties
parents:
diff changeset
101
ee158994651f updating to markdown
casties
parents:
diff changeset
102 You can specify the Java toolkit implementation with the `docuimage-class`
ee158994651f updating to markdown
casties
parents:
diff changeset
103 parameter. The `ImageLoaderDocuImage` usually gives best performance
ee158994651f updating to markdown
casties
parents:
diff changeset
104 and works with JDK 1.4 and up.
ee158994651f updating to markdown
casties
parents:
diff changeset
105
ee158994651f updating to markdown
casties
parents:
diff changeset
106 You can see a summary of your running digilib configuration at the URL
ee158994651f updating to markdown
casties
parents:
diff changeset
107 [http://localhost:8080/digitallibrary/server/dlConfig.jsp](http://localhost:8080/digitallibrary/server/dlConfig.jsp)
ee158994651f updating to markdown
casties
parents:
diff changeset
108
ee158994651f updating to markdown
casties
parents:
diff changeset
109
ee158994651f updating to markdown
casties
parents:
diff changeset
110 ## digilib-auth.xml
ee158994651f updating to markdown
casties
parents:
diff changeset
111
ee158994651f updating to markdown
casties
parents:
diff changeset
112 The digilib access authorization is defined in the file defined by the `auth-file`
ee158994651f updating to markdown
casties
parents:
diff changeset
113 parameter (default: `digilib-auth.xml` in `WEB-INF` ).
ee158994651f updating to markdown
casties
parents:
diff changeset
114
ee158994651f updating to markdown
casties
parents:
diff changeset
115 The file has two parts `diglib-paths` and `diglib-addresses`. It looks like this:
ee158994651f updating to markdown
casties
parents:
diff changeset
116
ee158994651f updating to markdown
casties
parents:
diff changeset
117 <auth-config>
ee158994651f updating to markdown
casties
parents:
diff changeset
118
ee158994651f updating to markdown
casties
parents:
diff changeset
119 <digilib-paths>
ee158994651f updating to markdown
casties
parents:
diff changeset
120 <!--
ee158994651f updating to markdown
casties
parents:
diff changeset
121 A user must supply one of the roles under "role"
ee158994651f updating to markdown
casties
parents:
diff changeset
122 to access the directory "name".
ee158994651f updating to markdown
casties
parents:
diff changeset
123 Roles under "role" must be separated by comma only (no spaces).
ee158994651f updating to markdown
casties
parents:
diff changeset
124 -->
ee158994651f updating to markdown
casties
parents:
diff changeset
125 <path name="histast/eastwood-collection" role="eastwood-coll" />
ee158994651f updating to markdown
casties
parents:
diff changeset
126 <path name="ptolemaios_geo" role="ptolemaios-geo" />
ee158994651f updating to markdown
casties
parents:
diff changeset
127 </digilib-paths>
ee158994651f updating to markdown
casties
parents:
diff changeset
128
ee158994651f updating to markdown
casties
parents:
diff changeset
129 <digilib-addresses>
ee158994651f updating to markdown
casties
parents:
diff changeset
130 <!--
ee158994651f updating to markdown
casties
parents:
diff changeset
131 A computer with an ip address that matches "ip"
ee158994651f updating to markdown
casties
parents:
diff changeset
132 is automatically granted all roles under "role".
ee158994651f updating to markdown
casties
parents:
diff changeset
133 The ip address is matched from the left (in full quads).
ee158994651f updating to markdown
casties
parents:
diff changeset
134 Roles under "role" must be separated by comma only (no spaces).
ee158994651f updating to markdown
casties
parents:
diff changeset
135 -->
ee158994651f updating to markdown
casties
parents:
diff changeset
136 <address ip="127" role="local" />
ee158994651f updating to markdown
casties
parents:
diff changeset
137 <address ip="130.92.68" role="eastwood-coll,ptolemaios-geo" />
ee158994651f updating to markdown
casties
parents:
diff changeset
138 <address ip="130.92.151" role="ALL" />
ee158994651f updating to markdown
casties
parents:
diff changeset
139 </digilib-addresses>
ee158994651f updating to markdown
casties
parents:
diff changeset
140
ee158994651f updating to markdown
casties
parents:
diff changeset
141 </auth-config>
ee158994651f updating to markdown
casties
parents:
diff changeset
142
ee158994651f updating to markdown
casties
parents:
diff changeset
143 `diglib-paths` defines restricted directories and the roles needed
ee158994651f updating to markdown
casties
parents:
diff changeset
144 for access. The roles are defined with the users in `tomcat-users.xml`
ee158994651f updating to markdown
casties
parents:
diff changeset
145 (see above). All subdirectories of the given directories have the same
ee158994651f updating to markdown
casties
parents:
diff changeset
146 restrictions. All directories not listed here (and not subdirectories of listed
ee158994651f updating to markdown
casties
parents:
diff changeset
147 directories) are freely accessible.
ee158994651f updating to markdown
casties
parents:
diff changeset
148
ee158994651f updating to markdown
casties
parents:
diff changeset
149 `diglib-addresses` defines hosts or networks of computers that are
ee158994651f updating to markdown
casties
parents:
diff changeset
150 automatically authenticated without username and password. Hosts can be assigned
ee158994651f updating to markdown
casties
parents:
diff changeset
151 roles. The special keyword `ALL` authorizes for everything. If the
ee158994651f updating to markdown
casties
parents:
diff changeset
152 role assigned to the computer is not sufficient to access a resource the user
ee158994651f updating to markdown
casties
parents:
diff changeset
153 will be asked for username and password.
ee158994651f updating to markdown
casties
parents:
diff changeset
154