1 |
3956
|
tao
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2 |
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3 |
|
|
|
4 |
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
5 |
|
|
<head>
|
6 |
|
|
<meta http-equiv="Content-Type" content=
|
7 |
|
|
"text/html; charset=us-ascii" />
|
8 |
|
|
<meta name="generator" content="pandoc" />
|
9 |
|
|
<style type="text/css">
|
10 |
|
|
/*<![CDATA[*/
|
11 |
|
|
ol.decimal { list-style-type: decimal; }
|
12 |
|
|
/*]]>*/
|
13 |
|
|
</style>
|
14 |
|
|
|
15 |
|
|
<title>Metacat Install - Registry</title>
|
16 |
|
|
<link rel="stylesheet" type="text/css" href="default.css" />
|
17 |
|
|
</head>
|
18 |
|
|
|
19 |
|
|
<body>
|
20 |
|
|
<table class="tabledefault" width="100%">
|
21 |
|
|
<tr>
|
22 |
|
|
<td rowspan="2"><img src="images/KNBLogo.gif" /></td>
|
23 |
|
|
|
24 |
|
|
<td colspan="7">
|
25 |
|
|
<div class="title">
|
26 |
|
|
Metacat Installation - Registry
|
27 |
|
|
</div>
|
28 |
|
|
</td>
|
29 |
|
|
</tr>
|
30 |
|
|
|
31 |
|
|
<tr>
|
32 |
|
|
<td><a href="/" class="toollink">KNB Home</a></td>
|
33 |
|
|
|
34 |
|
|
<td><a href="/data.html" class="toollink">Data</a></td>
|
35 |
|
|
|
36 |
|
|
<td><a href="/people.html" class="toollink">People</a></td>
|
37 |
|
|
|
38 |
|
|
<td><a href="/informatics" class=
|
39 |
|
|
"toollink">Informatics</a></td>
|
40 |
|
|
|
41 |
|
|
<td><a href="/biodiversity" class=
|
42 |
|
|
"toollink">Biocomplexity</a></td>
|
43 |
|
|
|
44 |
|
|
<td><a href="/education" class="toollink">Education</a></td>
|
45 |
|
|
|
46 |
|
|
<td><a href="/software" class="toollink">Software</a></td>
|
47 |
|
|
</tr>
|
48 |
|
|
</table>
|
49 |
|
|
<hr />
|
50 |
|
|
|
51 |
|
|
<table class="tabledefault" width="100%">
|
52 |
|
|
<tr>
|
53 |
|
|
<td class="tablehead" colspan="2">
|
54 |
|
|
<p class="emphasis">Installing the Metacat Registry</p>
|
55 |
|
|
</td>
|
56 |
|
|
</tr>
|
57 |
|
|
|
58 |
|
|
<tr>
|
59 |
|
|
<td>Author: Shaun Walbridge<br />
|
60 |
|
|
Date: 06/06/2008<br /></td>
|
61 |
|
|
</tr>
|
62 |
|
|
</table>
|
63 |
|
|
|
64 |
|
|
<h1 id="registry-installation">Registry Installation</h1>
|
65 |
|
|
|
66 |
|
|
<h2 id="whats-it-for">What's it for?</h2>
|
67 |
|
|
|
68 |
|
|
<p>The Metacat Registry provides an easy mechanism to create and
|
69 |
|
|
edit simple EML metadata documents, and accounts for your Metacat
|
70 |
|
|
users. It is an optional component of Metacat, but is useful when
|
71 |
|
|
you need very low barriers to creating simple EML, or have users
|
72 |
|
|
unable to use Morpho. The LDAP account management interface is
|
73 |
|
|
useful if you are authenticating users against LDAP, and need to
|
74 |
|
|
provide a basic mechanism for managing user accounts.</p>
|
75 |
|
|
|
76 |
|
|
<h2 id="installation-instructions">Installation Instructions</h2>
|
77 |
|
|
|
78 |
|
|
<p>The Registry can be installed on any machine Metacat runs on,
|
79 |
|
|
but does require additional legwork to get it installed. It
|
80 |
|
|
requires that Metacat is set deployed behind Apache, as our
|
81 |
|
|
recommended installation platform, and the instructions assume
|
82 |
|
|
Apache is already installed and working correctly.</p>
|
83 |
|
|
|
84 |
|
|
<h2 id="steps">Steps</h2>
|
85 |
|
|
|
86 |
|
|
<ol class="decimal">
|
87 |
|
|
<li>
|
88 |
|
|
<p>Download and extract the Metacat release:</p>
|
89 |
|
|
<pre>
|
90 |
|
|
<code>mkdir metacat && cd metacat
|
91 |
|
|
wget http://knb.ecoinformatics.org/software/dist/metacat-src-1.8.0.zip
|
92 |
|
|
unzip metacat-src-1.8.0.zip
|
93 |
|
|
cd metacat-1.8.0
|
94 |
|
|
export METACAT=`pwd`
|
95 |
|
|
</code>
|
96 |
|
|
</pre>
|
97 |
|
|
</li>
|
98 |
|
|
|
99 |
|
|
<li>
|
100 |
|
|
<p>Build the Metacat Perl client library:</p>
|
101 |
|
|
<pre>
|
102 |
|
|
<code>cd $METACAT/src/perl/Metacat
|
103 |
|
|
perl Makefile.PL
|
104 |
|
|
make
|
105 |
|
|
sudo make install
|
106 |
|
|
</code>
|
107 |
|
|
</pre>
|
108 |
|
|
</li>
|
109 |
|
|
|
110 |
|
|
<li>
|
111 |
|
|
<p>Install the system libraries needed. On Redhat:</p>
|
112 |
|
|
<pre>
|
113 |
|
|
<code>sudo yum install gcc libxml2-devel libxslt-devel ant -y
|
114 |
|
|
</code>
|
115 |
|
|
</pre>
|
116 |
|
|
|
117 |
4009
|
walbridge
|
<p>On Debian:
|
118 |
|
|
<pre><code>
|
119 |
|
|
sudo apt-get install ant libappconfig-perl libxml-libxml-perl libxml-libxslt-perl libtemplate-perl \
|
120 |
|
|
libcgi-session-perl libdigest-sha1-perl libnet-ldap-perl libterm-readkey-perl libxml-dom-perl libsoap-lite-perl -y
|
121 |
|
|
</code></pre>
|
122 |
4366
|
daigle
|
You will need to install one package using cpan
|
123 |
|
|
<pre><code> sudo cpan -i Config::Properties</code></pre>
|
124 |
|
|
|
125 |
|
|
Now, skip ahead to step 7. Debian users can avoid using CPAN, as apt-get installs the software they need.<br><br>
|
126 |
4009
|
walbridge
|
</p>
|
127 |
3956
|
tao
|
</li>
|
128 |
|
|
|
129 |
|
|
<li>
|
130 |
|
|
<p>Install CPAN, which allows us to install the Perl
|
131 |
|
|
dependencies for the registry and account management parts of
|
132 |
|
|
Metacat. If asked to manually configure cpan, type 'no' and
|
133 |
|
|
CPAN will be setup with its default values.</p>
|
134 |
|
|
<pre>
|
135 |
|
|
<code>sudo yum install perl-CPAN
|
136 |
|
|
sudo cpan
|
137 |
|
|
</code>
|
138 |
|
|
</pre>
|
139 |
|
|
|
140 |
|
|
<p>You should now see a prompt which looks like:</p>
|
141 |
|
|
<pre>
|
142 |
|
|
<code>cpan>
|
143 |
|
|
</code>
|
144 |
|
|
</pre>
|
145 |
|
|
|
146 |
|
|
<p>The rest of the commands will assume you're inside of
|
147 |
|
|
CPAN. Let's get the most recent version of the CPAN software.
|
148 |
|
|
Just press return after any prompts you recieve during this
|
149 |
|
|
process.</p>
|
150 |
|
|
<pre>
|
151 |
|
|
<code>install Bundle::CPAN
|
152 |
|
|
reload cpan`
|
153 |
|
|
</code>
|
154 |
|
|
</pre>
|
155 |
|
|
</li>
|
156 |
|
|
|
157 |
|
|
<li>
|
158 |
|
|
<p>Install the required modules. Here we're installing an old
|
159 |
|
|
LibXSLT, as the current one requires a newer libxslt than is
|
160 |
|
|
available on Redhat 4 & 5. Again, just answer 'yes' to
|
161 |
|
|
any questions.</p>
|
162 |
|
|
<pre>
|
163 |
|
|
<code>install AutoLoader
|
164 |
|
|
install CGI
|
165 |
|
|
install CGI::SEssion
|
166 |
4009
|
walbridge
|
install LWP::UserAgent
|
167 |
3956
|
tao
|
install Net::LDAP
|
168 |
|
|
install Template
|
169 |
|
|
install URI
|
170 |
|
|
install MSERGEANT/XML-LibXSLT-1.58.tar.gz
|
171 |
|
|
</code>
|
172 |
|
|
</pre>
|
173 |
|
|
</li>
|
174 |
|
|
|
175 |
|
|
<li>
|
176 |
|
|
<p>As part of the Metacat setup, a property called
|
177 |
|
|
'inst.cgi.dir' is set, which controls the location the perl
|
178 |
|
|
scripts will be installed into, with a default of
|
179 |
|
|
'/var/www/cgi-knb'. To install the registry and the account
|
180 |
|
|
manager to this folder we'll run ant:</p>
|
181 |
|
|
<pre>
|
182 |
|
|
<code>cd $METACAT
|
183 |
|
|
sudo ant install-registry
|
184 |
|
|
sudo ant insall-ldap
|
185 |
|
|
</code>
|
186 |
|
|
</pre>
|
187 |
|
|
</li>
|
188 |
|
|
|
189 |
|
|
<li>
|
190 |
|
|
<p>A registry instance can support one or more skins. Skins
|
191 |
|
|
provide a mechanism for giving a custom look to your Metacat
|
192 |
|
|
installation, but require integration work to initially
|
193 |
|
|
create. For this example, we'll use the <code>nceas</code>
|
194 |
|
|
skin provided with Metacat. First, we'll want to install the
|
195 |
|
|
skin:</p>
|
196 |
|
|
<pre>
|
197 |
|
|
<code>sudo ant install-skin
|
198 |
|
|
</code>
|
199 |
|
|
</pre>
|
200 |
|
|
|
201 |
|
|
<p>When prompted, type <code>nceas</code>.</p>
|
202 |
|
|
</li>
|
203 |
|
|
|
204 |
|
|
<li>
|
205 |
4366
|
daigle
|
<p>Metacat uses the 'application.tempDir' property from
|
206 |
|
|
metacat.properties to set a temporary
|
207 |
3956
|
tao
|
space to store uploaded files. If you'd like your registry to
|
208 |
|
|
allow file uploads, we'll need to make sure Apache can write
|
209 |
|
|
to it. The apache user varies from machine to machine, but
|
210 |
|
|
typically it will be either <code>www-data</code> or
|
211 |
|
|
<code>apache</code>. Once finding your appropriate apache
|
212 |
|
|
user, we'll want to change ownership of a few files, here
|
213 |
|
|
using the user <code>apache</code>:</p>
|
214 |
|
|
<pre>
|
215 |
|
|
<code>sudo chown apache /tmp/knb
|
216 |
|
|
</code>
|
217 |
|
|
</pre>
|
218 |
|
|
|
219 |
|
|
<p>Each skin has a 'lastid' file, which controls which the
|
220 |
|
|
accession numbers metacat generates. As with the temporary
|
221 |
|
|
folder, we'll want the registry to be able to write to this
|
222 |
|
|
file, replacing the skin name with the skin you're planning
|
223 |
|
|
on using:</p>
|
224 |
|
|
<pre>
|
225 |
|
|
<code>sudo touch /var/www/org.ecoinformatics.knb/knb/style/skins/nceas/nceas.lastid
|
226 |
|
|
sudo chown apache /var/www/org.ecoinformatics.knb/knb/style/skins/nceas/nceas.lastid
|
227 |
|
|
</code>
|
228 |
|
|
</pre>
|
229 |
|
|
|
230 |
|
|
<p>You'll need to have one lastid file for each skin your
|
231 |
|
|
site will support.</p>
|
232 |
|
|
</li>
|
233 |
|
|
|
234 |
|
|
<li>
|
235 |
|
|
<p>Configure Apache to serve up the pages we've just
|
236 |
|
|
configured. In your httpd.conf or equivalent, add:</p>
|
237 |
|
|
<pre>
|
238 |
|
|
<code>ScriptAlias /cgi-bin/ "/var/www/cgi-knb/"
|
239 |
|
|
<Directory "/var/www/cgi-knb">
|
240 |
|
|
AllowOverride None
|
241 |
|
|
Options ExecCGI
|
242 |
|
|
Order allow,deny
|
243 |
|
|
Allow from all
|
244 |
|
|
</Directory>`
|
245 |
|
|
</code>
|
246 |
|
|
</pre>
|
247 |
|
|
|
248 |
|
|
<p>Then reload Apache:</p>
|
249 |
|
|
<pre>
|
250 |
|
|
<code>/etc/init.d/httpd reload
|
251 |
|
|
</code>
|
252 |
|
|
</pre>
|
253 |
|
|
</li>
|
254 |
|
|
|
255 |
|
|
<li>
|
256 |
|
|
<p>Change owner and access permission of some credential files:</p>
|
257 |
|
|
<pre>
|
258 |
|
|
<code>cd /webapps/knb/style/skins/</code>
|
259 |
|
|
<code>find . -name "*.cfg" -exec chmod 600 {} \;</code>
|
260 |
|
|
<code>find . -name "*.cfg" -exec chown apache {} \;</code>
|
261 |
|
|
</pre>
|
262 |
|
|
|
263 |
|
|
<p>Note: "/webapps/knb" is subject to change base on your configuration.</p>
|
264 |
|
|
<p> "apache" user is the one who runs httpd server.</p
|
265 |
|
|
|
266 |
|
|
<p>Those commands will make the files which contain credentials are not accessible
|
267 |
|
|
from web browsers. </p>
|
268 |
|
|
</li>
|
269 |
|
|
|
270 |
|
|
<li>
|
271 |
|
|
<p>Now visit the resulting URL:</p>
|
272 |
|
|
<pre>
|
273 |
|
|
<code>http://localhost/cgi-bin/register-dataset.cgi?cfg=nceas
|
274 |
|
|
</code>
|
275 |
|
|
</pre>
|
276 |
|
|
|
277 |
|
|
<p>If everything worked correctly, you should see a page like
|
278 |
|
|
this: <img src="images/registry-login.jpg" alt=
|
279 |
|
|
"Registry Login Page" /></p>
|
280 |
|
|
</li>
|
281 |
|
|
</ol>
|
282 |
|
|
|
283 |
|
|
<h2 id="installing-the-nceas-registry">Installing the NCEAS
|
284 |
|
|
Registry</h2>
|
285 |
|
|
|
286 |
|
|
<p>These are special instructions required for the NCEAS skin to
|
287 |
|
|
get a current projects list from the AdminDB, and can safely be
|
288 |
|
|
ignored in all other uses.</p>
|
289 |
|
|
|
290 |
|
|
<ol class="decimal">
|
291 |
|
|
<li>
|
292 |
|
|
<p>Download and install the Oracle Instant Client RPMs. These
|
293 |
|
|
can be obtained from the <a href=
|
294 |
|
|
"http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html">
|
295 |
|
|
oracle website</a>.</p>
|
296 |
|
|
<pre>
|
297 |
|
|
<code>rpm -i oracle-instantclient-basic-10.2.0.3-1.i386.rpm
|
298 |
|
|
rpm -i oracle-instantclient-devel-10.2.0.3-1.i386.rpm
|
299 |
|
|
rpm -i oracle-instantclient-sqlplus-10.2.0.3-1.i386.rpm
|
300 |
|
|
</code>
|
301 |
|
|
</pre>
|
302 |
|
|
</li>
|
303 |
|
|
|
304 |
|
|
<li>
|
305 |
|
|
<p>Next, we'll need an <code>tnsnames.ora</code> file for
|
306 |
|
|
Oracle to locate the server we're connecting to. In this
|
307 |
|
|
example, we'll copy it from a remote location:</p>
|
308 |
|
|
<pre>
|
309 |
|
|
<code>mkdir -p /usr/lib/oracle/10.2.0.3/network/admin/ && cd !$
|
310 |
|
|
scp walbridge@knb.ecoinformatics.org:/usr/lib/oracle/10.1.0.4/network/admin/tnsnames.ora .
|
311 |
|
|
</code>
|
312 |
|
|
</pre>
|
313 |
|
|
</li>
|
314 |
|
|
|
315 |
|
|
<li>
|
316 |
|
|
<p>The AdminDB is accessed via Perl, so install the needed
|
317 |
|
|
Oracle driver using CPAN:</p>
|
318 |
|
|
<pre>
|
319 |
|
|
<code>cpan
|
320 |
|
|
install DBI
|
321 |
|
|
install DBD::Oracle
|
322 |
|
|
</code>
|
323 |
|
|
</pre>
|
324 |
|
|
</li>
|
325 |
|
|
|
326 |
|
|
<li>
|
327 |
|
|
<p>Now we can install the AdminDB module itself:</p>
|
328 |
|
|
<pre>
|
329 |
|
|
<code>mkdir -p ~/projects/admindb && cd !$
|
330 |
|
|
export CVSROOT=:ext:walbridge@cvs.nceas.ucsb.edu:/cvsnceas
|
331 |
|
|
cvs co admindb
|
332 |
|
|
cd admindb/perl/NCEAS/AdminDB
|
333 |
|
|
perl Makefile.PL
|
334 |
|
|
make
|
335 |
|
|
sudo make install
|
336 |
|
|
</code>
|
337 |
|
|
</pre>
|
338 |
|
|
</li>
|
339 |
|
|
|
340 |
|
|
<li>
|
341 |
|
|
<p>Finally, set the correct properties in the
|
342 |
|
|
<code>nceas.cfg</code> file:</p>
|
343 |
|
|
<pre>
|
344 |
|
|
<code>nceas_db = //hyperion.nceas.ucsb.edu:1521/nceasp.nceas.ucsb.edu
|
345 |
|
|
nceas_db_user = admowner
|
346 |
|
|
nceas_db_password = NCEAS_DB_READ_PASSWORD_HERE
|
347 |
|
|
</code>
|
348 |
|
|
</pre>
|
349 |
|
|
</li>
|
350 |
|
|
|
351 |
|
|
<li>
|
352 |
|
|
<p>A quick check of <code>register-dataset.cgi</code> should
|
353 |
|
|
now show a complete list of projects: <img src=
|
354 |
|
|
"images/registry-nceas-projects.png" alt=
|
355 |
|
|
"NCEAS Project list" /></p>
|
356 |
|
|
</li>
|
357 |
|
|
</ol>
|
358 |
|
|
|
359 |
|
|
<h2 id="notes">Notes</h2>
|
360 |
|
|
|
361 |
|
|
<p>Redhat based, tested on Centos 5</p>
|
362 |
|
|
|
363 |
|
|
<p>Debian based, tested on Ubuntu 8.04</p>
|
364 |
|
|
</body>
|
365 |
|
|
</html>
|