1 |
3573
|
barseghian
|
<h2>Installing Metacat on Mac OSX (10.4.10)</h2>
|
2 |
|
|
Author: Matthew Perry, Derik Barseghian<br />
|
3 |
|
|
Date: 11/05/2007<br />
|
4 |
|
|
|
5 |
|
|
<p>
|
6 |
|
|
This is a terse cheatsheet for metacat with postgres on os X. Please see metacat_install_instructs.html for the full details.
|
7 |
|
|
</p>
|
8 |
|
|
|
9 |
|
|
<h2>* pre-requirements</h2>
|
10 |
|
|
<h3>install ant, postgres, tomcat using macports</h3>
|
11 |
|
|
<p>Alternatively, download and install ant, postgres and tomcat from source or using fink.</p>
|
12 |
|
|
<p>
|
13 |
|
|
install <a href="http://www.macports.org/">macports</a>.
|
14 |
|
|
</p>
|
15 |
|
|
|
16 |
|
|
<p>
|
17 |
|
|
launch a terminal
|
18 |
|
|
</p>
|
19 |
|
|
|
20 |
|
|
<pre>
|
21 |
|
|
sudo port -d sync
|
22 |
|
|
sudo port search ant
|
23 |
|
|
sudo port install ant
|
24 |
|
|
sudo port search postgres
|
25 |
|
|
sudo port install postgresql82
|
26 |
|
|
sudo port search tomcat
|
27 |
|
|
sudo port install tomcat5
|
28 |
|
|
</pre>
|
29 |
|
|
|
30 |
|
|
<h2>* metacat install</h2>
|
31 |
|
|
|
32 |
|
|
<h3>setup database</h3>
|
33 |
|
|
<pre>
|
34 |
|
|
cd /opt/local/lib/postgresql82/
|
35 |
|
|
sudo mkdir data
|
36 |
|
|
chown -R yourusername.yourusername data
|
37 |
|
|
cd data
|
38 |
|
|
../bin/initdb -D data
|
39 |
|
|
../bin/pg_ctl -D data -l logfile start
|
40 |
|
|
../bin/createdb metacat
|
41 |
|
|
../bin/psql -d metacat
|
42 |
|
|
metacat=> create user metacat with unencrypted password 'metacat';
|
43 |
|
|
metacat=> \q
|
44 |
|
|
</pre>
|
45 |
|
|
|
46 |
|
|
<p>
|
47 |
|
|
test password:
|
48 |
|
|
</p>
|
49 |
|
|
<pre>
|
50 |
|
|
../bin/psql -U metacat -W -h localhost metacat
|
51 |
|
|
Password for user metacat:
|
52 |
|
|
metacat=> \q
|
53 |
|
|
|
54 |
|
|
cd /opt/local/share/java/tomcat5
|
55 |
|
|
sudo mkdir -p data/metacat/data
|
56 |
|
|
sudo mkdir -p data/metacat/inlinedata
|
57 |
|
|
chown -R yourusername.yourusername data
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
bin/initdb -D data
|
61 |
|
|
bin/pg_ctl -D data -l logfile start
|
62 |
|
|
bin/createdb metacat
|
63 |
|
|
bin/psql -d metacat
|
64 |
|
|
metacat=> create user metacat with unencrypted password 'yourpassword';
|
65 |
|
|
metacat=> \q
|
66 |
|
|
</pre>
|
67 |
|
|
|
68 |
|
|
<p>
|
69 |
|
|
Add to data/pg_hba.conf:
|
70 |
|
|
</p>
|
71 |
|
|
<pre>
|
72 |
|
|
host metacat metacat 127.0.0.1 255.255.255.255 password
|
73 |
|
|
|
74 |
|
|
bin/pg_ctl -D data -l logfile restart
|
75 |
|
|
psql -U metacat -W -h localhost metacat
|
76 |
|
|
</pre>
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
<h3>checkout metacat</h3>
|
80 |
|
|
<pre>
|
81 |
|
|
mkdir ~/cvs_src/
|
82 |
|
|
cd ~/cvs_src
|
83 |
|
|
export CVS_RSH="/usr/bin/ssh"
|
84 |
|
|
cvs -d:ext:your_cvs_name@cvs.ecoinformatics.org:/cvs co metacat
|
85 |
|
|
cvs -d:ext:your_cvs_name@cvs.ecoinformatics.org:/cvs co utilities
|
86 |
|
|
</pre>
|
87 |
|
|
|
88 |
|
|
<h3>edit build.properties as needed</h3>
|
89 |
|
|
|
90 |
|
|
<pre>
|
91 |
|
|
tomcat=/opt/local/share/java/tomcat5
|
92 |
|
|
deploy.dir=/opt/local/share/java/tomcat5/webapps/
|
93 |
|
|
config.hostname=localhost
|
94 |
|
|
config.port=8080
|
95 |
|
|
config.port.https=8443
|
96 |
|
|
|
97 |
|
|
datafilepath=/opt/local/share/java/tomcat5/data/metacat/data
|
98 |
|
|
inlinedatafilepath=/opt/local/share/java/tomcat5/data/metacat/inlinedata
|
99 |
|
|
</pre>
|
100 |
|
|
|
101 |
|
|
<p>
|
102 |
|
|
if your mac username is different from your cvs name, hardcode hack:
|
103 |
|
|
</p>
|
104 |
|
|
<pre>
|
105 |
|
|
cvsroot=:ext:yourcvsname@cvs.ecoinformatics.org:/cvs
|
106 |
|
|
|
107 |
|
|
log.dir=/opt/local/share/java/tomcat5/logs
|
108 |
|
|
metacat.dir=/Users/yourname/nceas/metacat
|
109 |
|
|
</pre>
|
110 |
|
|
|
111 |
|
|
<h3>install metacat</h3>
|
112 |
|
|
<pre>
|
113 |
|
|
cd metacat
|
114 |
|
|
sudo ant install
|
115 |
|
|
</pre>
|
116 |
|
|
|
117 |
|
|
<p>
|
118 |
|
|
Enter your cvs password a few times...
|
119 |
|
|
</p>
|
120 |
|
|
|
121 |
|
|
<pre>
|
122 |
|
|
psql82 -U metacat -W -h localhost -f build/src/xmltables-postgres.sql metacat
|
123 |
|
|
ant register-schemas
|
124 |
|
|
</pre>
|
125 |
|
|
|
126 |
|
|
<p>Restart tomcat</p>
|
127 |
|
|
<pre>
|
128 |
|
|
sudo /opt/local/share/java/tomcat5/bin/shutdown.sh
|
129 |
|
|
sudo /opt/local/share/java/tomcat5/bin/startup.sh
|
130 |
|
|
</pre>
|
131 |
|
|
|
132 |
|
|
<p>
|
133 |
|
|
Point your browser to http://localhost:8080/knb/ and you should be in business.
|
134 |
|
|
</p>
|
135 |
|
|
|
136 |
|
|
<p>
|
137 |
|
|
After restarting, you'll need to fire off the following commands in order to start up postgres/tomcat again:
|
138 |
|
|
|
139 |
|
|
# Startup
|
140 |
|
|
</p>
|
141 |
|
|
<pre>
|
142 |
|
|
/Users/nceas/Apps/postgres/bin/pg_ctl -D /Users/nceas/Apps/postgres/data/ -l /Users/nceas/Apps/postgres/logfile -m fast start
|
143 |
|
|
/Users/nceas/Apps/apache-tomcat-5.5.20/bin/startup.sh
|
144 |
|
|
</pre>
|
145 |
|
|
|
146 |
|
|
<p>
|
147 |
|
|
# Shutdown
|
148 |
|
|
</p>
|
149 |
|
|
<pre>
|
150 |
|
|
/Users/nceas/Apps/apache-tomcat-5.5.20/bin/shutdown.sh
|
151 |
|
|
/Users/nceas/Apps/postgres/bin/pg_ctl -D /Users/nceas/Apps/postgres/data/ -l /Users/nceas/Apps/postgres/logfile -m fast stop
|
152 |
|
|
</pre>
|
153 |
|
|
|
154 |
|
|
<p>
|
155 |
|
|
You can create two shell scripts with the preceeding commands; start_metacat.sh and stop_metacat.sh
|
156 |
|
|
</p>
|