Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Taming the Elusive Tomcat

timothy posted more than 12 years ago | from the neutering-the-cat dept.

BSD 30

joeyslopp writes: "Finding documentation on an open source project such as FreeBSD is usually quite easy. In fact, the project relies heavily upon user support. However, tracking down a good article that illustrates how to setup a .jsp (java server pages) environment using Tomcat has been difficult. Devshed came close with their article Slapping Together A JSP Development Environment , but lacked specifics on JDK for FreeBSD -- their article was more specific to Linux. The studs in #freebsd on undernet enlightened me a bit more, but still I lacked concrete documenation. Where can one find descriptive help in setting up Tomcat for FreeBSD? Dun dun dun dun *cheesy superhero theme* Enter Victoria Chan's article seemingly tailor-made for my Tomcat woes. The article, also located here, actually appears on as well...imagine that :) Hopefully other newbies to FreeBSD will read this and shorten their search time for a good article on the setup of Tomcat."

Sorry! There are no comments related to the filter you selected.

*BSD: We Hardly Knew Ye (-1)

returnofthe_spork (552824) | more than 12 years ago | (#3564878)

After consulting with top IT industry pundits [] , it has become all too clear: *BSD is dying.

The project has faced numerous setbacks in recent years, leading to waning developer interest and participation, a user-base migrating to Linux, Windows XP and Mac OS X, and no financial support whatsoever.

How did it happen? Well, these were the main events. First, *BSD split into 3 incompatible projects - FreeBSD, which focused on 386 and 486 machines; NetBSD, which focused on little-used architectures like Sparc and PPC; and OpenBSD, which focused on minimal functionality and poor performance. This split divided the already-small community and served to set up bitter rivalries. Then, Linux came along and stole all of *BSD's press, funding, and much of it's thunder with its better performance, functionality and ease-of-use. As if that weren't enough, OS X later took nearly all of the desktop *BSD users. And finally, in what has all but spelled out the demise of *BSD, two core developers have quit the project. First, Jordan Hubbard quit *BSD to get an actual paying job at Apple [] . He made this move citing OS X's superiority, *BSD's imminent demise, and his inability to feed his family with the broken promises of an SMP-enabled kernel. Shortly after that, Michael Smith left [] , saying simply, "It's true, *BSD is dying."

Where does all this leave the IT industry at large? Fortunately, the IT world is now healthier than ever. The death of *BSD is simply natural selection at work, as companies leave the shoddily written *BSD behind and move ahead with Windows XP, Mac OS X, and Linux.


Re:*BSD: We Hardly Knew Ye (0)

Anonymous Coward | more than 12 years ago | (#3570538)

Funny, since Mac OS X is a BSD ;)

You should group all the OSes you mention under shoddily written, BTW. When will we move beyond them? (Well, we already have, but decided to re-descend into the dark ages for some reason; due to business...politics... who knows. oh well.).

*BSD is dying (-1)

returnofthe_spork (552824) | more than 12 years ago | (#3564886)

It is official; Netcraft confirms: *BSD is dying

One more crippling bombshell hit the already beleaguered *BSD community when IDC confirmed that *BSD market share has dropped yet again, now down to less than a fraction of 1 percent of all servers. Coming on the heels of a recent Netcraft survey which plainly states that *BSD has lost more market share, this news serves to reinforce what we've known all along. *BSD is collapsing in complete disarray, as fittingly exemplified by failing dead last [] in the recent Sys Admin comprehensive networking test.

You don't need to be a Kreskin [] to predict *BSD's future. The hand writing is on the wall: *BSD faces a bleak future. In fact there won't be any future at all for *BSD because *BSD is dying.Things are looking very bad for *BSD. As many of us are already aware, *BSD continues to lose market share. Red ink flows like a river of blood. FreeBSD is the most endangered of them all, having lost 93% of its core developers.

Let's keep to the facts and look at the numbers.

OpenBSD leader Theo states that there are 7000 users of OpenBSD. How many users of NetBSD are there? Let's see. The number of OpenBSD versus NetBSD posts on Usenet is roughly in ratio of 5 to 1. Therefore there are about 7000/5 = 1400 NetBSD users. BSD/OS posts on Usenet are about half of the volume of NetBSD posts. Therefore there are about 700 users of BSD/OS. A recent article put FreeBSD at about 80 percent of the *BSD market. Therefore there are (7000+1400+700)*4 = 36400 FreeBSD users. This is consistent with the number of FreeBSD Usenet posts.

Due to the troubles of Walnut Creek, abysmal sales and so on, FreeBSD went out of business and was taken over by BSDI who sell another troubled OS. Now BSDI is also dead, its corpse turned over to yet another charnel house.

All major surveys show that *BSD has steadily declined in market share. *BSD is very sick and its long term survival prospects are very dim. If *BSD is to survive at all it will be among OS dilettante dabblers. *BSD continues to decay. Nothing short of a miracle could save it at this point in time. For all practical purposes, *BSD is dead.

Fact: *BSD is dying

as a official operator of #java on efnet (0, Flamebait)

BoxedFlame (231097) | more than 12 years ago | (#3564909)

I can safely say that you should stay clear of Tomcat and go with a product that is usable in a production environment. The experienced staff of #java recommends resin ( or orion ( For more help, come to #java.

Re:as a official operator of #java on efnet (1)

sinserve (455889) | more than 12 years ago | (#3565053)

As the official operator of #ai, on openprojects,

I can safely say that you should stay clear of Lisp and go with a product that is usable in a production environment.
The experienced staff of #ai recommends Trivia, Eggdrop and Capncrunch.

Re:as a official operator of #java on efnet (2)

mrdlinux (132182) | more than 12 years ago | (#3570526)

Speaking of which, I find CMU Common Lisp w/IMHO to be a better web application environment than Tomcat or any crappy Java servlet-type thing. And it's easier to setup too, amazingly. I do not know how it would perform under extremely heavy loads though. Perhaps AllegroServe with Allegro CL would be better in that situation.

Re:as a official operator of #java on efnet (0)

Anonymous Coward | more than 12 years ago | (#3586196)

Why would cmucl perform poorly? Properly written lisp compiled by cmulisp (or _any_ decent lisp implementation) should be much, much faster than Perl, Python (this is confusing- the cmucl compiler is also called Python), Java, VB, etc. Of course to get that kind of performance you have to make sure that recursive functions are tail recursive, that you use efficient data types (as opposed to using assoc lists where hash tables are called for), and that you specify types. In fact cmucl can give FORTRAN a run for its money doing numerical work. I'm sure you (the OP) know all this, but I think a lot of people aren't aware that lisp can be as efficient as c if it's coded with efficiency in mind. It's just a lot easier to write inefficient lisp than it is to write inefficent c.

But web apps (that experience heavy load) aren't really about the efficiency of the code. They're about the efficiency of your caching scheme, your load balancing, the amount of thought that goes into your setup (where to cache database results, where to proxy, how to load balance, how to deal with with user tracking when you're load balancing across a number of machines). Highly optimized cmucl apps are likely to be much faster than you need them to be, unless you're doing on demand raytracing over the web. So you should probably not optimize them too heavily and keep some of the nice flexibility of unoptimized lisp :).

My question is this- given that lisp is a better language for web development than anything commonly used at this point, how can you get people to _consider_ using lisp on the web? It's not even on most web developers' radar. I think a lot of the reasons for it are the same old worse is better reasons (some of which are pretty valid). And (like the other Python's use of significant whitespace) the parentheses don't help :).

Re:as a official operator of #java on efnet (1)

mrdlinux (132182) | more than 12 years ago | (#3589952)

I was actually thinking of some of the issues with CMUCL MP but as you point out, load-balancing would solve that with little trouble.

I presume one wouldn't write lots of recursive functions when the iterative constructs can be used, either...

In my own web apps CMUCL's performance was much more than adequate but I'm pretty sure the server never has seen more than moderate usage.

What's the best way to get people to use CL for this? Use it yourself, and beat them at their own game. Maybe some Lisp-based tools for web developers? Get them out of the pointy-brackets syntax and into S-expressions =)

I bet CLIM would do pretty well for writing a web-page layout designer, for those who don't write by hand...

Re:as a official operator of #java on efnet (0)

Anonymous Coward | more than 12 years ago | (#3592250)

I agree with most of your points, but a couple of things:

1. There's no reason to avoid recursion _if_ it's convenient to make your functions tail-recursive. Tail-recursive constructs are translated to iterative constructs anyway. (Again, I'm sure you know this, but someone reading this might not).

2. Again, web app performance is rarely about how cpu intensive your code is. That's why languages like Perl, Python, Java are used for them. Using Apache 1.x with mod_perl, for instance, space is usually more important than time. And no matter what your platform, caching is usually key. Anyway, the point is that Common Lisp is in the performance class of assembler, c, fortran, etc., not that of Perl, Python, Java. Better to have cmucl on one processor than Java on four.

3. Yes, using it is one important step :). But I think you really hit the nail on the head when you talk about the availability of tools. I'm afraid that CL is dying for a lot of the same reasons that Smalltalk died. What's needed is a good cross-platform CL, released under a BSD style license, with good (cross-platform) built-in libraries and strong third-party tools (like a good servlet engine and templating kit). It seems to me that cmucl would be the best substrate available for something like this. Of course, given the complexity of the implementation (just building cmucl is painful), porting it to non-Unix platforms might be a significant challenge.

Anyway, I think that it would be nice if the Lisp community took a lesson from the failure of Smalltalk (not technical failure, but market penetration failure) and the success of systems like Java and Perl. Advocacy is crucial (and Paul Graham seems to be the only Lisper doing significant advocacy these days), and an unencumbered cross-platform implementation with significant library support is crucial. I think I may start working on some Common Lisp tools.

Re:as a official operator of #java on efnet (1)

mrdlinux (132182) | more than 12 years ago | (#3611251)

Common Lisp doesn't guarentee tail-call elision was my point =) It's just that all good compilers do it.

Are you aware of SBCL [] by any chance? It's a fork of CMUCL and while it's still very Unix-bound there's a lot of cleanup going on and development is quite active (so is CMUCL for that matter). Besides that there is OpenMCL, CLISP, and ECL all are being worked on, and even GCL might get its act together someday. You should visit CLiki [] and cCLan [] too, or stop by OPN #lisp. There are people out there making efforts, though they may not be as visible as someone like Paul Graham.

Re:as a official operator of #java on efnet (0)

Anonymous Coward | more than 12 years ago | (#3617628)

Yes, I know that the spec doesn't guarantee tail-call optimization. If you're writing libraries meant to be portable across _all_ CL implementations you should stay away from recursion unless you _know_ that in a given situation you're not going to recurse deeply enough to blow the stack. But you'll never be able to optimize that kind of code to the hilt anyway- the spec leaves too many things unknown, and many popular CL implementations don't quite conform to the spec anyway.

If you really need to optimize you're going to have to write to a certain implementation, or possibly a group of implementations. In the extreme case you're going to have to look at what machine code your app is compiling to, and fiddle. So assuming tail-call optimization seems reasonable to me- but then I like recursion.

I am aware of SBCL, and I particularly like the fact that it's easier to bootstrap than cmucl. I also like the fact that it's released under the MIT license. I know that a lot of work is going into various CL projects, and I didn't mean to sound as if I were belittling that work. It's important. But it's not advocacy, and that's really what I was talking about.

In the end it's really about priorities- widespread adoption isn't the main priority for a lot of people working on CL. Which is a position I understand, and respect. But for people who do have as a major priority the widespread adoption of CL I think it can't hurt to look at what has worked for languages which have gained a lot of mindshare, and what has happened to some really great languages that have been declining in mindshare- like Smalltalk.

Of course the best thing that can happen to a language (in terms of popularity) is a wealthy patron that really wants to push it for some reason- like Java. But other languages have managed to do pretty well without that- Python is a good example. And I think the key there is that there aren't a lot of decisions to be made- there is one main Python distribution, it's very cross-platform, it comes with a comprehensive standard library, and it's license is BSD-like. Plus it has pretty loud advocates.

Of course CL may just be too different from Algol-like languages to ever regain mainstream popularity, so the point may be moot :).

Re:as a official operator of #java on efnet (1)

capnjack41 (560306) | more than 12 years ago | (#3593718)

What's the best way to get people to use CL for this? Use it yourself, and beat them at their own game. Maybe some Lisp-based tools for web developers? Get them out of the pointy-brackets syntax and into S-expressions =)

Couldn't agree more. People just aren't into Lisp anymore. As far as the logic of a program goes, it's so much easier than an imperative language like Java, etc. I'm not familiar with web apps and lisp (I use Scheme, really) - does it play well with databases and such?

(define (add-stuff-to-shopping-cart new-stuff)
(cons old-stuff new-stuff) )

Ok, well that's not technically correct. But it looks easy, right? :)

Re:as a official operator of #java on efnet (0)

Anonymous Coward | more than 12 years ago | (#3596301)

If you're a Scheme programmer, you'll most likely be surprised at the scope of Clisp, and the various libraries people have created for it.There are a number of database libraries, bindings to X, etc.Cmucl has good facilities for interfacing with foreign libraries too, so you can usually build bindings to anything you need. For server-side work on Unix-like platforms, pretty much everything you _need_ is there, and there are also some nifty add-ons, like IMHO. But you might find yourself rolling your own more often than you would with a more widespread language.

There are two common approaches to doing server side programming in lisp. One is to use mod_lisp, which is a very simple method for communicating with a lisp process over sockets. The other is to use a lisp webserver for your lisp pages, and proxy from your main server. Cl-http has a lot of features, but the license is a bit ambiguous. There's also Araneida, which has a BSD-like license.

Check out for more information.

BTW, did you know that Yahoo Store (originally Viaweb) was written in Clisp?

Re:as a official operator of #java on efnet (2, Insightful)

Raskolnk (26414) | more than 12 years ago | (#3565062)

I agree for with the recs for resin and orion, however, I wouldn't stay away from tomcat. IMHO, its very useful for developers to develop in tomcat in diverse environments before moving to a higher performing production environment. That way they can focus on building a proper war format app that should be portable to Resin, Orion, iPlanet, etc. Because Tomcat is supposed to be the reference version, ideally everyone would at least have there app setup and working in it.

RTFM! (4, Informative)

Hard_Code (49548) | more than 12 years ago | (#3565770)

Christ, they're right here [] dammit. The docs are great, watchoo talkin' 'bout Willis...

If that's not enough, go grab the servlet spec from Sun. It's really not that hard.

Re:RTFM! (2)

josepha48 (13953) | more than 12 years ago | (#3566464)

This guy is a moron! I have tomcat running on both my Linux box AND my windows box. All it takes is reading the F****** manual as you say!

Step 1 get Java 1.3+ (1.4 better)

Step 2 get apache 1.3+

Step 3 get tomcat 4.0+ and mod_jk

Step 4 install all of the above.

Step 5 Create a file.

Step 6 Create a mod_jk.conf file or let tomcat do it for you. If you let tomcat create one for you copy it and use the copy not the one created as it may overwrite this file. There is a way to shut this on and off, but that is in the manual.

Step 7 Add a line in apache's httpd.conf file to include the mod_jk.conf file

Step 8 Edit the mod_jk.conf file to include your new jsp pages directory. This will require you setting up the directive as per apache documentation. Look in http.conf for examples.

Step 9 add the 'connectors'. There are the JkMount directives.

Step 10 start it all up and test it out. Pretty much worked for me.

WEB-INF/classes is where your .class files go and there is a place for glocal jars and global classes as well as private classes and private servlets etc.

Alternately youy could just get tomcat and java and run it without apache if all you are doing is jsp. It is really not that difficult and there is a whole web site dedicated to this. Its called try it.


brenfern (260941) | more than 12 years ago | (#3568293)

The question, though misworded, is about setting up Tomcat on FreeBSD which is nontrivial as the JDK is not 100% complete for this platform. As I understand it, many java applications need modification to get them running properly on FreeBSD, even though they may work perfectly well on Linux, Windows and Solaris.

Hopefully Sun will start to release official JDK/JREs for this platform very soon.


josepha48 (13953) | more than 12 years ago | (#3573561)

The question was not about setting up Java but Tomcat. If it was about Java then the person should not have asked "Where can one find descriptive help in setting up Tomcat for FreeBSD?" They should have asked "Where can one find descriptive help in setting up Java for FreeBSD so that they can run Tomcat?"

The title of the article was about Tomcat NOT Java.

Give me access to a FreeBSD box and then we'll talk. I only have NetBSD / Linux and Windows at the moment.

The steps above are generic. They apply to ALL platforms. If there is an inadequate jdk for FreeBSD then that is not my fault. Linux users got togeather at to release Java for Linux LONG before Sun supported it. Maybe FreeBSD people who are intereseted in a better port of java to Linux should talk to someone over there and maybe they can make a more generic jdk that will work better on FreeBSD.


josepha48 (13953) | more than 12 years ago | (#3573611)

Oh and I found a JDK for FreeBSD as well as a whole bunch of Java port. I think make install may be what he needs to do. 2-beta/pkg-descr

Re:RTFM? RTFQ - Learn to read (1)

brenfern (260941) | more than 12 years ago | (#3575032)

Who said that the question was about setting up Java? The issue is that though the JDK is available it is incomplete and there are hence issues running Tomcat.

Read what you are flaming before you flame!

Re:RTFM! (0)

Anonymous Coward | more than 12 years ago | (#3571210)

Before you flame a guy for being such a idiot why don't you try and setup the JDK on FreeBSD.

Trying to get the linux JDK (under linux emulation) or one or the third party JDK's to run without problems is not that easy as double clicking on setup.exe/jkd1_3.rpm.

Re:RTFM! (1)

FortKnox (169099) | more than 12 years ago | (#3572919)

I have to agree. With every environment out for jsp and such, tomcat is a dream to install and get running. If its learning how to write JSPs, the go get the o'reilly book. Sheesh

Hard Times for *BSD (0)

Anonymous Coward | more than 12 years ago | (#3569368)

Sure, we all know that *BSD is a failure, but why? Why did *BSD fail? Once you get past the fact that *BSD is fragmented between a myriad of incompatible kernels, there is the historical record of failure and of failed operating systems. *BSD experienced moderate success about 15 years ago in academic circles. Since then it has been in steady decline. We all knw *BSD keeps losing market share but why? Is it the problematic personalities of many of the key players? Or is it larger than their troubled personalities?

The record is clear on one thing: no operating system has ever come back from the grave. Efforts to resuscitate *BSD are one step away from spiritualists wishing to communicate with the dead. As the situation grows more desperate for the adherents of this doomed OS, the sorrow takes hold. An unremitting glom hangs like a death shroud over a once hopeful *BSD community. The hope is gone; a mournful nostalgia has settled in. Now is the end time for *BSD.

Starting Point (3, Informative)

Martin Spamer (244245) | more than 12 years ago | (#3570997)

You could using one of the free (as in beer) community editions of the IDE's. CE editions of JBuilder and Forte come pre-configured with TOMCAT.

Re:Starting Point (1)

rjha94 (265433) | more than 12 years ago | (#3593825)

however if you don;t have a > 256 MB RAM machine, don;t try to run tomcat etc automatically when forte starts. I believe default configuration of forte is hugely bloated. a better option would be to use netbeans ( that is much slimmer or turn off those modules from loading that you are not using in forte.

Jakarta (3, Informative)

Martin Spamer (244245) | more than 12 years ago | (#3571010)
do c/index.html cat-3.3-doc/in dex.html

jeez... install the port (0)

Anonymous Coward | more than 12 years ago | (#3572158)

# cd /usr/ports/www/jakarta-tomcat4

# make install clean

After a while it will have done everything for you. I expect that you already have java installed in your machine. If not, then before the above do the following:

# cd /usr/ports/emulators/linux_base

# make install clean

wait for it to finish

# linux (or, if using the current branch, "kldload linux)

# cd /usr/ports/java/linux-jdk13

# make install

Follow the instructions it provides to download the JDK; once downloaded to the correct location (/usr/ports/distfiles):

# make install clean

Now, install tomcat.

Always use the 4 branch of tomcat; the 3 branch is a piece of shit. 4 actually works well and is stable.

man tar? (2)

ahde (95143) | more than 12 years ago | (#3573706)

what else is needed?

Maybe 'cat README' or 'ls'

It's not a question... (1)

CyberDong (137370) | more than 12 years ago | (#3581961)

Who's moderating this?

These posts are not informative, they're almost all off-topic. The original post is not asking a question, it's pointing out an informative article that explains in detail how to download and compile the JDK (1.3!, not 1.2-beta) and required patches for FreeBSD, and then set up Tomcat to work there.

That fact that someone was able to download and copy some files on both Linux and Windows is pretty much irrelevant to the spirit of the post (Tomcat/FreeBSD How-To). Labelling such posts as informative when they provide no information that wasn't in Victoria Chan's article seems silly to me.

Is BSD dying? (-1)

egg troll (515396) | more than 12 years ago | (#3585344)

Could someone provide me with information regarding the overall general health of BSD?
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?