Revision 6558
Added by ben leinfelder about 13 years ago
src/scripts/debian/tomcat5.5 | ||
---|---|---|
1 |
#!/bin/bash |
|
2 |
# |
|
3 |
# /etc/init.d/tomcat5.5 -- startup script for the Tomcat 5 servlet engine customixed |
|
4 |
# for Metacat |
|
5 |
# |
|
6 |
# Written by Michael Daigle <daigle@nceas.ucsb.edu>. |
|
7 |
# |
|
8 |
|
|
9 |
DESC="Tomcat servlet engine" |
|
10 |
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun |
|
11 |
export CATALINA_HOME=/usr/share/tomcat5.5 |
|
12 |
|
|
13 |
if [ `id -u` -ne 0 ]; then |
|
14 |
echo "You need root privileges to run this script" |
|
15 |
exit 1 |
|
16 |
fi |
|
17 |
|
|
18 |
# Make sure tomcat is started with system locale |
|
19 |
if [ -r /etc/default/locale ]; then |
|
20 |
. /etc/default/locale |
|
21 |
export LANG |
|
22 |
fi |
|
23 |
|
|
24 |
function start { |
|
25 |
if [ -z "$JAVA_HOME" ]; then |
|
26 |
echo "no JDK found - please set JAVA_HOME" |
|
27 |
exit 1 |
|
28 |
fi |
|
29 |
|
|
30 |
if [ ! -d "$CATALINA_HOME/conf" ]; then |
|
31 |
echo "invalid CATALINA_HOME specified" |
|
32 |
exit 1 |
|
33 |
fi |
|
34 |
|
|
35 |
log_daemon_msg "Starting $DESC" |
|
36 |
$CATALINA_HOME/bin/startup.sh |
|
37 |
echo 0 |
|
38 |
} |
|
39 |
|
|
40 |
function stop { |
|
41 |
echo "Stopping $DESC" |
|
42 |
$CATALINA_HOME/bin/shutdown.sh |
|
43 |
echo 0 |
|
44 |
} |
|
45 |
|
|
46 |
case "$1" in |
|
47 |
start) |
|
48 |
start |
|
49 |
;; |
|
50 |
stop) |
|
51 |
stop |
|
52 |
;; |
|
53 |
restart|force-reload) |
|
54 |
stop |
|
55 |
sleep 5 |
|
56 |
start |
|
57 |
;; |
|
58 |
*) |
|
59 |
echo "Usage: $0 {start|stop|restart}" |
|
60 |
exit 1 |
|
61 |
;; |
|
62 |
esac |
|
63 |
|
|
64 |
exit 0 |
lib/admin/configure-restart.jsp | ||
---|---|---|
83 | 83 |
<br clear="right"/> |
84 | 84 |
<p class="section">Restarting Metacat</p> |
85 | 85 |
<p>The simplest way to restart metacat is to restart the entire servlet engine. |
86 |
For Tomcat, this would mean calling "sudo /etc/init.d/tomcat5.5 restart" or
|
|
86 |
For Tomcat, this would mean calling "sudo /etc/init.d/tomcat6 restart" or
|
|
87 | 87 |
an equivalent command appropriate to your operating system. After restarting, |
88 | 88 |
you can access your new Metacat server at the URL: |
89 | 89 |
<a href="<%= request.getScheme() + "://" + |
lib/admin/metacat-configuration.jsp | ||
---|---|---|
215 | 215 |
<p> Since this is a reconfiguration, you will need to restart Metacat after any changes.</p> |
216 | 216 |
|
217 | 217 |
<p>The simplest way to restart metacat is to restart the entire servlet engine. |
218 |
For Tomcat, this would mean calling "sudo /etc/init.d/tomcat5.5 restart" or
|
|
218 |
For Tomcat, this would mean calling "sudo /etc/init.d/tomcat6 restart" or
|
|
219 | 219 |
an equivalent command appropriate to your operating system. After restarting, |
220 | 220 |
you can access your new Metacat server at the URL: |
221 | 221 |
<a href="<%= contextURL %>"><%= contextURL %></a> |
src/scripts/debian/control | ||
---|---|---|
3 | 3 |
Section: base |
4 | 4 |
Priority: optional |
5 | 5 |
Architecture: all |
6 |
Depends: sun-java5-jdk, apache2, libapache2-mod-jk, tomcat5.5, postgresql
|
|
6 |
Depends: sun-java6-jdk, apache2, libapache2-mod-jk, tomcat6, postgresql
|
|
7 | 7 |
Maintainer: Matt Jones <jones@nceas.ucsb.edu> |
8 | 8 |
Description: Metacat is a metadata cataloging system. |
9 | 9 |
Metacat is a flexible metadata database. It utilizes XML as a |
src/scripts/debian/postinst | ||
---|---|---|
2 | 2 |
|
3 | 3 |
LONG_DATE=`date +%Y%m%d%H%M%S` |
4 | 4 |
|
5 |
TOMCAT_USER=tomcat55
|
|
6 |
TOMCAT_HOME=/usr/share/tomcat5.5
|
|
5 |
TOMCAT_USER=tomcat6
|
|
6 |
TOMCAT_HOME=/usr/share/tomcat6
|
|
7 | 7 |
SOURCE_DIR=/usr/share/metacat-@metacatVersion@ |
8 | 8 |
|
9 | 9 |
############################################################################### |
... | ... | |
12 | 12 |
|
13 | 13 |
## Stop tomcat |
14 | 14 |
echo "Stopping Tomcat" |
15 |
/etc/init.d/tomcat5.5 stop
|
|
15 |
/etc/init.d/tomcat6 stop
|
|
16 | 16 |
|
17 | 17 |
## backup the old war file |
18 | 18 |
if [ -e ${TOMCAT_HOME}/webapps/knb.war ] |
... | ... | |
70 | 70 |
## Change ownership of the tomcat directories to be the tomcat user |
71 | 71 |
echo "changing ownership of ${TOMCAT_HOME} to ${TOMCAT_USER}" |
72 | 72 |
chown -R ${TOMCAT_USER} ${TOMCAT_HOME} |
73 |
echo "changing ownership of /var/lib/tomcat5.5 to ${TOMCAT_USER}"
|
|
74 |
chown -R ${TOMCAT_USER} /var/lib/tomcat5.5
|
|
75 |
echo "changing ownership of /etc/tomcat5.5 to ${TOMCAT_USER}"
|
|
76 |
chown -R ${TOMCAT_USER} /etc/tomcat5.5
|
|
73 |
echo "changing ownership of /var/lib/tomcat6 to ${TOMCAT_USER}"
|
|
74 |
chown -R ${TOMCAT_USER} /var/lib/tomcat6
|
|
75 |
echo "changing ownership of /etc/tomcat6 to ${TOMCAT_USER}"
|
|
76 |
chown -R ${TOMCAT_USER} /etc/tomcat6
|
|
77 | 77 |
|
78 |
## If the tomcat5.5 startup script in the package is different than the one |
|
79 |
## in /etc/init.d, then backup the existing one and copy in the package version. |
|
80 |
TOMCAT_START_SCRIPT_DIFF=`diff ${SOURCE_DIR}/tomcat5.5 /etc/init.d/tomcat5.5` |
|
81 |
if [ "$TOMCAT_START_SCRIPT_DIFF" != "" ] |
|
82 |
then |
|
83 |
echo "Backing up /etc/init.d/tomcat5.5 to /etc/init.d/tomcat5.5.${LONG_DATE}" |
|
84 |
mv /etc/init.d/tomcat5.5 /etc/init.d/tomcat5.5.${LONG_DATE} |
|
85 |
echo "Copying new tomcat5.5 script to /etc/init.d/" |
|
86 |
cp ${SOURCE_DIR}/tomcat5.5 /etc/init.d/ |
|
87 |
echo "Making /etc/init.d/tomcat5.5 executable" |
|
88 |
chmod +x /etc/init.d/tomcat5.5 |
|
89 |
fi |
|
90 | 78 |
|
91 | 79 |
############################################################################### |
92 | 80 |
# Configure Apache |
... | ... | |
190 | 178 |
echo "starting Tomcat server" |
191 | 179 |
|
192 | 180 |
#export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun |
193 |
#/usr/share/tomcat5.5/bin/startup.sh
|
|
181 |
#/usr/share/tomcat6/bin/startup.sh
|
|
194 | 182 |
|
195 |
/etc/init.d/tomcat5.5 start
|
|
183 |
/etc/init.d/tomcat6 start
|
|
196 | 184 |
#chmod u+x ${SOURCE_DIR}/delay-tomcat-start |
197 | 185 |
#${SOURCE_DIR}/delay-tomcat-start & |
src/scripts/debian/workers.properties | ||
---|---|---|
1 |
workers.tomcat_home=/usr/share/tomcat5.5
|
|
2 |
workers.java_home=/usr/lib/jvm/java-1.5.0-sun
|
|
1 |
workers.tomcat_home=/usr/share/tomcat6
|
|
2 |
workers.java_home=/usr/lib/jvm/java-1.6.0-sun
|
|
3 | 3 |
|
4 | 4 |
worker.list=ajp13 |
5 | 5 |
worker.ajp13.port=8009 |
src/scripts/debian/knb-ssl | ||
---|---|---|
1 | 1 |
<IfModule mod_ssl.c> |
2 | 2 |
NameVirtualHost *:443 |
3 | 3 |
<VirtualHost *:443> |
4 |
DocumentRoot /usr/share/tomcat5.5/webapps/knb
|
|
4 |
DocumentRoot /var/lib/tomcat6/webapps/knb
|
|
5 | 5 |
|
6 |
ScriptAlias /knb/cgi-bin/ /usr/share/tomcat5.5/webapps/knb/cgi-bin/
|
|
7 |
<Directory "/usr/share/tomcat5.5/webapps/knb/cgi-bin/">
|
|
6 |
ScriptAlias /knb/cgi-bin/ /var/lib/tomcat6/webapps/knb/cgi-bin/
|
|
7 |
<Directory "/var/lib/tomcat6/webapps/knb/cgi-bin/">
|
|
8 | 8 |
AllowOverride All |
9 | 9 |
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch |
10 | 10 |
Order allow,deny |
src/scripts/debian/knb | ||
---|---|---|
1 | 1 |
NameVirtualHost *:80 |
2 | 2 |
<VirtualHost *:80> |
3 |
DocumentRoot /usr/share/tomcat5.5/webapps/knb
|
|
3 |
DocumentRoot /var/lib/tomcat6/webapps/knb
|
|
4 | 4 |
ServerName <your_hostname_here> |
5 | 5 |
|
6 |
ScriptAlias /knb/cgi-bin/ /usr/share/tomcat5.5/webapps/knb/cgi-bin/
|
|
7 |
<Directory "/usr/share/tomcat5.5/webapps/knb/cgi-bin/">
|
|
6 |
ScriptAlias /knb/cgi-bin/ /var/lib/tomcat6/webapps/knb/cgi-bin/
|
|
7 |
<Directory "/var/lib/tomcat6/webapps/knb/cgi-bin/">
|
|
8 | 8 |
AllowOverride All |
9 | 9 |
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch |
10 | 10 |
Order allow,deny |
src/scripts/debian/delay-tomcat-start | ||
---|---|---|
2 | 2 |
|
3 | 3 |
sleep 5 |
4 | 4 |
echo Starting Tomcat |
5 |
/etc/init.d/tomcat5.5 start |
|
5 |
/etc/init.d/tomcat6 start |
docs/dev/troubleshooting.html | ||
---|---|---|
78 | 78 |
when Tomcat has been installed on an Ubuntu/Debian system using apt-get install. |
79 | 79 |
And the application is started using: |
80 | 80 |
|
81 |
<div class="code">/etc/init.d/tomcat5.5 start</div>
|
|
81 |
<div class="code">/etc/init.d/tomcat6 start</div>
|
|
82 | 82 |
|
83 | 83 |
<p>The problem is that the standard startup scripts reference the |
84 | 84 |
common java service, jsvc. Metacat will not run under jsvc. The solutions are: |
85 | 85 |
<ul> |
86 | 86 |
<li>Download the <a href="http://knb.ecoinformatics.org/software/download.html">Metacat binary install package</a> |
87 |
and replace your /etc/init.d/tomcat5.5 startup script with the one provided in the
|
|
87 |
and replace your /etc/init.d/tomcat6 startup script with the one provided in the
|
|
88 | 88 |
package.</li> |
89 | 89 |
<li>Run Tomcat from the Tomcat binary directory: <tomcat_home>/bin/startup.sh and |
90 | 90 |
<tomcat_home>/bin/shutdown.sh</li> |
docs/dev/testing-metacat.html | ||
---|---|---|
149 | 149 |
<div class="code"><workspace>/metacat/test/test.properties</div> |
150 | 150 |
This should only hold one property: metacat.contextDir. This should point to |
151 | 151 |
the context directory for the metacat server you are testing. For example: |
152 |
<div class="code">metacat.contextDir=/usr/share/tomcat5.5/webapps/knb</div>
|
|
152 |
<div class="code">metacat.contextDir=/var/lib/tomcat6/webapps/knb</div>
|
|
153 | 153 |
The test classes will use this to determine where to look for the server |
154 | 154 |
metacat.properties file.</p> |
155 | 155 |
|
Also available in: Unified diff
remove reference to tomcat5.5 in favor of tomcat6. including the "custom" start up script that used the sun jdk -- this can be configured rather than coded into the script.