0
|
1 |
#!/bin/sh
|
|
2 |
#
|
|
3 |
# CDDL HEADER START
|
|
4 |
#
|
|
5 |
# The contents of this file are subject to the terms of the
|
|
6 |
# Common Development and Distribution License (the "License").
|
|
7 |
# You may not use this file except in compliance with the License.
|
|
8 |
#
|
|
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
10 |
# or http://www.opensolaris.org/os/licensing.
|
|
11 |
# See the License for the specific language governing permissions
|
|
12 |
# and limitations under the License.
|
|
13 |
#
|
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each
|
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
16 |
# If applicable, add the following below this CDDL HEADER, with the
|
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying
|
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner]
|
|
19 |
#
|
|
20 |
# CDDL HEADER END
|
|
21 |
#
|
|
22 |
#
|
14
|
23 |
# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
0
|
24 |
#
|
14
|
25 |
#ident "@(#)install-tomcat 1.22 10/04/22 SMI"
|
0
|
26 |
|
|
27 |
# functions - search for "START HERE" to find start of control flow
|
|
28 |
|
|
29 |
. ${SRC}/tools/install.subr
|
|
30 |
|
|
31 |
install_tomcat() {
|
|
32 |
cd ${USRTOMCAT}
|
|
33 |
rm -rf *
|
|
34 |
cd ${VARTOMCAT}
|
|
35 |
rm -rf *
|
|
36 |
|
|
37 |
cd ${TOP}/${TOMCATSRC}/output/build
|
|
38 |
|
|
39 |
# this stuff goes in $CATALINA_HOME
|
|
40 |
find bin lib -depth -print |
|
|
41 |
cpio -pdum ${USRTOMCAT}
|
|
42 |
|
|
43 |
# this stuff goes in $CATALINA_BASE (must be writable)
|
|
44 |
find conf temp webapps -depth -print |
|
|
45 |
cpio -pdum ${VARTOMCAT}
|
|
46 |
|
|
47 |
# create work and logs directories
|
|
48 |
mkdir ${VARTOMCAT}/work ${VARTOMCAT}/logs
|
|
49 |
|
|
50 |
# create link in /etc
|
|
51 |
cd ${ROOT}/etc
|
|
52 |
rm -rf tomcat6
|
|
53 |
ln -s ../var/tomcat${VERSION}/conf tomcat6
|
2
|
54 |
|
0
|
55 |
# move static stuff to usr and symlink it
|
|
56 |
cd ${VARTOMCAT}/webapps
|
|
57 |
find docs -depth -print | cpio -pdum ${USRTOMCAT}
|
|
58 |
rm -rf docs
|
|
59 |
ln -s ../../../usr/tomcat${VERSION}/docs docs
|
|
60 |
|
2
|
61 |
# move default web application to different location and install
|
5
|
62 |
# redirect html page (for possible altering of ROOT web app) and
|
|
63 |
# jsp file (as home page when SUNWtcat-examples is not installed).
|
2
|
64 |
mv ROOT ROOT.example
|
|
65 |
mkdir ROOT
|
5
|
66 |
_install N ${TOP}/Solaris/index.htm ${VARTOMCAT}/webapps/ROOT/index.htm 644
|
2
|
67 |
_install N ${TOP}/Solaris/index.jsp ${VARTOMCAT}/webapps/ROOT/index.jsp 644
|
|
68 |
|
0
|
69 |
# get rid of the MS-DOS files we don't need
|
|
70 |
cd ${USRTOMCAT}/bin
|
|
71 |
rm -r *.bat
|
|
72 |
}
|
|
73 |
|
|
74 |
install_man_page() {
|
|
75 |
cd ${TOP}/Solaris
|
|
76 |
_install N tomcat.1m.sunman ${PREFIX}/share/man/man1m/tomcat.1m 444
|
|
77 |
}
|
|
78 |
|
|
79 |
install_smf_hook() {
|
|
80 |
cd ${TOP}/Solaris
|
14
|
81 |
_install N http-tomcat${VERSION}.xml ${ROOT}/lib/svc/manifest/network/http-tomcat${VERSION}.xml 444
|
0
|
82 |
_install N http-tomcat${VERSION} ${ROOT}/lib/svc/method/http-tomcat${VERSION} 555
|
|
83 |
}
|
|
84 |
|
|
85 |
backup_conf() {
|
|
86 |
cd ${VARTOMCAT}
|
|
87 |
gtar cfz conf/CONF.tar.gz conf/*
|
|
88 |
}
|
|
89 |
|
|
90 |
fix_tomcat_perms() {
|
|
91 |
cd ${VARTOMCAT}
|
|
92 |
find conf webapps -type f -exec chmod 644 {} \;
|
|
93 |
find conf webapps -type d -exec chmod 755 {} \;
|
|
94 |
chmod 600 conf/tomcat-users.xml
|
|
95 |
|
|
96 |
find temp -type f -exec chmod 644 {} \;
|
|
97 |
find temp -type d -exec chmod 755 {} \;
|
|
98 |
|
|
99 |
cd ${USRTOMCAT}
|
|
100 |
find . -type d -exec chmod 755 {} \;
|
|
101 |
find . -type f -exec chmod 644 {} \;
|
|
102 |
|
|
103 |
cd ${USRTOMCAT}/bin
|
|
104 |
find . -type f -exec chmod 755 {} \;
|
|
105 |
}
|
|
106 |
|
|
107 |
# START HERE - actual script processing starts here
|
|
108 |
|
|
109 |
# install locations
|
|
110 |
|
|
111 |
PREFIX=${ROOT}/usr
|
|
112 |
VARDIR=${ROOT}/var
|
|
113 |
VERSION=6
|
|
114 |
|
|
115 |
USRTOMCAT=${PREFIX}/tomcat${VERSION} # aka $CATALINA_HOME
|
|
116 |
VARTOMCAT=${VARDIR}/tomcat${VERSION} # aka $CATALINA_BASE
|
|
117 |
|
|
118 |
ETCAPACHEDIR=${ROOT}/etc/apache
|
|
119 |
|
|
120 |
TOP=`pwd`
|
|
121 |
|
|
122 |
install_tomcat
|
|
123 |
install_man_page
|
|
124 |
install_smf_hook
|
|
125 |
|
|
126 |
# all installation should be done before this point, so the functions
|
|
127 |
# that fixup permissions can get everything that is installed.
|
|
128 |
|
|
129 |
fix_tomcat_perms
|
|
130 |
|
|
131 |
# backup conf dir (with right perms)
|
|
132 |
|
|
133 |
backup_conf
|
|
134 |
|
|
135 |
exit 0
|