still trying to get tomcat working

Marcin Cieslak saper at
Fri Feb 6 15:09:08 PST 2009


It is very difficult for me to understand your report. Could you please 
provide a real error messages being reported? "Burped messily and died" 
does not really describe the problem you are experiencing!

> I finally found a writeup on tomcat6 configuration which was new enough not to
> rely on Linux executeables.  Anyhow, early in that writeup, it's talking about
> using the jsvc java package.  I used a little script I wrote myself some years
> ago to scan all of the ports plists for any mention of "jsvc".  I found the
> tarball that's dropped into the tomcat6 bin/ subdir, but not a port to build it,
> did I miss an important port?  I tried to unpack it and build it, but when the
> jsvc's configure script realizes it's in FreeBSD-8.0 (I run current), it burped
> messily and died, guess it can't handle superior OS quality.

I *sense* this is the issue related to "config.guess" and "config.sub" 
files. Can you copy over the /usr/ports/Templates/config.guess and 
config.sub files to replace the files bundled with the application you 
are trying to configure?

In the real port Makefile those files got overwritten behind the scenes 
if you specify GNU_CONFIGURE=yes (see /usr/ports/Mk/ around 
line 3612 for details if you are interested)

Are you sure you really need jsvc for anything?

> I found what's described
> as a very vanilla "conf/server.xml" (one of tomcat6's config files) but it seems
> to want some minor modifications, and the fields aren't described, only given on
> example.... damn, I Hate things which only give one example, but no description,
> if your setup isn't precisely what the author's is, I can't figure out where to
> go with things.  All that instructions I've seen so far, they all fall in that
> category.

First things first. Are you successful in running a freshly built, plain 
tomcat 6.0 without any applications/patches/configuration file changes?

On my machine (7-STABLE as of Feb 1st, amd64) I just did:

% cd /usr/ports/www/tomcat6
% make


(among others)

Installation settings:
    Destination directory:    /usr/local/apache-tomcat6.0
    Location of JDK:          /usr/local/diablo-jdk1.5.0
    Location of Java port:    java/diablo-jdk15
    Running as (user/group):  www/www
    HTTP port:                8180
    Shutdown listener port:   8005
    AJP 1.3 connector port:   8009
    Logfile stdout:           /usr/local/apache-tomcat6.0/logs/stdout.log
    Logfile stderr:           /usr/local/apache-tomcat6.0/logs/stderr.log
===>  Applying FreeBSD patches for apache-tomcat-6.0.18
 >> Removing unneeded files... [ DONE ]
 >> Customizing server.xml... [ DONE ]
===>  Configuring for apache-tomcat-6.0.18

% sudo make install
  ===>  Installing for apache-tomcat-6.0.18
===>   apache-tomcat-6.0.18 depends on file: 
/usr/local/diablo-jdk1.5.0/bin/java - found
===>   Generating temporary packing list
===>  Checking if www/tomcat6 already installed
 >> Creating destination directory... [ DONE ]
 >> Copying files to destination directory...
         Installing local configuration file: 
         Installing local configuration file: 
         Installing local configuration file: 
         Installing local configuration file: 
         Installing local configuration file: 
         Installing local configuration file: 
         Installing local configuration file: 
  [ DONE ]
 >> Creating log files... [ DONE ]
 >> Creating symlink to tools.jar... [ DONE ]
 >> Fixing ownership settings... [ DONE ]
 >> Fixing permissions... [ DONE ]
Apache Tomcat 6.0.18 has been installed in /usr/local/apache-tomcat6.0.
===> Installing rc.d startup script(s)
===>   Registering installation for apache-tomcat-6.0.18

Since I prefer to use JDK6 on my machine I have added two lines to 


Then I did /usr/local/etc/rc.d/tomcat6 start

after a while, my /usr/local/apache-tomcat6.0/logs/stderr.log was empty 
and my /usr/local/apache-tomcat6.0/logs/stdout.log looked like this:

INFO: The APR based Apache Tomcat Native library which allows optimal 
performance in production environments was not found on the 
Feb 7, 2009 12:02:39 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8180
Feb 7, 2009 12:02:39 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1007 ms
Feb 7, 2009 12:02:39 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 7, 2009 12:02:39 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
Feb 7, 2009 12:02:41 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Feb 7, 2009 12:02:41 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Feb 7, 2009 12:02:41 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8180
Feb 7, 2009 12:02:41 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /
Feb 7, 2009 12:02:41 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/47  config=null
Feb 7, 2009 12:02:41 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1682 ms

netstat confirms that the server is listening on the TCP port:

%netstat -an | grep 8180
tcp46      0      0 *.8180                 *.*                    LISTEN

A browser connected to the http://localhost:8180/ displays a webpage 
that says, among others:

If you're seeing this page via a web browser, it means you've setup 
Tomcat successfully. Congratulations!

Are you able to get that far?

Only after _this_ one can jump into understanding and changing the 
server.xml file.

Once basic Tomcat setup works, the webpage


will give you a complete reference to the server.xml file.


More information about the freebsd-java mailing list