summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorLisa Stillwell <lisa@localhost.localdomain>2012-08-11 02:44:18 (GMT)
committer Lisa Stillwell <lisa@localhost.localdomain>2012-08-11 02:44:18 (GMT)
commitcaed1208321296fc91c68989d03785da8181961a (patch)
tree566f63fe64eeb174d3cb67d7329a28e7b84bbca8 /packaging
parent3bff39d2ce3bde80019643da0d5684455f3724db (diff)
downloadQCG-Data-caed1208321296fc91c68989d03785da8181961a.zip
QCG-Data-caed1208321296fc91c68989d03785da8181961a.tar.gz
QCG-Data-caed1208321296fc91c68989d03785da8181961a.tar.bz2
[#769] updated to use tomcat5 via rpm install
Diffstat (limited to 'packaging')
-rw-r--r--packaging/idrop-web-config.groovy2
-rw-r--r--packaging/idrop-web.list.template95
2 files changed, 26 insertions, 71 deletions
diff --git a/packaging/idrop-web-config.groovy b/packaging/idrop-web-config.groovy
index 0f4e3d3..bb5d7a1 100644
--- a/packaging/idrop-web-config.groovy
+++ b/packaging/idrop-web-config.groovy
@@ -32,7 +32,7 @@ environments {
*/
idrop.config.idrop.lite.applet.jar="idrop-lite-1.0.1-SNAPSHOT-jar-with-dependencies.jar"
-idrop.config.idrop.lite.codebase="http://127.0.0.1/idrop-web-extras"
+idrop.config.idrop.lite.codebase="http://127.0.0.1:8080/idrop-web/idrop-web-extras"
idrop.config.idrop.lite.use.applet.dir=false
/*
diff --git a/packaging/idrop-web.list.template b/packaging/idrop-web.list.template
index 31e8647..458039f 100644
--- a/packaging/idrop-web.list.template
+++ b/packaging/idrop-web.list.template
@@ -6,9 +6,9 @@
%description Web Based Interface for Interacting with the iRODS data grid
%version 3.1 300001
-#%requires http 2
-#%requires java 6
-#%requires wget
+%requires httpd 2
+%requires java 6
+%requires tomcat5
%format all
@@ -18,52 +18,18 @@
$OS_IDROP_ACCT=idropweb
$OS_IDROP_DIR=idrop-web
$IDROP_HOME_DIR=/var/lib/$OS_IDROP_DIR
+$IDROP_EXTRAS=idrop-web-extras
-$OS_TOMCAT_ACCT=idroptc
-$TOMCAT_EXTRACT_DIR=/var/lib
-$TOMCAT_VER=7
-$TOMCAT_VER_DOT=0.29
-$TOMCAT_FILE=apache-tomcat-${TOMCAT_VER}.${TOMCAT_VER_DOT}
-$TOMCAT_ARC_FILE=${TOMCAT_FILE}.tar.gz
-$TOMCAT_HTTP_HOST=http://apache.mirrors.pair.com/tomcat/tomcat-${TOMCAT_VER}/v${TOMCAT_VER}.${TOMCAT_VER_DOT}/bin/
-$TOMCAT_TMP_LOC=/tmp/tomcat${TOMCAT_VER}.tar.gz
-$TOMCAT_HOME_DIR=${TOMCAT_EXTRACT_DIR}/idrop-tomcat-${TOMCAT_VER}.${TOMCAT_VER_DOT}
+$OS_TOMCAT_ACCT=tomcat
+$TOMCAT_VER=tomcat5
+$TOMCAT_HOME_DIR=/usr/share/${TOMCAT_VER}
$TOMCAT_STARTED=false
-$HTTP_EXTRAS=/var/www/html
-$IDROP_EXTRAS=idrop-web-extras
# =-=-=-=-=-=-=-
# preinstall directives
# =-=-=-=-=-=-=-
%preinstall << END_PREINSTALL
-#make sure tomcat is not already installed here
-if [ -d "${TOMCAT_HOME_DIR}" ]; then
- echo "WARNING :: Tomcat Is Already Installed In: ${TOMCAT_HOME_DIR}"
-else
-# install tomcat
- echo "INFO :: Getting Apache Tomcat version: ${TOMCAT_VER}.${TOMCAT_VER_DOT} ..."
-# download install archive
- wget -O ${TOMCAT_TMP_LOC} ${TOMCAT_HTTP_HOST}${TOMCAT_ARC_FILE}
-# unpack into /var/lib
- tar -zxf $TOMCAT_TMP_LOC -C $TOMCAT_EXTRACT_DIR
- mv /var/lib/${TOMCAT_FILE} ${TOMCAT_HOME_DIR}
-fi
-
-# create a service account for tomcat
-# determine if the service account already exists
-USER=$$( grep $OS_TOMCAT_ACCT /etc/passwd )
-if [ -n "$$USER" ];
-then
- echo "WARNING :: Service Account $OS_TOMCAT_ACCT Already Exists."
-else
-# create the service account
- echo "INFO :: Creating Service Account: $OS_TOMCAT_ACCT at ${TOMCAT_HOME_DIR}"
- /usr/sbin/useradd -c "Tomcat" -d ${TOMCAT_HOME_DIR} -s "/sbin/nologin" $OS_TOMCAT_ACCT
-fi
-ACCT=$OS_TOMCAT_ACCT
-chown -R $$ACCT:$$ACCT ${TOMCAT_HOME_DIR}
-
# create a service account for idrop-web
# determine if the service account already exists
USER=$$( grep $OS_IDROP_ACCT /etc/passwd )
@@ -83,17 +49,24 @@ END_PREINSTALL
# =-=-=-=-=-=-=-
%postinstall << END_POSTINSTALL
-# start tomcat
-echo "INFO :: Starting Tomcat ..."
-su -p -s /bin/sh $OS_TOMCAT_ACCT ${TOMCAT_HOME_DIR}/bin/startup.sh
+# create link to xala jar for tomcat5 so it can find TransformerFactory class
+# for Grails apps
+ln -s /usr/share/java/xalan-j2.jar /var/lib/${TOMCAT_VER}/common/endorsed/xalan-j2.jar
-# wait until the tomcat conf/Catalina/localhost folder is created
-# or timeout after about 10 seconds
-TRIES=0
-while [ "$$TRIES" -lt 100 -a ! -e ${TOMCAT_HOME_DIR}/conf/Catalina/localhost ]; do
- TRIES=$$((TRIES + 1))
- sleep .1
-done
+# if not already running - start tomcat
+RESULT=$$(ps ax | grep -v grep | grep -i tomcat)
+if [ -n "$$RESULT" ];
+then
+ echo "INFO :: Starting Tomcat ..."
+ /sbin/service ${TOMCAT_VER} start
+ # wait until the tomcat conf/Catalina/localhost folder is created
+ # or timeout after about 10 seconds
+ TRIES=0
+ while [ "$$TRIES" -lt 100 -a ! -e ${TOMCAT_HOME_DIR}/conf/Catalina/localhost ]; do
+ TRIES=$$((TRIES + 1))
+ sleep .1
+ done
+fi
# create config file (if it does not exist) for idrop-web in order to allow symbolic linking
echo "INFO :: Configuring iDrop Web for Tomcat ..."
@@ -126,7 +99,7 @@ echo "INFO :: Modifying Firewall For HTTP Port 8080 access ..."
/sbin/iptables -A idropweb -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/service iptables save
-# TODO: Any other instructions that should be printed here about configuring idrop-web?
+# Done - print info for starting up
echo "INFO :: To Run IDrop Web In Web Browser Type: http://127.0.0.1:8080/idrop-web"
echo "INFO :: To use iDrop-Lite applet or iDrop Swing Desktop application, verify that your browser supports JAVA"
END_POSTINSTALL
@@ -142,14 +115,6 @@ if [ -n "$$USER" ]; then
exit 1
fi
-# stop tomcat
-RESULT=$$(ps -ef | grep -i tomcat)
-if [ -n "$$RESULT" ];
-then
- echo "INFO :: Stopping Tomcat ..."
- su -p -s /bin/sh $OS_TOMCAT_ACCT ${TOMCAT_HOME_DIR}/bin/shutdown.sh
-fi
-
# remove iptables entries related to idropweb install
echo "INFO :: Removing Firewall Access for iDrop Web ..."
/sbin/iptables -F idropweb
@@ -174,16 +139,6 @@ then
else
echo "WARNING :: Service Account: ${OS_IDROP_ACCT} Already Removed"
fi
-
-# remove tomcat service account
-echo "INFO: :: Removing iDrop Web Tomcat Service Account: ${OS_TOMCAT_ACCT} ..."
-USER=$$( grep $OS_TOMCAT_ACCT /etc/passwd )
-if [ -n "$$USER" ];
-then
- /usr/sbin/userdel -r $OS_TOMCAT_ACCT
-else
- echo "WARNING :: Service Account: ${OS_TOMCAT_ACCT} Already Removed."
-fi
END_POSTREMOVE
# =-=-=-=-=-=-=-