[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-developers] Installing Tomcat 4x on a Linux machine
- Subject: RE: [cobalt-developers] Installing Tomcat 4x on a Linux machine
- From: "Ben Ramsey" <ben@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri Aug 2 11:05:01 2002
- List-id: Discussion Forum for developers on Sun Cobalt Networks products <cobalt-developers.list.cobalt.com>
I've followed all of the instructions as written below, but I get this error
from the site I've set up to use JSPs:
Apache Tomcat/4.0.4 - HTTP Status 404 - /index.jsp
----------------------------------------------------------------------------
----
type Status report
message /index.jsp
description The requested resource (/index.jsp) is not available.
I know for a fact that index.jsp is there. I've tested plain HTML files,
and they work fine. I've tested my JSP page on other sites, and it won't
give me a Tomcat error--it just tries to download the file (which is the way
it should be because I've not set up those sites to use JSP).
So, I've concluded that Tomcat is working correctly with Apache, or else I
wouldn't get this error message on Apache's port.
Can you think of anything else that might cause this message to occur. Is
there a setting I've neglected to change or personalize in the server.xml
file or the httpd.conf file?
Thanks.
Ben Ramsey
Technical Director
EUREKA! Interactive, Inc.
770-642-0390
www.eureka-interactive.com
-----Original Message-----
From: cobalt-developers-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-developers-admin@xxxxxxxxxxxxxxx]On Behalf Of William L.
Thomson Jr.
Sent: Tuesday, July 23, 2002 10:01 PM
To: Cobalt Developers Group
Subject: [cobalt-developers] Installing Tomcat 4x on a Linux machine
Ok,
In brief there seems to be allot of people having problems with Tomcat
on a Raq/Cube or just Linux in General.
Here is a quick install guide.
First I tend to install Tomcat or any additional software like my jdk in
/opt
Like
/opt/jakarta-tomcat-version
/opt/jdk-version
Then I do a symlink to in the /opt dir
catalina -> jakarta-tomcat-version
jakarta-tomcat -> jakarta-tomcat-version
jdk -> /opt/jdk-version
jre -> /opt/jdk-version/jre
That way it's easy to upgrade tomcat and anything else a later date.
Then you need to make a file in /etc/profile.d called java.sh
In that file you will need something like the following
export PATH=$PATH:/opt/jdk/bin:/opt/jre/bin:/opt/
export JAVA_HOME=/opt/jdk
export JAVA_PATH=/opt/jdk
export CLASSPATH=/opt/jdk:/opt/jdk/lib:/opt/jre:/opt/jre/lib
export CATALINA_HOME=/opt/catalina
export CATALINA_OPTS=-Xmx640M // to set a limit on mem usage
export TOMCAT_HOME=/opt/jakarta-tomcat
export LD_LIBRARY_PATH=/opt/jre/lib/i386
The Classpath is optional in Tomcat 4.x for reason I will explain, but
it's good to at least add jdk and jre to the Classpath like above.
Now you will want to config Tomcat here is simple config, nothing more
nothing less is required. This is the server.xml file contents
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Service name="Tomcat-Apache">
<Connector debug="0"
acceptCount="10"
minProcessors="5"
maxProcessors="75"
port="8009"
className="org.apache.ajp.tomcat4.Ajp13Connector"/>
<Engine className="org.apache.catalina.connector.warp.WarpEngine"
name="Apache"
defaultHost="host.domain.com"
debug="0"
appBase="webapps">
<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="apache-" suffix=".log"
timestamp="true"/>
<Host name="host.domain.com" >
<Context path=""
docBase="/home/sites/home/web"
crossContext="true"
debug="0"
reloadable="false"
trusted="false" >
</Context>
</Host>
</Engine>
</Service>
</Server>
The last host one will be needed for any site that will use Tomcat.
You will also want to create a workers.properties file in the
jakarta-tomcat/conf dir that should contain the following
workers.tomcat_home=/opt/catalina
workers.java_home=/opt/jdk
ps=/
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=2
Also you should move the to the bin dir and do a
rm *.bat
To get rid of the windows batch files.
I also delete all files/folders in the webapps dir.
Now you will need to symbolic link my preferred way or place any needed
.jar files in the jakarta-tomcat/lib dir or the
jakarta-tomcat/common/lib.
As when you start Tomcat it will set it's own internal Classpath. That's
why you do not really have to export one for the system in the java.sh
file.
I then symbolically link the catalina.sh start up file to
/etc/rc.d/init.d
You will then want to place a link to start it at boot time, or do it in
Apache the Cobalt way, but I am not a fan of that.
So in /etc/rc.d/rc3.d I will place the standard app startup symlink
S73catalina.sh -> ../init.d/catalina.sh
Ok, now tomcat is working. You now need to dial in Apache. You will need
to make the mod_jk.so, or get the one out of the jdk-kit pkg. Or ask
someone to email it to you. :) They usually do not need to be compiled
for the specific Apache version as long as it is 1.3.x series. You will
need to place it in the same dir as the other modules. Which on Cobalt
machines is
/usr/lib/apache/
Now in the httpd.conf file you will need.
# Setup Tomcat
<Location ~ ".*/WEB-INF/">
AllowOverride None
deny from all
</Location>
<Location ~ ".*/META-INF/">
AllowOverride None
deny from all
</Location>
LoadModule jk_module modules/mod_jk.so
JkWorkersFile /opt/catalina/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel error
You could put the location stuff in a different conf file, but later
versions of Apache say to use one file for it all. So I put it in the
main one.
Then for each web site you put in the server.xml file you will need to
map it to Tomcat in the virtualhost portions
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
That's basically it. If you plan to use a security manager and etc. then
that is up to you. As you will have many questions about that. From here
consult the docs that come with Tomcat, or go to apache.org.
I will help out with questions but will not hold your hand through the
process for free. If you want to pay us, I will be more than happy to
hold your hand, or install it for you.
Of course when you are done restart/start tomcat, and then apache. I do
not recommend starting apache before Tomcat. But that is up to you.
I think I covered the most important stuff. So good luck, and Java on.
--
Sincerely,
William L. Thomson Jr.
Support Group
Obsidian-Studios Inc.
439 Amber Way
Petaluma, Ca. 94952
Phone 707.766.9509
Fax 707.766.8989
http://www.obsidian-studios.com