-
-
Notifications
You must be signed in to change notification settings - Fork 604
Running apache tomcat
Tomasz Grabiec edited this page Nov 4, 2013
·
10 revisions
If you already have one you can skip this step.
- Download core binary package, eg: http://ftp.ps.pl/pub/apache/tomcat/tomcat-7/v7.0.47/bin/apache-tomcat-7.0.47.tar.gz
- Extract it, eg to
~/bin/apache-tomcat-7.0.47
. - [Optional] Configure tomcat.
You need to put the package under /usr/tomcat
in the guest file system. For development you can leverage make
process to do so:
- Append the following line to
usr.manifest
replacing/home/tgrabiec/bin/
with the directory in which your tomcat is located in the host:
/usr/tomcat/**:/home/tgrabiec/bin/apache-tomcat-7.0.42/**
- run
make
. On incremental build you will need to removebuild/release/usr.img.d
before or it will complain about inability to build dependencies.
If you already have the image, you can start OSv and use scp
to copy the package.
Save the following script as tomcat-cmd-line.sh
. It will be used to build the command line for starting tomcat.
#!/usr/bin/env bash
CATALINA_BASE=/usr/tomcat
CATALINA_HOME=$CATALINA_BASE
CLASSPATH=$CATALINA_HOME/bin/bootstrap.jar
# Logging
LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/tomcat-juli.jar
CATALINA_TMPDIR=$CATALINA_BASE/temp
echo "java.so -cp $CLASSPATH \
$LOGGING_CONFIG \
$LOGGING_MANAGER \
$JAVA_OPTS \
$CATALINA_OPTS \
-Dcatalina.base=$CATALINA_BASE \
-Dcatalina.home=$CATALINA_HOME \
-Djava.io.tmpdir=$CATALINA_TMPDIR \
org.apache.catalina.startup.Bootstrap start"
You can now start OSv:
scripts/run.py -nv -e "`./tomcat-cmd-line.sh`"