This post originated from an RSS feed registered with Java Buzz
by Weiqi Gao.
Original Post: Tomcat 5 on Fedora Core 6: In Five Easy Steps
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Have you noticed anything different about this blog in the past 24 hours?
I moved it to my newly upgraded Fedora Core 6 workstation yesterday. And I'm happy to report that setting Tomcat up on a Fedora Core 6 is extremely easy. I'll outline the steps I took to set up a functional Tomcat 5 server:
Install FC6 and Apache Web Server
Stick the Fedora Core 6 DVD in and reboot. Then follow the instructions. I took all defaults where I can, including letting it "delete all Linux partitions" and automatically partition the disk. I choose to install "Web Server" and "Development Tools" when offered the chance. This installs the Apache Web Server 2.2.3 on the box.
Install Tomcat
Tomcat 5 is included in Fedora Core 6, but not installed by default. So I have to bring it in from the repository:
This installs Tomcat 5.5.17 and a lot of their dependencies onto the system.
Hook up Tomcat 5 with Apache Web Server
Since I don't want my users to have to type ":8080" all the time, I went ahead and hooked up Tomcat 5 to httpd. In the past, this step had been the most confusing. I remember spending days browsing through Tomcat's website trying to figure out which one of the three alternatives offered there is the one that worked. I still have the mod_jk.so that I compiled from CVS source somewhere on by backup CD-ROMS.
In Fedora Core 6, things are quite straightforward because the version of httpd included contains mod_proxy_ajp which allows httpd to talk to Tomcat 5 through the AJP protocol, which Tomcat 5 listens to on port 8009. To make the connection, I edited /etc/httpd/conf.d/proxy_ajp.conf so that it reads (excluding comments):
To have httpd and Tomcat 5 start automatically upon reboot, I went to the System->Administration->Services menuitem and enabled both the httpd and tomcat5 services.
Now I have a working Tomcat 5 server. It's webapps directory is at /usr/share/tomcat5/webapps.
Install Sun JDK
So far we have been using the default Java package that came with Fedora Core 6, which is a Free Software implementation of Java based on GNU Gcj, GNU Classpath, and the Eclipse compiler. To run the widest set of Java applications and servlets, I need to install the Sun JDK.
The best way of installing Sun JDK on Fedora Core 6 is to follow the JPackage.org method. I wrote an Introduction to JPackage.org 782 days ago. Things haven't changed much since then (except that now Fedora Core includes a bunch of Java packages, which makes my life easier).
To follow the JPackage.org method, I need to make sure that the following packages are installed: