You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

We've got a jail at tapestry.zones.apache.org running Tomcat 7 where we can deploy demo applications. The Hotel Booking demo is running there.

ccordenier and uli can deploy and manage webapps. ccordenier, thiagohp and uli can log in and restart Tomcat.

restarting tomcat

ONLY use

sudo /usr/local/etc/rc.d/tomcat7 restart

if you need to restart Tomcat. Anything else will fail.

reinstalling the jail

If the jail lost Java and Tomcat:

cd /usr/ports

if it doesn't exist yet:

portsnap fetch
portsnap extract

install java:

cd /usr/ports/java/diablo-jdk16/
make install clean

Some files need manual download and have to be placed into /usr/ports/distfiles. Follow the instructions on screen.

Some of these files already live on ftp://tb.apache.org/pub/FreeBSD/ports/distfiles/ and can be downloaded from there. The time zone update utility doesn't, it has to be downloaded from Oracle directly.

Afterwards:

make install clean

Follow instructions and manually install any unresolved dependencies it might encounter.

Install Tomcat 7:

from pre-built package (preferred)

Check your env for PACKAGESITE. It should point to tb.apache.org:

[root@tapestry ~]# env|grep PACKAGESITE
PACKAGESITE=ftp://tb.apache.org/pub/FreeBSD/ports/packages/8.2-RELENG-j-tlp/Latest/

Install the tomcat7 package:

pkg_add -r tomcat7
from ports (discouraged)

this is really discouraged!

cd /usr/ports/www/tomcat7
make install clean
configure tomcat

Tomcat resides in /usr/local/apache-tomcat-7.0/. You may wish to set up some users in conf/tomcat-users.xml. Note that from Tomcat 7 onwards the manager role is split into 4 separate roles, the one for the manager GUI is manager-gui. By default, Tomcat listens on port 8080, we want it to listen on 8180 though, so edit conf/server.xml and change the port.

Add

tomcat7_enable="YES"
tomcat7_java_home="/usr/local/diablo-jdk1.6.0/jre"
tomcat7_java_opts="-XX:MaxPermSize=256M"

to /etc/rc.conf to start tomcat on system startup and tell it to use the Diablo JVM.

The sudoers file may have lost the entry allowing members of the tomcat-restart group to restart Tomcat. Add it back using visudo:

# restart tomcat
%tomcat-restart ALL=(root)      NOPASSWD: /usr/local/etc/rc.d/tomcat7 restart
  • No labels