wood burning stoves 2.0*
The moose likes Servlets and the fly likes Running Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Running Tomcat" Watch "Running Tomcat" New topic
Author

Running Tomcat

Mark Leong
Ranch Hand

Joined: Dec 11, 2000
Posts: 60
Instead of running Tomcat with Apache, has anybody had any experience running Tomcat as a standalone server? Can it handle significant amount of connections (like any commercial sites)?
Any sercurity issue that I should be aware of?
vaibhav punekar
Ranch Hand

Joined: Jan 20, 2001
Posts: 134
Hi Mark,
i m using Tomcat with Windows NT standalone server.I find tomcat very good in that its directory structure is well structured.First few days you wil find it bit tricky but once you are familiar with it,it is the most package based.Another thing is that you create your own we-application in which you put all your classes,thus avoiding mix-up of applications.
For secutity issues think you will have to go through "Server.xml" file and make the necessary changes As far as your application goes you need to make changes in "Web.xml" file.But be careful while creating the directory structure otherwise it will create a lot of mess and you will have to sweat a lot ot resolve the issues.
So then enjoy Tomcat.


VAIBHAV <BR>SCJP
Mark Leong
Ranch Hand

Joined: Dec 11, 2000
Posts: 60
Thanks, Vaibhav, for reply.
I intend to run Tomcat on Redhat 6.2 or later. I have managed to set up Tomcat on Win 9x and Redhat but they are mainly for development and therefore not subjected to high volume of traffic. Are you running Tomcat commercially or under production situation? Can you give me a reference website?
Thanks once again.
vaibhav punekar
Ranch Hand

Joined: Jan 20, 2001
Posts: 134
Hi,
I m using Tomcat for production purpose only.I ve not used it commersially as well as on Linux.But generally "server.properties " file allows you to set connection pooloing and all the stuff related to JDBC and pool management.I have used weblogic for it.But in Tomcat I think you can edit "Server.xml" file.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Running Tomcat on a production environment is not a good option, as Tomcat performance is quite poor. If serverload is low, it can cope quite well, but as the number of requests goes up, response times go down the drain.
This is especially true for fixed content, but the Java engine is also not one of the better ones.


42
Mark Leong
Ranch Hand

Joined: Dec 11, 2000
Posts: 60
Thanks guys.
Jeroen, when you say the number of connections go up, can you give me an indicative figure. To be frank, I am not expecting 100 hits per sec.
Sean MacLean
author
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
I wondered this myself and then I came across this faq reply at jguru
http://www.jguru.com/faq/view.jsp?EID=49745
It might be somewhat exaggerated but if the specs are even half that...

Sean
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

Sean:
One small caveat, I wanted to point out abt this post....
Solaris/Sparc servers.
This is very important, IMO. Because Apache in its documentation
says that its a reference implementation for Windows (not sure
of linux though). Apache is almost gaurenteed to handle
everything on UNIX.
Hopefully you agree.
My 2 cents.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Mark Leong
Ranch Hand

Joined: Dec 11, 2000
Posts: 60
Well I guess that settles it. I'll don't think I'll ever hit 100000 hits a day (< 2 hits per seconds).
Thanks guys.
BTW, anybody knows how to connect to PostgreSQL from a remote site? I could connect locally but was refused if try to connect from servlet serving from different machine. I believe there must be something I need to set at the config file.
vaibhav punekar
Ranch Hand

Joined: Jan 20, 2001
Posts: 134
Maybe you are still trying with localhost:8080.Try giving IP adderss of server m/c on which Tomcat is installed.Try giving dynamic path to your servlet/JSP.eg. ./../../ like this according to your directry structure,instead of "http://localhost:8080/appfolder/sth.jsp".If still does not work post your code.I hope this will help.
Mark Leong
Ranch Hand

Joined: Dec 11, 2000
Posts: 60
Thanks Vaibhav.
From the error message, I am very sure I connected to the db and was refused - the driver and connection url is therefore correct. I must configure PostgreSQL to accept connections from other machines.
Sean MacLean
author
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
Satya,
Your point is well taken. I turned a blind eye to the platform in question (mistakenly) because when I think Tomcat, I think Apache and then unix, since it is such a common setup.
Sean
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Running Tomcat