File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes This weeks giveaway Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "This weeks giveaway" Watch "This weeks giveaway" New topic
Author

This weeks giveaway

Kyle Willkomm
Ranch Hand

Joined: Sep 10, 2001
Posts: 44
Oh Heck, there are other large replies here...
Covalent FastStart 3.1 freshly installed
----------------------------------------
./covalent/servers/server-name/conf/httpsd.conf
1)
modify prefork.c tag to be
<IfModule prefork.c>
StartServers 5
MinSpareServers 55
#MinSpareServers 5
MaxSpareServers 250
#MaxSpareServers 10
MaxClients 256
#MaxClients 150
MaxRequestsPerChild 0
</IfModule>

2)
change Apache http request port if needed
Listen 8080
3)
modify Document Root and add matching <Directory> tag with location of ui install
DocumentRoot "/home/willkok/lnie"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/home/willkok/lnie">
</Directory>
4)
to <IfModule mod_jk.c> add these tags with the UI location
#Mount lnie
JkMount /lnie/*.jsp loadbalancer
JkMount /lnie/* loadbalancer
#
# The following line makes apache aware of the location of the /lnie context
#
Alias /lnie /home/willkok/covalent/lnie
<Directory "/home/willkok/covalent/lnie">
<IfModule covalent_usertrack.c>
EnableLocationTracking off
</IfModule>
</Directory>
#
# The following line prohibits users from directly accessing WEB-INF
#
<Directory "/home/willkok/covalent/lnie/WEB-INF/">
AllowOverride None
deny from all
</Directory>
in ./covalent/servers/server-name/conf/workers.properties
1)
change workers.list line to
worker.list=tomcat1,tomcat2,tomcat3,loadbalancer
2)
remove all worker.ajp13 lines
3)
add the following modifying ports as needed
worker.tomcat1.port=8019
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor=1
worker.tomcat2.port=8029
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=1
worker.tomcat3.port=8009
worker.tomcat3.host=localhost
worker.tomcat3.type=ajp13
worker.tomcat3.lbfactor=1
4)
uncomment this line
worker.loadbalancer.type=lb
5)
replace worker.loadbalancer line with
worker.loadbalancer.balanced_workers=tomcat1,tomcat2,tomcat3
copy ./covalent/servers/server-name/conf/server.xml to
./covalent/servers/server-name/conf/server1.xml
./covalent/servers/server-name/conf/server2.xml
./covalent/servers/server-name/conf/server3.xml
1)
in server1.xml modify the shutdown port setting to an open port
<Server port="8015" shutdown="SHUTDOWN" debug="0">
2)
modify the running port setting for an open port
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8019" minProcessors="15" maxProcessors="1500"
acceptCount="50" debug="0"/>

3)
add a jvmRoute to the engine tag
<Engine jvmRoute="tomcat1" name="Standalone" defaultHost="localhost" debug="0">

4)
add a context tag for the ui code location below the examples context tag
<Context path="/lnie" docBase="/home/willkok/lnie" />

5)
repeat steps for server2.xml and server3.xml changing port numbers to other values
and the jvmPath to "tomcat2" and "tomcat3" respectivly

copy ./covalent/servers/server-name/bin/tomcat_startup.sh to
./covalent/servers/server-name/bin/tomcat_startup1.sh
./covalent/servers/server-name/bin/tomcat_startup2.sh
./covalent/servers/server-name/bin/tomcat_startup3.sh

1)
in tomcat_startup1.sh
a. Replace all occurences of server.xml with server1.xml
b. Replace all occurences of jvm.stdout with jvm1.stdout
c. Replace all occurences of tomcat.pid with tomcat1.pid
2)
do the same for tomcat_startup2.sh and tomcat_startup3.sh
to start apache and tomcat's
./covalent/servers/server-name/bin/apache_startup.sh start
./covalent/servers/server-name/bin/tomcat_startup1.sh start
./covalent/servers/server-name/bin/tomcat_startup2.sh start
./covalent/servers/server-name/bin/tomcat_startup3.sh start
stop to stop
Mani Venkatesan
Ranch Hand

Joined: Sep 15, 2002
Posts: 64
Is this book about servlet applications or does it discuss the internal details of Apache implementation?


Mani<br /><a href="http://ideanimal.com" target="_blank" rel="nofollow">blog</a>
David Yutzy
tumbleweed and gunslinger
Ranch Hand

Joined: Jun 29, 2001
Posts: 192
Hello,
I've used Tomcat and Resin for quite some time and find it distressing that I have to restart Tomcat every time I change a class.
Is there a way around this so that Tomcat automatically compiles and/or reloads the class (liek Resin) when it detects a change?
I've read about a "reload" attribute and find that it does pickup the change, however, when you hit a servlet/JSP file that hits the changed code, Tomcat dies.
Am I missing something in the configuration?
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Kyle Willkomm:
Oh Heck, there are other large replies here...

Thanks a lot Willkomm, I would like to give a try soon.


Spritle Software Blogs
chanoch wiggers
Author
Ranch Hand

Joined: May 24, 2001
Posts: 245
Originally posted by Roger Garner:
Will this book teach an idiot like me or is there some expected expertice needed?

yes it should but it would be easier if you know a bit about java.


chanoch<p><a href="http://www.amazon.com/exec/obidos/ASIN/1861007736/" target="_blank" rel="nofollow">Author of Professional Apache Tomcat</a></p>
chanoch wiggers
Author
Ranch Hand

Joined: May 24, 2001
Posts: 245
Originally posted by subrav:
Is this book about servlet applications or does it discuss the internal details of Apache implementation?

its not about servlet apps and it only discusses the internals of apache in architectural detail so long as this helps you to administrate the server - the book is primarily about administrating tomcat
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
I've read about a "reload" attribute and find that it does pickup the change, however, when you hit a servlet/JSP file that hits the changed code, Tomcat dies.

Sometimes Tomcat dies when it sees bad server.xml.
Try this:
<Context path="/report" docBase="c:\mrc\webapps\report" debug="0"
reloadable="true" />


BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
One of the most annoying things about servlet development is that it is very time consuming.
Stop server, modify class file, run ant, start server.
One thing I noticed is that if you do not follow the dtd in web.xml, you will get "resource unavailable sc404 from TC." I am getting more comfortable with web.xml, so I can spot my error quickly, but still, it would be nice to have an error for this, such as a SAXParseException pointing to the line number in web.xml, displayed right in the browser.
Is there a way to find those errors through logging?
How can I use logging to streamline the development process?
Garrett


comp.lang.javascript FAQ: http://jibbering.com/faq/
Vivek Chopra
Author
Greenhorn

Joined: Sep 18, 2000
Posts: 14
The reloadable attribute is very useful while developing application. In a production environment, you would want to turn it off as it has a performance hit.
- Vivek

Originally posted by Bruce Jin:

Sometimes Tomcat dies when it sees bad server.xml.
Try this:
<Context path="/report" docBase="c:\mrc\webapps\report" debug="0"
reloadable="true" />


Vivek Chopra<br />Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0471753610/soapsimpleobject/" target="_blank" rel="nofollow">Professional Apache Tomcat 6</a>
Vivek Chopra
Author
Greenhorn

Joined: Sep 18, 2000
Posts: 14
I agree with you- and apparently so did the Tomcat 4.1 developers! The manager application in Tomcat 4.1 allows manager commands to be run from an ant script.
You can now use ant to build, install and then reload a web application. This allows for a very integrated develop-deploy-test cycle and is discussed in some length in the book. See the "Managing Applications with Ant" section in the sample chapter.
http://www.wrox.com/books/sample-chapters/SampleChapter_1861007736.pdf
The uses of ant in conjuntion with Tomcat is discussed in more detail in a later chapter in the book.
- Vivek
Originally posted by Garrett Smith:
One of the most annoying things about servlet development is that it is very time consuming.
Stop server, modify class file, run ant, start server.

Garrett
Ram Balasubramaniam
Greenhorn

Joined: Oct 19, 2001
Posts: 21
Hi
Have any one of you tried the connection pooling in Tomcat 4.1.12 and Oracle 8.1.7. I followed the JNDI How to tutorial in the Jakarta Apache site.
I am getting Unable to load driver ' null '
error .
Can any one suggest me any tips.
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401

[ October 31, 2002: Message edited by: Garrett Smith ]
Doug Wang
Ranch Hand

Joined: Oct 05, 2001
Posts: 445
Hi all,
I am wondering how Tomcat would support Web services development?


Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep
Sanjay Jadhav
Ranch Hand

Joined: Feb 21, 2002
Posts: 86
Tomacat 4.0.1 does not handle the combination of FORM-base authentication and a constraint
on the HTTP POST method for a resource correctly. It authenticates the user as expected but
call the doGet() method on the resource instead of doPost()
i.e. if you use the FORM-base auhentication and submit the FORM Tomcat calls doGet() method
This combination works well in the Weblogic Application Server.
I want to know more about this and how could this differences about security
i get the reply like call doPost from doGet it just like hook and crook.
van i adjust in configeration some way which we slove this prob or tell some other way.


Sanjay Jadhav<br />Sun Certified Programmer For Java 2 Platform
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Doug Wang:
Hi all,
I am wondering how Tomcat would support Web services development?

Web Services!. Apache provides implementation of SOAP through AXIS.
Axis can be easily configured to Tomcat by just adding a axis folder to tomcat webapps, for more information please visit http://xml.apache.org/axis/index.html
Regards
Balaji
 
jQuery in Action, 2nd edition
 
subject: This weeks giveaway
 
Similar Threads
SCJP
Placement in India- How to handle break in career
Problem while booting Win XP
Mouse for arthritis sufferers
Urgent......interview questions in jsp,servlets,javabeans?