Revision 3956
Added by Jing Tao over 16 years ago
docs/user/registry_installation.html | ||
---|---|---|
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 |
/*]]>*/ |
|
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 |
<p>On Debian:</p> |
|
118 |
<pre> |
|
119 |
<code>sudo apt-get install ant -y |
|
120 |
</code> |
|
121 |
</pre> |
|
122 |
|
|
123 |
<p>If on Debian, skip ahead to step 7.</p> |
|
124 |
</li> |
|
125 |
|
|
126 |
<li> |
|
127 |
<p>Install CPAN, which allows us to install the Perl |
|
128 |
dependencies for the registry and account management parts of |
|
129 |
Metacat. If asked to manually configure cpan, type 'no' and |
|
130 |
CPAN will be setup with its default values.</p> |
|
131 |
<pre> |
|
132 |
<code>sudo yum install perl-CPAN |
|
133 |
sudo cpan |
|
134 |
</code> |
|
135 |
</pre> |
|
136 |
|
|
137 |
<p>You should now see a prompt which looks like:</p> |
|
138 |
<pre> |
|
139 |
<code>cpan> |
|
140 |
</code> |
|
141 |
</pre> |
|
142 |
|
|
143 |
<p>The rest of the commands will assume you're inside of |
|
144 |
CPAN. Let's get the most recent version of the CPAN software. |
|
145 |
Just press return after any prompts you recieve during this |
|
146 |
process.</p> |
|
147 |
<pre> |
|
148 |
<code>install Bundle::CPAN |
|
149 |
reload cpan` |
|
150 |
</code> |
|
151 |
</pre> |
|
152 |
</li> |
|
153 |
|
|
154 |
<li> |
|
155 |
<p>Install the required modules. Here we're installing an old |
|
156 |
LibXSLT, as the current one requires a newer libxslt than is |
|
157 |
available on Redhat 4 & 5. Again, just answer 'yes' to |
|
158 |
any questions.</p> |
|
159 |
<pre> |
|
160 |
<code>install AutoLoader |
|
161 |
install CGI |
|
162 |
install CGI::SEssion |
|
163 |
install LDAP::UserAgent |
|
164 |
install Net::LDAP |
|
165 |
install Template |
|
166 |
install URI |
|
167 |
install MSERGEANT/XML-LibXSLT-1.58.tar.gz |
|
168 |
</code> |
|
169 |
</pre> |
|
170 |
</li> |
|
171 |
|
|
172 |
<li> |
|
173 |
<p>As part of the Metacat setup, a property called |
|
174 |
'inst.cgi.dir' is set, which controls the location the perl |
|
175 |
scripts will be installed into, with a default of |
|
176 |
'/var/www/cgi-knb'. To install the registry and the account |
|
177 |
manager to this folder we'll run ant:</p> |
|
178 |
<pre> |
|
179 |
<code>cd $METACAT |
|
180 |
sudo ant install-registry |
|
181 |
sudo ant insall-ldap |
|
182 |
</code> |
|
183 |
</pre> |
|
184 |
</li> |
|
185 |
|
|
186 |
<li> |
|
187 |
<p>A registry instance can support one or more skins. Skins |
|
188 |
provide a mechanism for giving a custom look to your Metacat |
|
189 |
installation, but require integration work to initially |
|
190 |
create. For this example, we'll use the <code>nceas</code> |
|
191 |
skin provided with Metacat. First, we'll want to install the |
|
192 |
skin:</p> |
|
193 |
<pre> |
|
194 |
<code>sudo ant install-skin |
|
195 |
</code> |
|
196 |
</pre> |
|
197 |
|
|
198 |
<p>When prompted, type <code>nceas</code>.</p> |
|
199 |
</li> |
|
200 |
|
|
201 |
<li> |
|
202 |
<p>Metacat uses the 'temp-dir' property to set a temporary |
|
203 |
space to store uploaded files. If you'd like your registry to |
|
204 |
allow file uploads, we'll need to make sure Apache can write |
|
205 |
to it. The apache user varies from machine to machine, but |
|
206 |
typically it will be either <code>www-data</code> or |
|
207 |
<code>apache</code>. Once finding your appropriate apache |
|
208 |
user, we'll want to change ownership of a few files, here |
|
209 |
using the user <code>apache</code>:</p> |
|
210 |
<pre> |
|
211 |
<code>sudo chown apache /tmp/knb |
|
212 |
</code> |
|
213 |
</pre> |
|
214 |
|
|
215 |
<p>Each skin has a 'lastid' file, which controls which the |
|
216 |
accession numbers metacat generates. As with the temporary |
|
217 |
folder, we'll want the registry to be able to write to this |
|
218 |
file, replacing the skin name with the skin you're planning |
|
219 |
on using:</p> |
|
220 |
<pre> |
|
221 |
<code>sudo touch /var/www/org.ecoinformatics.knb/knb/style/skins/nceas/nceas.lastid |
|
222 |
sudo chown apache /var/www/org.ecoinformatics.knb/knb/style/skins/nceas/nceas.lastid |
|
223 |
</code> |
|
224 |
</pre> |
|
225 |
|
|
226 |
<p>You'll need to have one lastid file for each skin your |
|
227 |
site will support.</p> |
|
228 |
</li> |
|
229 |
|
|
230 |
<li> |
|
231 |
<p>Configure Apache to serve up the pages we've just |
|
232 |
configured. In your httpd.conf or equivalent, add:</p> |
|
233 |
<pre> |
|
234 |
<code>ScriptAlias /cgi-bin/ "/var/www/cgi-knb/" |
|
235 |
<Directory "/var/www/cgi-knb"> |
|
236 |
AllowOverride None |
|
237 |
Options ExecCGI |
|
238 |
Order allow,deny |
|
239 |
Allow from all |
|
240 |
</Directory>` |
|
241 |
</code> |
|
242 |
</pre> |
|
243 |
|
|
244 |
<p>Then reload Apache:</p> |
|
245 |
<pre> |
|
246 |
<code>/etc/init.d/httpd reload |
|
247 |
</code> |
|
248 |
</pre> |
|
249 |
</li> |
|
250 |
|
|
251 |
<li> |
|
252 |
<p>Change owner and access permission of some credential files:</p> |
|
253 |
<pre> |
|
254 |
<code>cd /webapps/knb/style/skins/</code> |
|
255 |
<code>find . -name "*.cfg" -exec chmod 600 {} \;</code> |
|
256 |
<code>find . -name "*.cfg" -exec chown apache {} \;</code> |
|
257 |
</pre> |
|
258 |
|
|
259 |
<p>Note: "/webapps/knb" is subject to change base on your configuration.</p> |
|
260 |
<p> "apache" user is the one who runs httpd server.</p |
|
261 |
|
|
262 |
<p>Those commands will make the files which contain credentials are not accessible |
|
263 |
from web browsers. </p> |
|
264 |
</li> |
|
265 |
|
|
266 |
<li> |
|
267 |
<p>Now visit the resulting URL:</p> |
|
268 |
<pre> |
|
269 |
<code>http://localhost/cgi-bin/register-dataset.cgi?cfg=nceas |
|
270 |
</code> |
|
271 |
</pre> |
|
272 |
|
|
273 |
<p>If everything worked correctly, you should see a page like |
|
274 |
this: <img src="images/registry-login.jpg" alt= |
|
275 |
"Registry Login Page" /></p> |
|
276 |
</li> |
|
277 |
</ol> |
|
278 |
|
|
279 |
<h2 id="installing-the-nceas-registry">Installing the NCEAS |
|
280 |
Registry</h2> |
|
281 |
|
|
282 |
<p>These are special instructions required for the NCEAS skin to |
|
283 |
get a current projects list from the AdminDB, and can safely be |
|
284 |
ignored in all other uses.</p> |
|
285 |
|
|
286 |
<ol class="decimal"> |
|
287 |
<li> |
|
288 |
<p>Download and install the Oracle Instant Client RPMs. These |
|
289 |
can be obtained from the <a href= |
|
290 |
"http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html"> |
|
291 |
oracle website</a>.</p> |
|
292 |
<pre> |
|
293 |
<code>rpm -i oracle-instantclient-basic-10.2.0.3-1.i386.rpm |
|
294 |
rpm -i oracle-instantclient-devel-10.2.0.3-1.i386.rpm |
|
295 |
rpm -i oracle-instantclient-sqlplus-10.2.0.3-1.i386.rpm |
|
296 |
</code> |
|
297 |
</pre> |
|
298 |
</li> |
|
299 |
|
|
300 |
<li> |
|
301 |
<p>Next, we'll need an <code>tnsnames.ora</code> file for |
|
302 |
Oracle to locate the server we're connecting to. In this |
|
303 |
example, we'll copy it from a remote location:</p> |
|
304 |
<pre> |
|
305 |
<code>mkdir -p /usr/lib/oracle/10.2.0.3/network/admin/ && cd !$ |
|
306 |
scp walbridge@knb.ecoinformatics.org:/usr/lib/oracle/10.1.0.4/network/admin/tnsnames.ora . |
|
307 |
</code> |
|
308 |
</pre> |
|
309 |
</li> |
|
310 |
|
|
311 |
<li> |
|
312 |
<p>The AdminDB is accessed via Perl, so install the needed |
|
313 |
Oracle driver using CPAN:</p> |
|
314 |
<pre> |
|
315 |
<code>cpan |
|
316 |
install DBI |
|
317 |
install DBD::Oracle |
|
318 |
</code> |
|
319 |
</pre> |
|
320 |
</li> |
|
321 |
|
|
322 |
<li> |
|
323 |
<p>Now we can install the AdminDB module itself:</p> |
|
324 |
<pre> |
|
325 |
<code>mkdir -p ~/projects/admindb && cd !$ |
|
326 |
export CVSROOT=:ext:walbridge@cvs.nceas.ucsb.edu:/cvsnceas |
|
327 |
cvs co admindb |
|
328 |
cd admindb/perl/NCEAS/AdminDB |
|
329 |
perl Makefile.PL |
|
330 |
make |
|
331 |
sudo make install |
|
332 |
</code> |
|
333 |
</pre> |
|
334 |
</li> |
|
335 |
|
|
336 |
<li> |
|
337 |
<p>Finally, set the correct properties in the |
|
338 |
<code>nceas.cfg</code> file:</p> |
|
339 |
<pre> |
|
340 |
<code>nceas_db = //hyperion.nceas.ucsb.edu:1521/nceasp.nceas.ucsb.edu |
|
341 |
nceas_db_user = admowner |
|
342 |
nceas_db_password = NCEAS_DB_READ_PASSWORD_HERE |
|
343 |
</code> |
|
344 |
</pre> |
|
345 |
</li> |
|
346 |
|
|
347 |
<li> |
|
348 |
<p>A quick check of <code>register-dataset.cgi</code> should |
|
349 |
now show a complete list of projects: <img src= |
|
350 |
"images/registry-nceas-projects.png" alt= |
|
351 |
"NCEAS Project list" /></p> |
|
352 |
</li> |
|
353 |
</ol> |
|
354 |
|
|
355 |
<h2 id="notes">Notes</h2> |
|
356 |
|
|
357 |
<p>Redhat based, tested on Centos 5</p> |
|
358 |
|
|
359 |
<p>Debian based, tested on Ubuntu 8.04</p> |
|
360 |
</body> |
|
361 |
</html> |
|
0 | 362 |
Also available in: Unified diff
Add this file to cvs head.