Project

General

Profile

metacat / docs / user / registry_installation.html @ 4607

1
<!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
        li { padding-bottom: 5px; }
13
        blockquote { 
14
                background-color: #f5f5f5;
15
                margin: 10px 15px 5px 20px;
16
                padding: 1px 0px 1px 10px;
17
        }
18

19
        .keyword {
20
                color: #00008b;
21
        }
22

23
        .type {
24
                color: #2b91af;
25
        }
26

27
        .string {
28
                color: #810541;
29
        }
30

31
  /*]]>*/
32
  </style>
33

    
34
  <title>Metacat Install - Registry</title>
35
  <link rel="stylesheet" type="text/css" href="default.css" />
36
</head>
37

    
38
<body>
39
  <table class="tabledefault" width="100%">
40
    <tr>
41
      <td rowspan="2"><img src="images/KNBLogo.gif" /></td>
42

    
43
      <td colspan="7">
44
        <div class="title">
45
          Metacat Installation - Registry
46
        </div>
47
      </td>
48
    </tr>
49

    
50
    <tr>
51
      <td><a href="/" class="toollink">KNB Home</a></td>
52

    
53
      <td><a href="/data.html" class="toollink">Data</a></td>
54

    
55
      <td><a href="/people.html" class="toollink">People</a></td>
56

    
57
      <td><a href="/informatics" class=
58
      "toollink">Informatics</a></td>
59

    
60
      <td><a href="/biodiversity" class=
61
      "toollink">Biocomplexity</a></td>
62

    
63
      <td><a href="/education" class="toollink">Education</a></td>
64

    
65
      <td><a href="/software" class="toollink">Software</a></td>
66
    </tr>
67
  </table>
68
  <hr />
69

    
70
  <table class="tabledefault" width="100%">
71
    <tr>
72
      <td class="tablehead" colspan="2">
73
        <p class="emphasis">Installing the Metacat Registry</p>
74
      </td>
75
    </tr>
76

    
77
    <tr>
78
      <td>Author: Shaun Walbridge<br />
79
      Date: 06/06/2008<br /></td>
80
    </tr>
81
  </table>
82

    
83
  <h1 id="registry-installation">Registry Installation</h1>
84

    
85
  <h2 id="whats-it-for">What's it for?</h2>
86

    
87
  <p>The Metacat Registry provides an easy mechanism to create and
88
  edit simple EML metadata documents, and accounts for your Metacat
89
  users. It is an optional component of Metacat, but is useful when
90
  you need very low barriers to creating simple EML, or have users
91
  unable to use Morpho. The LDAP account management interface is
92
  useful if you are authenticating users against LDAP, and need to
93
  provide a basic mechanism for managing user accounts.</p>
94

    
95
  <h2 id="installation-instructions">Installation Instructions</h2>
96

    
97
  <p>The Registry can be installed on any machine Metacat runs on,
98
  but does require additional legwork to get it installed. It
99
  requires that Metacat is set deployed behind Apache, as our
100
  recommended installation platform, and the instructions assume
101
  Apache is already installed and working correctly.</p>
102

    
103
  <h2 id="steps">Steps</h2>
104

    
105
  <ol class="decimal">
106
    <li>
107
      <p>Download and extract the Metacat release:</p>
108
      <blockquote>
109
<pre><span class="type">mkdir</span> metacat &amp;&amp; cd metacat 
110
<span class="type">wget</span> http://knb.ecoinformatics.org/software/dist/metacat-src-1.8.0.zip
111
<span class="type">unzip</span> metacat-src-1.8.0.zip
112
<span class="type">cd</span> metacat-1.8.0
113
<span class="type">export</span> METACAT=`pwd`
114
</pre>
115
</blockquote>
116
    </li>
117

    
118
    <li>
119
      <p>Build the Metacat Perl client library:</p>
120
      <blockquote>
121
<pre><span class="type">cd</span> $METACAT/src/perl/Metacat
122
<span class="type">perl</span> Makefile.PL
123
<span class="type">sudo make</span>
124
<span class="type">sudo make install</span>
125
</pre>
126
</blockquote>
127
    </li>
128

    
129
    <li>
130
      <p>Install the system libraries needed. On Redhat:
131
      <blockquote>
132
<pre><span class="type">sudo yum install</span> gcc libxml2-devel libxslt-devel ant -y
133
</pre>
134
</blockquote>
135

    
136
      On Debian:
137
      <blockquote>
138
                        <pre>
139
<span class="type">sudo apt-get install</span> ant libappconfig-perl libxml-libxml-perl libxml-libxslt-perl \
140
libtemplate-perl libcgi-session-perl libdigest-sha1-perl libnet-ldap-perl \ 
141
libterm-readkey-perl libxml-dom-perl libsoap-lite-perl -y
142
</pre>
143
</blockquote>
144
          You will need to install one package using cpan
