Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Tomcat install on OpenBSD

From: Adam Getchell <AdamG(at)hrrm.ucdavis.edu>
Date: Fri Mar 07 2003 - 21:25:58 EST


Here's my install logs, in case you're interested. This is a devel box, so I had to set things up so non-root developers could start/run Tomcat. I haven't tried loading EJB. I'm fiddling with Cocoon (http://xml.apache.org/cocoon/ ), I'll let you know how that goes.

BTW, if some of the more experienced sysadmins out there see some egregious mistakes, I'd be pleased to hear of it.

--Adam

JAVADEVEL OpenBSD 3.2
Hard drive partitions

/dev/rwd0a	/		4GB
/dev/rwd0d	/usr		4GB
/dev/rwd0e	/var		4GB
/dev/rwd0f	/tmp		2GB
/dev/rwd0g	/usr/obj	125M
/dev/rwd0h	/home		4GB
swap				512M

(/usr/obj is a little too small -- 256M better)

Add all packages except games, allow X setup

# Add tcsh package

pkg_add -v
ftp://ftp.openbsd.org/pub/OpenBSD/3.1/packages/i386/tcsh-6.10.00-static.tgz

# Save /etc/shells in case of mistake

cd /etc
mkdir RCS
ci -l /etc/shells

Do you need help?X

# Add tcsh to local shells

echo "/usr/local/bin/tcsh" >> /etc/shells

# Add cvsup

pkg_add -v
ftp://ftp.openbsd.org/pub/OpenBSD/3.1/packages/i386/cvsup-16.1f.tgz

# Make /etc/cvs-supfile to fetch sources with these contents

*default release=cvs
*default base=/usr/src
*default prefix=/usr
*default host=cvsup.usa.openbsd.org
*default delete use-rel-suffix
*default umask=002

OpenBSD-src tag=OPENBSD_3_2

# Now fetch updated source

/usr/local/bin/cvsup /etc/cvs-supfile

# Build kernel

cd /usr/src
make obj
cd /usr/src/etc && make DESTDIR=/ distrib-dirs cd /usr/src/sys/arch/i386/conf
config GENERIC
cd ../compile/GENERIC
make clean && make depend && make
cp /bsd /bsd.old && cp bsd /bsd
reboot

# Build userland

cd /usr/src
make build

JAVADEVEL
# Install Tomcat 4.0.6 from ports
# First, download Java binary and put in /usr/ports/distfiles
# Otherwise, compile will fail

javadevel@/usr/ports/distfiles # ls -axl total 64660

drwxr-xr-x   2 root  wheel       512 Nov  8 08:17 .
drwxr-xr-x  41 root  wheel      1024 Nov  8 07:45 ..
-rw-r--r--   1 root  wheel  26423971 Oct 22 22:35
j2sdk-1_3_1_04-linux-i586.bin
-rw-r--r--   1 root  wheel   5562125 Nov  8 08:08 jakarta-tomcat-4.0.6.zip
-rw-r--r--   1 root  wheel   1068662 Feb 17  2002 unzip550.tar.gz
Do you need more help?X

# Now run tomcat compile

javadevel@/usr/ports/www/jakarta-tomcat/v4 # make javadevel@/usr/ports/www/jakarta-tomcat/v4 # make install

# Make temp file for tomcat
# Otherwise, database connectivity doesn't happen
mkdir /var/tomcat/temp
chmod 775 /var/tomcat/temp

# Edit .tcshrc shell script so that /usr/local/jakarta-tomcat/bin works
javadevel@/usr/local/jakarta-tomcat-4.0.6/bin # ls -axl total 94

drwxr-xr-x  2 root  bin    512 Nov  8 08:19 .
drwxr-xr-x  9 root  bin   1024 Nov  8 08:19 ..
-rw-r--r--  1 root  bin  24461 Oct  8 16:15 bootstrap.jar
-rwxr-xr-x  1 root  bin   8557 Nov  8 08:08 catalina.sh
-rwxr-xr-x  1 root  bin    854 Oct  8 16:15 digest.sh
-rwxr-xr-x  1 root  bin   2742 Oct  8 16:15 jasper.sh
-rwxr-xr-x  1 root  bin    797 Oct  8 16:15 jspc.sh
-rwxr-xr-x  1 root  bin   1567 Oct  8 16:15 setclasspath.sh
-rwxr-xr-x  1 root  bin    791 Oct  8 16:15 shutdown.sh
-rwxr-xr-x  1 root  bin    921 Nov 12 16:29 startup.sh
-rwxr-xr-x  1 root  bin   2488 Oct  8 16:15 tool-wrapper.sh

Contents of .tcshrc

javadevel@/root # less .tcshrc
set prompt='%m@%/ %# '
setenv JAVA_HOME /usr/local/jdk1.3.1-linux setenv CLASSPATH /var/tomcat/webapps/ROOT/WEB-INF/classes

JAVADEVEL 3:05 PM 12/11/2002
# Add sudo for developers to kill threads/reboot server

Contents of /etc/sudoers

Can we help you?X

javadevel@/var/tomcat # less /etc/sudoers
# $OpenBSD: sudoers,v 1.4 2002/07/16 18:19:18 naddy Exp $
#
# This file MUST be edited with the 'visudo' command as root.

# Cmnd alias specification

Cmnd_Alias      KILL = /bin/kill
Cmnd_Alias      SHUTDOWN = /usr/sbin/shutdown
Cmnd_Alias      HALT = /sbin/halt
Cmnd_Alias      REBOOT = /sbin/reboot

# Defaults specification

# User privilege specification

root ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands

# Same thing without a password

# Samples

%staff ALL = KILL, SHUTDOWN, HALT, REBOOT

Can't find what you're looking for?X

JAVADEVEL 2:57 PM 12/17/2002
# Allow scratch files and management to work for JM2
chmod 777 /var/tomcat/work/Standalone/localhost/_ chmod 777 /var/tomcat/work/Standalone/localhost/manager

# Remove WEBDAV files ... remote access not needed
javadevel@/var/tomcat/webapps # rm -r webdav/

JAVADEVEL 10:54 AM 12/19/2002
# Remove examples

javadevel@/var/tomcat/webapps # ls -axl
total 12

drwxr-xr-x  6 root  staff  512 Dec 17 15:00 .
drwxr-xr-x  6 root  wheel  512 Nov 22 17:08 ..
drwxrwxr-x  5 root  staff  512 Dec 17 15:34 ROOT
drwxr-xr-x  6 root  staff  512 Nov  8 08:19 examples
drwxr-xr-x  3 root  staff  512 Nov  8 08:19 manager
drwxr-xr-x  9 root  staff  512 Nov  8 08:19 tomcat-docs
javadevel@/var/tomcat/webapps # rm -r examples/ javadevel@/var/tomcat/webapps # ls
ROOT manager tomcat-docs
javadevel@/var/tomcat/webapps #

JAVADEVEL 11:13 AM 12/23/2002 Deny root login from ssh

javadevel@/var/tomcat/conf # vi /etc/ssh/sshd_config

Change PermitRootLogin to "no" and uncomment

Allow access to /var/tomcat/conf

javadevel@/var/tomcat/conf # chmod -R 664 /var/tomcat/conf/ javadevel@/var/tomcat/conf # ls -axl total 154

drw-rw-r--   2 cvs   cvsaccess    512 Nov 22 17:03 .
drwxr-xr-x  21 root  wheel       2048 Dec 13 17:08 ..
Confused? Frustrated?X
-rw-rw-r-- 1 root cvsaccess 7186 Nov 22 17:00 catalina-new.policy -rw-rw-r-- 1 cvs cvsaccess 6700 Nov 8 08:19 catalina.policy -rw-rw-r-- 1 cvs cvsaccess 11563 Nov 8 08:19 server-noexamples.xml.config -rw-rw-r-- 1 cvs cvsaccess 16140 Nov 8 08:19 server.xml
-rw-rw-r-- 1 cvs cvsaccess 440 Nov 8 08:19 tomcat-users.xml -rw-rw-r-- 1 cvs cvsaccess 30708 Nov 8 08:19 web.xml
Don't know where to look next?X

Remove AJP connector
javadevel@/var/tomcat/conf # vi server.xml

Comment out

<!--

    <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"

               port="8009" minProcessors="5" maxProcessors="75"
               acceptCount="10" debug="0"/>
    -->

JAVADEVEL 9:47 PM 12/30/2002 Reset permissions on /var/tomcat/conf so that server.xml file can be read

> -----Original Message-----
> From: Rick Barter [mailto:rvb@houston.rr.com] 
> Sent: Friday, March 07, 2003 6:11 PM
> To: Adam Getchell; OpenBSD
> Subject: RE: APOLOGY: Has anyone successfully installed and 
> run Java, J2EE, Tomcat, and Servlets?
> 
> 
> Adam,
> 
> Thanks for giving me some feedback.  At least I know that it 
> might not be all me.  :)
> 
> It seems, however, that you got further than I did by getting 
> Tomcat to run.  It appears to start, but I have found no 
> evidence of it and cannot connect to it (via lynx at 
> localhost:) on any ports I've tried.  You mentioned 
> that I should look at the output.  I'd love to.  What output 
> have you looked at and where?
> 
> I have Java (jdk or j2se sdk whatever Sun's calling it this 
> week) running, but have failed to get a servlet to compile.  
> I've installed the j2ee sdk (which has the servlet classes in 
> the j2ee.jar), but just can't get the darn thing to compile.  
> I'll post all information below. Any guidance you could give 
> would be greatly appreciated.
> 
> rvb
> 
> ==============================================================
> Here are my environment and path variables from my .profile: 
> ==============================================================
> 
> ######################################
> # Environment Variables for Java 
> ######################################
Call Pantek today for Open Source Technical Support at 1-877-546-8934 - 24/7/365X
> JAVA_HOME=/usr/local/jdk1.3.1-linux > JAVA_BIN=/usr/local/jdk1.3.1-linux/bin > J2EE_HOME=/usr/local/j2sdkee1.3.1 J2EE_BIN=/usr/local/j2sdkee1.3.1/bin > ANT_HOME=/usr/local/bin > CATALINA_HOME=/usr/local/jakarta-tomcat-4.1.18-LE-jdk14 > > CLASSPATH=$JAVA_HOME/src.jar:$J2EE_HOME/lib/j2ee.jar > > > PATH=$HOME:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin > PATH=$PATH:$JAVA_HOME:$JAVA_BIN:J2EE_HOME:J2EE_BIN:$ANT_HOME:$CATALINA > _HOME > PATH=$PATH:/usr/local/sbin:/usr/games > > export PATH HOME TERM JAVA_HOME JAVA_BIN CATALINA_HOME > > ============================================================== > Here is the code for my very basic servlet: > ============================================================== > > import javax.servlet.*; > import javax.servlet.http.*; > > public class test extends HttpServlet { > // do nothing; > } > > ============================================================== > Here is the output from the compiler: > ============================================================== > > import javax.servlet.*; > ^ > test.java:2: package javax.servlet.http does not exist > import javax.servlet.http.*; > ^ > test.java:4: cannot resolve symbol > symbol : class HttpServlet > location: class test > public class test extends HttpServlet {s the output while > trying to compile the servlet: > > > -----Original Message----- > > From: Adam Getchell [mailto:AdamG@hrrm.ucdavis.edu] > > Sent: Friday, March 07, 2003 5:39 PM > > To: 'Rick Barter'; OpenBSD > > Subject: RE: APOLOGY: Has anyone successfully installed > > and run Java, > > J2EE, Tomcat, and Servlets? > > > > > > Rick, > > > > Actually, Java/Tomcat hasn't been smooth sailing for me > > either, but I've
Do you need help?X
> > gotten it to work in our development environment, and > > haven't pored through > > all of the documentation sufficiently to warrant asking > > a well-formed > > question. > > > > The biggest gotcha I ran into installing Tomcat from > > ports was the lack of > > the /var/tomcat/temp file creation, which made our JDBC > > crash and burn. > > Hint: look at the output, it tells you what's going > > wrong ;-) I posted this > > issue to ports@/cmgruber already, he's very helpful. > > Then there's the > > (probably typical) current Java problem of eating memory > > and threads until > > the servlet locks up; but I can't tell if that's from > > code, Tomcat > > configuration, wrong HotSpot settings, etc. > > > > If I could run against JDK 1.2.2 I'd consider using the > > native JVM, although > > I think there's progress being made for a native 1.3.0 > > version. (The > > openbsd-java@codemonkey.net resources says the current > > native 1.4 JVM > > immediately consumes all CPU resources). And of course, > > another part of the > > problem seems to be Sun's JVM license. > > > > If I got Java solidly nailed on OpenBSD, I could > > probably migrate all of our > > applications servers. And then tackle heimdal kerberos V > > and AFS and slowly > > replace our infrastructure (especially looking at buying > > Hammer's wrt Theo's > > development). > > > > OpenBSD seems to be the right tool for a large number of jobs ... > > > > Anyways, > > > > --Adam > > > >
Received on Fri Mar 7 21:27:33 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:33:29 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library