Apache Tomcat Slackware

R

rwfields

This messages is just to let folks know that it all works. Here is my
configuration:

Slackware 10.0 with the default java install. The default httpd is
NOT installed, as the connection between Tomcat and Apache is easiest
when you have the sources to look at.

httpd-2.0.50 (apache)
Works fine out of the box. Be sure to verify all steps before
moving to the next step. You should be serving content at this point.

jakarta-tomcat-5.0.25
Works fine out of the box. You should be serving JSPs at this
point on port 8080.

jakarta-tomcat-connectors-jk2-2.0.4-src
This one is trickier. All I want is the connector between Apache
and Tomcat. The documentation is not as intuitive as it might be. In
the jk/native2 directory, you want to follow the instructions in
BUILD.txt.

---

Now for the config:
Your httpd.conf should include the line:

LoadModule jk2_module /usr/local/apache2/modules/mod_jk2.so

Be sure to use the correct location for the module!

---

Make sure the workers2.properties is in your apache config directory.
I added the following lines to the bottom:

[uri:/servlets-examples/*]
[uri:/jsp-examples/*]
[uri:/tomcat-docs/*]
[uri:/webdav/*]

---

The tomcat server.xml is the important file when it comes to serving
java content. For whatever reason, the built in examples do not seem
to need to be added to this file. I haven't figured out why yet. For
custom applications, a very simplified server.xml should work:

<Server port="8005" shutdown="SHUTDOWN" debug="0">

<!-- Define the Tomcat Apache Service -->
<Service name="Tomcat-Apache">

<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
<Connector
port="8009" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="100000"
useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>

<Engine name="Apache" defaultHost="localhost" debug="0">

<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">

<!-- PUT YOUR IP ADDRESS HERE -->
<Alias>255.255.255.255</Alias>

<!-- PUT YOUR CUSTOM APPLICATION HERE -->
<Context path="/custom" docBase="custom" debug="0"
reloadable="true" crossContext="true" />

</Host>

</Engine>

</Service>

</Server>

---

Restarting apache and tomcat is critical when changes are made to the
configurations. Also be sure to watch your error_log and catalina.log
files for more information. Once you have your custom application up,
you should go back and make sure that apache and tomcat are running as
some user other than root. Performance tuning should also probably
happen in small steps. Good luck, and drop me a line if you have
problems.

There is one error that is safe to ignore in the catalina.log:
SEVERE: Error filterStart
SEVERE: Context startup failed due to previous errors
This error has to do with the built in balancer application. I have
no idea why this error occurs yet. If anyone has an idea, please let
me know. It kills the balancer application outright, but everything
else works like a charm.

You may also want to make startup scripts for these installs. Apache
comes with one. Tomcat uses the jsvc stuff. Both can be found in the
respective packages with instructions in the documentation.

Randall
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top