145
      <blockquote><pre><span class="type">sudo cpan</span> -i Config::Properties</pre></blockquote>
146

    
147
      Debian users should skip ahead to step 7.
148
</p>
149
    </li>
150

    
151
    <li>
152
      <p>Install CPAN, which allows us to install the Perl
153
      dependencies for the registry and account management parts of
154
      Metacat. If asked to manually configure cpan, type 'no' and
155
      CPAN will be setup with its default values.</p>
156
      <blockquote>
157
<pre><span class="type">sudo yum install</span> perl-CPAN
158
<span class="type">sudo cpan</span>
159
</pre>
160
</blockquote>
161

    
162
      <p>You should now see a prompt which looks like:</p>
163
      <blockquote>
164
<pre><span class="string">cpan&gt;</span>
165
</pre>
166
</blockquote>
167

    
168
      <p>The rest of the commands will assume you're inside of
169
      CPAN. Let's get the most recent version of the CPAN software.
170
      Just press return after any prompts you recieve during this
171
      process.</p>
172
      <blockquote>
173
<pre>install Bundle::CPAN
174
reload cpan
175
</pre>
176
</blockquote>
177
    </li>
178

    
179
    <li>
180
      <p>Install the required modules. Here we're installing an old
181
      LibXSLT, as the current one requires a newer libxslt than is
182
      available on Redhat 4 &amp; 5. Again, just answer 'yes' to
183
      any questions.</p>
184
      <blockquote>
185
<pre>install AutoLoader
186
install CGI
187
install CGI::SEssion
188
install LWP::UserAgent
189
install Net::LDAP
190
install Template 
191
install URI
192
install MSERGEANT/XML-LibXSLT-1.58.tar.gz
193
</pre>
194
</blockquote>
195
    </li>
196

    
197
    <li>
198
      <p>As part of the Metacat setup, a property called
199
      'inst.cgi.dir' is set, which controls the location the perl
200
      scripts will be installed into, with a default of
201
      '/var/www/cgi-knb'. To install the registry and the account
202
      manager to this folder we'll run ant:</p>
203
      <blockquote>
204
<pre><span class="type">cd</span> $METACAT
205
<span class="type">sudo ant</span> install-registry
206
<span class="type">sudo ant</span> insall-ldap
207
</pre>
208
</blockquote>
209
    </li>
210

    
211
    <li>
212
      <p>A registry instance can support one or more skins. Skins
213
      provide a mechanism for giving a custom look to your Metacat
214
      installation, but require integration work to initially
215
      create. For this example, we'll use the <pre>nceas</pre>
216
      skin provided with Metacat. First, we'll want to install the
217
      skin:</p>
218
      <blockquote>
219
<pre><span class="type">sudo ant</span> install-skin
220
</pre>
221
</blockquote>
222

    
223
      <p>When prompted, type <pre><span class="string">nceas</span></pre>.</p>
224
    </li>
225

    
226
    <li>
227
      <p>Metacat uses the 'application.tempDir' property from 
228
      metacat.properties to set a temporary
229
      space to store uploaded files. If you'd like your registry to
230
      allow file uploads, we'll need to make sure Apache can write
231
      to it. The apache user varies from machine to machine, but
232
      typically it will be either
233
                        <pre><code>www-data</code> or <code>apache</code></pre>. 
234
                        Once finding your appropriate apache
235
      user, we'll want to change ownership of a few files, here
236
      using the user <code>apache</code>:</p>
237
      <blockquote>
238
<pre><span class="type">sudo chown</span> apache /tmp/knb
239
</pre>
240
</blockquote>
241

    
242
      <p>Each skin has a 'lastid' file, which controls which the
243
      accession numbers metacat generates. As with the temporary
244
      folder, we'll want the registry to be able to write to this
245
      file, replacing the skin name with the skin you're planning
246
      on using:</p>
247
      <blockquote>
248
<pre>sudo touch /var/www/org.ecoinformatics.knb/knb/style/skins/nceas/nceas.lastid
249
sudo chown apache /var/www/org.ecoinformatics.knb/knb/style/skins/nceas/nceas.lastid
250
</pre>
251
</blockquote>
252

    
253
      <p>You'll need to have one lastid file for each skin your
254
      site will support.</p>
255
    </li>
256

    
257
    <li>
258
      <p>Configure Apache to serve up the pages we've just
259
      configured. In your httpd.conf or equivalent, add:</p>
260
      <blockquote>
261
<pre>ScriptAlias /cgi-bin/ "/var/www/cgi-knb/"
262
&lt;Directory "/var/www/cgi-knb"&gt;
263
    AllowOverride None
