Configuring Tomcat5 and Apache2 with Virtual Hosts using mod_jk
|
Configuring Tomcat5 and Apache2 with Virtual Hosts using mod_jk Version 1.0 Author: C. Troy Popplewell Visit the Endorsoft.com forums at http://www.endorsoft.com/forums . Last edited: 02/10/2006 Overview This tutorial explains how I was able to setup a web server in order to support Java Server Pages (JSP) and Servlets using virtually hosted websites. Although this setup worked for this particular environment, I can make no guarantees that it will work for yours, but it should with some tweaking. I’ll explain later on. I have spent a lot of time gathering several resources in order to get this to work. Many portions of these resources have been deprecated and required a few workarounds. It is my intention that this tutorial will help anyone that has attempted to install such a system without success. If you find any inconsistencies within this tutorial, please notify me at the email address above. Outlook The ultimate goal is to provide instructions on how to incorporate JSP/Servlet support on the ISPConfig web hosting software. I felt it was necessary to provide this first segment separately for those that do not wish to use the ISPConfig web hosting control panel. System Details The system used in this tutorial has the following installed: Operating System: Debian Sarge (3.1) http://www.debian.org/ Webserver: Apache 2.0.54 http://www.apache.org/ JDK: JDK 5.0 http://java.sun.com/j2se/1.5.0/download.jsp Servlet Container: Tomcat http://tomcat.apache.org/ Tomcat Connector: Jakarta Tomcat Connector mod_jk (not mod_jk2) Debian Sarge (3.1) If you plan on utilizing ISPConfig to host your websites with Debian Sarge, I highly recommend the how-to provided by Falko Timme here: The Perfect Setup - Debian Sarge (3.1) which prepares your system to support ISPConfig. There are “Perfect Setup� tutorials for other distributions as well. Otherwise, you should be able to find many other resources on the internet for installing Debian. This tutorial is specifically based on configuring Apache and Tomcat to work on Debian using the mod_jk connector. Apache2 Since installing Apache is beyond the scope of this tutorial, I will assume that you already have Apache 2.0.x installed and running. If you need instructions on installing and configuring Apache 2.0.x please refer to the documentation at the Apache website. Again, you can also find instruction here: The Perfect Setup - Debian Sarge (3.1). Installing JDK (Java Development Kit) In order to run Tomcat, you will need to install JDK and set the JAVA_HOME environment variable to identify the location of the JDK environment on your system. I have chosen to use JDK 5.0.
/etc/profile is executed at startup and when a user logs into the system. In order to update the environment you will need to log out and log back in to the system.
Installing Tomcat In this section you will download and install Apache Tomcat 5.5.15. For this particular setup, there is no need to build the package from source, we will download the binary version.
This will save you from having to make changes to startup and shutdown scripts each time you upgrade Tomcat and if you so desire, it also allows you to keep several versions of Tomcat on your system and easily switch amongst them.
To shutdown the server, you will need to execute the following command. Feel free to try it, but for now we will leave Tomcat running.
|



Recent comments
1 day 3 hours ago
1 day 8 hours ago
1 day 9 hours ago
1 day 10 hours ago
1 day 12 hours ago
1 day 16 hours ago
1 day 17 hours ago
1 day 19 hours ago
2 days 8 hours ago
2 days 10 hours ago