264
    Options ExecCGI
265
    Order allow,deny
266
    Allow from all
267
&lt;/Directory&gt;`
268
</pre>
269
</blockquote>
270

    
271
      <p>Then reload Apache:</p>
272
      <blockquote>
273
<pre>/etc/init.d/httpd reload
274
</pre>
275
</blockquote>
276
    </li>
277
    
278
    <li>
279
      <p>Change owner and access permission of some credential files:</p>
280
      <blockquote>
281
<pre>cd /webapps/knb/style/skins/</pre>
282
<pre>find . -name "*.cfg" -exec chmod 600 {} \;</pre>
283
<pre>find . -name "*.cfg" -exec chown apache {} \;</pre>
284
</blockquote>
285

    
286
<p>Note: "/webapps/knb" is subject to change base on your configuration.</p>
287
<p>         "apache" user is the one who runs httpd server.</p>
288
 
289
      <p>Those commands will make the files which contain credentials are not accessible
290
      from web browsers. </p>
291
    </li>
292

    
293
    <li>
294
      <p>Now visit the resulting URL:</p>
295
      <blockquote>
296
<pre>http://localhost/cgi-bin/register-dataset.cgi?cfg=nceas
297
</pre>
298
</blockquote>
299

    
300
      <p>If everything worked correctly, you should see a page like
301
      this: <img src="images/registry-login.jpg" alt=
302
      "Registry Login Page" /></p>
303
    </li>
304
  </ol>
305

    
306
  <h2 id="installing-the-nceas-registry">Installing the NCEAS
307
  Registry</h2>
308

    
309
  <p>These are special instructions required for the NCEAS skin to
310
  get a current projects list from the AdminDB, and can safely be
311
  ignored in all other uses.</p>
312

    
313
  <ol class="decimal">
314
    <li>
315
      <p>Download and install the Oracle Instant Client RPMs. These
316
      can be obtained from the <a href=
317
      "http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html">
318
      oracle website</a>.</p>
319
      <blockquote>
320
<pre>rpm -i oracle-instantclient-basic-10.2.0.3-1.i386.rpm
321
rpm -i oracle-instantclient-devel-10.2.0.3-1.i386.rpm
322
rpm -i oracle-instantclient-sqlplus-10.2.0.3-1.i386.rpm
323
</pre>
324
</blockquote>
325
    </li>
326

    
327
    <li>
328
      <p>Next, we'll need an <pre>tnsnames.ora</pre> file for
329
      Oracle to locate the server we're connecting to. In this
330
      example, we'll copy it from a remote location:</p>
331
      <blockquote>
332
<pre>mkdir -p /usr/lib/oracle/10.2.0.3/network/admin/ &amp;&amp; cd !$
333
scp walbridge@knb.ecoinformatics.org:/usr/lib/oracle/10.1.0.4/network/admin/tnsnames.ora .
334
</pre>
335
</blockquote>
336
    </li>
337

    
338
    <li>
339
      <p>The AdminDB is accessed via Perl, so install the needed
340
      Oracle driver using CPAN:</p>
341
      <blockquote>
342
<pre>cpan
343
install DBI
344
install DBD::Oracle
345
</pre>
346
</blockquote>
347
    </li>
348

    
349
    <li>
350
      <p>Now we can install the AdminDB module itself:</p>
351
      <blockquote>
352
<pre>mkdir -p ~/projects/admindb &amp;&amp; cd !$
353
export CVSROOT=:ext:walbridge@cvs.nceas.ucsb.edu:/cvsnceas
354
cvs co admindb
355
cd admindb/perl/NCEAS/AdminDB
356
perl Makefile.PL
357
make
358
sudo make install
359
</pre>
360
</blockquote>
361
    </li>
362

    
363
    <li>
364
      <p>Finally, set the correct properties in the
365
      <pre>nceas.cfg</pre> file:</p>
366
      <blockquote>
367
<pre>nceas_db = //hyperion.nceas.ucsb.edu:1521/nceasp.nceas.ucsb.edu
368
nceas_db_user = admowner
369
nceas_db_password = NCEAS_DB_READ_PASSWORD_HERE
370
</pre>
371
</blockquote>
372
    </li>
373

    
374
    <li>
375
      <p>A quick check of <pre>register-dataset.cgi</pre> should
376
      now show a complete list of projects: <img src=
377
      "images/registry-nceas-projects.png" alt=
378
      "NCEAS Project list" /></p>
379
    </li>
380
  </ol>
381

    
382
  <h2 id="notes">Notes</h2>
383

    
384
  <p>Redhat based, tested on Centos 5</p>
385

    
386
  <p>Debian based, tested on Ubuntu 8.04</p>
387
</body>
388
</html>