project goals

2001-08-19 Thread Mark Castillo

Hi all,

Ok. After reading through some of the sources some questions came to mind.
What are some of the specific goals of the project regarding robustness,
performance, and security? At what point can we say that it is robust
enough? fast enough? secure enough?

Are there some requirements that the server should be able to run for weeks
without crashing? Throughput/capacity goals? Is Tomcat meant to be used by
web hosting services and be able to host many servlet applications by many
customers in a safe manner? Banking applications?

--
Mark Castillo
[EMAIL PROTECTED]
http://www.webFreak.com




Re: project goals

2001-08-19 Thread Justin Erenkrantz

On Sun, Aug 19, 2001 at 11:16:52AM -0700, Mark Castillo wrote:
 Hi all,
 
 Ok. After reading through some of the sources some questions came to mind.
 What are some of the specific goals of the project regarding robustness,
 performance, and security? At what point can we say that it is robust
 enough? fast enough? secure enough?

[ Take these $.02 from someone who isn't even a Tomcat committer.  These
  are my thoughts on your question.  PMCers may have defined goals. ]

Typically, Apache projects follow the goal of correctness first,
performance second.  Since Tomcat is the reference implementation of 
Servlets/JSP, it should focus on implementing all aspects of the spec
correctly.  I believe that if the implementation is correct (provided
you have a solid spec - which I believe is the case here), it goes a 
long way towards providing robustness and security.

You, as the user (or auditor), must place your own judgments on whether
Tomcat is robust enough, fast enough, or even secure enough.  We do not
know your goals.  However, I believe that part of the beauty of Open 
Source is that if it doesn't meet your requirements, you can help out 
and contribute to the project so that it does meet your needs properly.  
That's why you have the source.  Enjoy.  -- justin




Re: CGI wrapper in Tomcat 4.0 b7

2001-08-19 Thread Christopher Cain

Quoting Mark Castillo [EMAIL PROTECTED]:

 It is not a product that we are planning to have publicly available,
 although we develop it in a commercial release-like fasion. We do have
 the software running on about  100 customer sites now. The company I work
 for is Counterpane Internet Security (http://www.counterpane.com), and our
 software team builds the tools that provide our monitoring service.

You work for _Counterpane_?!? I am involved in open source Java cryptography 
projects, and cypto/security is where alot of my experience lies. I am, of 
course, quite familiar with Counterpane. ;-)

You work with Bruce and shit ... damn, what and honor THAT would be :)

It's a shame that the product won't be publicly available, because as a 
crypto/security nut, I would *love* to see what you Counterpane guys come up 
with on intrusion detection. I bet it rocks.

 I am the lead Java guy for the event detection engine that runs on the
 sentry intrusion detection box (no GUI, no human interface). We have plans
 to allow customers to see the status of their network via an https interface. 
 The interface will also allow them to chat live with a security analyst
 (which we have 24/7).

That's cool as hell. I've been working on the Tomcat standalone SSL stuff these 
days, in some part because my company is also in the process of developing a 
product (a cluster management tool) which will need it. If you should ever run 
across anything, or need something, in that department, let us know, and I'll 
see what I can do =)

 Right now we've integrated Acme server (and integrated https and login
 session support ourselves, which was a royal pain). So, I'm trying to
 figure out if we want to continue maintaining (fixing/rewriting?) the Acme
 server or scrap it and go to something else. We want code that is small enough
 to audit (for security), but functional enough to support servlets and
 secure sessions.

I think Tomcat can definitely accomodate you ;-)

- Christopher



Re: CGI wrapper in Tomcat 4.0 b7

2001-08-19 Thread Christopher Cain

Quoting Jan Labanowski [EMAIL PROTECTED]:

 Guys,
 You are getting religious about CGI... Religious is good, but I worry
 that it is a cult {:-)}. CGI was a good thing for last 6 years, and it is a
 still good thing sometimes.

CGI is a technically _horrible_ solution. The entire process model is 
fundamentally flawed. As far as scaling is concerned, it would be the 
functional equivalent of me synchronizing all access to my middle-tier objects.

 Note, we have tons of legacy perl software around,

IMNSHO, legacy code is the only legitimate reason anyone should run CGI 
anymore. This is 2001.

 and believe me, I can sometimes do more in one line of perl, than
 in a page of Java.

Don't even get me started on my personal feelings about Perl =)

rant target=Perl

It's a nice language, and it definitely has some areas where it really shines, 
but it is, after all, a niche language. It is very efficient at what it does, 
but it has been extended WAY beyond its design. This whole trip about Perl 
being the only language you'll ever need (I'm not quoting you, just your 
average Perl nut) ... I've heard that line with just about every new language 
that has ever come out, and Perl is much less suited to be my only language 
than almost all of the previously-touted do-all languages.

As far as the tired old I can do more in one line of Perl than a mountain of 
{pick a language} ... there's an old saying about Perl: Perl is the only 
language that looks the same before AND after encryption.

Perl can always seem to wash my car, feeds my cats, take my girlfriend out to 
dinner, and get me a beer, all in a single line of code. All I know is, while 
that may be true, if I ever have to end up maintaining one of these 1000-
character lines of code (that resemble what is left on my screen after my cat 
walks across the keyboard), I'm hunting down the guy that wrote it.

/rant

 Yes, CGI is an old ways, but it will be here for a long time, since there
 is so much stuff written in it.

That is true, and is the only reason I personally wouldn't like to see it 
removed from Tomcat altogether.

 I did not look carefully at regexp Java syntax, but can you have a
s/\b(\d+\.?\d*)C\b/int($1 * 1.8 +32) . F/e substitution in Java? 

Again with my cat on the keyboard ;-)

Anyway, as Mark pointed out, that's what jakarta-regexp is for.

 I personally think that web server without CGI is not a fully
 operational Web server. End of story... 

And I suppose that a computer with COBOL support libraries installed is not a 
fully-operational computer. Bottom line: CGI is a dead technology, and 
thankfully so. It was a nice hack in the beginning of time, but it outlived its 
usefulness three years ago, and that's being generous.

 This is GREAT that CGI is available in Tomcat.

That's highly debatable =)

 You should avoid it, but sometimes, if you have a week to move from Apache to
 Tomcat, you just cannot do it, and you need a way to move from CGI to
 servlets/jsp in an organized way.

Agreed. I would have to grudgingly agree that CGI support in Tomcat makes sense 
if only to support legacy code. Anyone writing new CGI programs to be run on a 
Servlet/JSP engine, however, is certifiable.

- Christopher



Re: CGI wrapper in Tomcat 4.0 b7

2001-08-19 Thread Mark Castillo


 You work for _Counterpane_?!? I am involved in open source Java
cryptography
 projects, and cypto/security is where alot of my experience lies. I am, of
 course, quite familiar with Counterpane. ;-)

 You work with Bruce and shit ... damn, what and honor THAT would be :)

Yeah, he's a cool guy. But, i'm not much of a crypto-freak. As you might
know already, we have enough crypto (for now). The bigger problems are in
people processes (sysadmin config), user habits (mail attachment viruses and
such), and coding habits (design and careless server programming).

I usually don't see Bruce on a day-to-day basis, as he works out of his home
in some other state. The other guys from Counterpane labs live in North
Carolina and Netherlands (Niels Ferguson, who recently cracked the Intel
streaming video encryption scheme. hehe). I work at the San Jose
headquarters.


 It's a shame that the product won't be publicly available, because as a
 crypto/security nut, I would *love* to see what you Counterpane guys come
up
 with on intrusion detection. I bet it rocks.

Hmmm. Maybe once the company goes belly up like the dot-coms in the area,
we'll release it as jakarta-sentry ;-)


  I am the lead Java guy for the event detection engine that runs on the
  sentry intrusion detection box (no GUI, no human interface). We have
plans
  to allow customers to see the status of their network via an https
interface.
  The interface will also allow them to chat live with a security analyst
  (which we have 24/7).

 That's cool as hell. I've been working on the Tomcat standalone SSL stuff
these
 days, in some part because my company is also in the process of developing
a
 product (a cluster management tool) which will need it. If you should ever
run
 across anything, or need something, in that department, let us know, and
I'll
 see what I can do =)

Cool. We'll talk more about that in non-list emails. What company is
developing your product?


  Right now we've integrated Acme server (and integrated https and login
  session support ourselves, which was a royal pain). So, I'm trying to
  figure out if we want to continue maintaining (fixing/rewriting?) the
Acme
  server or scrap it and go to something else. We want code that is small
enough
  to audit (for security), but functional enough to support servlets and
  secure sessions.

 I think Tomcat can definitely accomodate you ;-)

It think it will eventually, after all I only need it to run 2 servlets!


 - Christopher




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config JservConfig.java

2001-08-19 Thread larryi

larryi  01/08/19 15:47:04

  Modified:src/share/org/apache/tomcat/modules/config JservConfig.java
  Log:
  Port changes from ApacheConfig to make all contexts for a virtual host
  appear within a single Virtual Host block. For a root context in a virtual
  host, set DocumentRoot instead of a using Alias /  For a root context
  outside of a virtual host, supply an appropriate message about
  DocumentRoot.Can't override the one in httpd.conf.
  
  Revision  ChangesPath
  1.4   +87 -59
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/JservConfig.java
  
  Index: JservConfig.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/JservConfig.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JservConfig.java  2001/08/16 05:24:14 1.3
  +++ JservConfig.java  2001/08/19 22:47:04 1.4
  @@ -122,7 +122,7 @@
   @author Costin Manolache
   @author Larry Isaacs
   @author Mel Martinez
  -@version $Revision: 1.3 $ $Date: 2001/08/16 05:24:14 $
  +@version $Revision: 1.4 $ $Date: 2001/08/19 22:47:04 $
*/
   public class JservConfig  extends BaseInterceptor { 
   
  @@ -339,21 +339,48 @@
   // generate header
   generateJservHead(pw,cm);
   
  -// Set up contexts
  -// XXX deal with Virtual host configuration 
  -Enumeration  enum = cm.getContexts();
  -while (enum.hasMoreElements()) {
  +Hashtable vhosts = new Hashtable();
  +
  + // Set up contexts
  + // XXX deal with Virtual host configuration 
  + Enumeration  enum = cm.getContexts();
  + while (enum.hasMoreElements()) {
   Context context = (Context)enum.nextElement();
  -if( forwardAll )
  -generateStupidMappings( context, pw );
  -else
  -generateContextMappings( context, pw );
  +String host = context.getHost();
  +if( host == null ) {
  +if( forwardAll )
  +generateStupidMappings( context, pw );
  +else
  +generateContextMappings( context, pw );
  +} else {
  +Vector vhostContexts = (Vector)vhosts.get(host);
  +if ( vhostContexts == null ) {
  +vhostContexts = new Vector();
  +vhosts.put(host,vhostContexts);
  +}
  +vhostContexts.addElement(context);
  +}
  + }
  +
  +enum = vhosts.elements();
  +while( enum.hasMoreElements() ) {
  +Vector vhostContexts = (Vector)enum.nextElement();
  +for( int i = 0; i  vhostContexts.size(); i++ ) {
  +Context context = (Context)vhostContexts.elementAt(i);
  +if( i == 0 )
  +generateVhostHead( context, pw );
  +if( forwardAll )
  +generateStupidMappings( context, pw );
  +else
  +generateContextMappings( context, pw );
  +}
  +generateVhostTail( pw );
   }
   
   pw.close();
   } catch( Exception ex ) {
   Log loghelper = Log.getLog(tc_log, this);
  -loghelper.log(Error generating automatic apache configuration, ex);
  +loghelper.log(Error generating automatic apache mod_jserv 
configuration, ex);
   }
   }//end execute()
   
  @@ -392,6 +419,32 @@
   return true;
   }
   
  +private void generateVhostHead(Context context, PrintWriter pw) {
  + String ctxPath  = context.getPath();
  + String vhost = context.getHost();
  +
  +pw.println();
  +String vhostip = getVirtualHostAddress(vhost,
  +context.getHostAddress());
  +generateNameVirtualHost(pw, vhostip);
  +pw.println(VirtualHost + vhostip + );
  +pw.println(ServerName  + vhost );
  +Enumeration aliases=context.getHostAliases();
  +if( aliases.hasMoreElements() ) {
  +pw.print(ServerAlias  );
  +while( aliases.hasMoreElements() ) {
  +pw.print( (String)aliases.nextElement() +   );
  +}
  +pw.println();
  +}
  +indent=;
  +}
  +
  +private void generateVhostTail(PrintWriter pw) {
  +pw.println(/VirtualHost);
  +indent=;
  +}
  +
   //  Forward all mode 
   String indent=;
   
  @@ -409,33 +462,23 @@
   log(Ignoring root context in forward-all mode  );
  

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/server PoolTcpConnector.java

2001-08-19 Thread larryi

larryi  01/08/19 15:48:56

  Modified:src/share/org/apache/tomcat/modules/server
PoolTcpConnector.java
  Log:
  Add methods to allow detecting if Keystore and Keypass have been set.
  
  Revision  ChangesPath
  1.8   +8 -0  
jakarta-tomcat/src/share/org/apache/tomcat/modules/server/PoolTcpConnector.java
  
  Index: PoolTcpConnector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/PoolTcpConnector.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PoolTcpConnector.java 2001/08/14 03:23:19 1.7
  +++ PoolTcpConnector.java 2001/08/19 22:48:56 1.8
  @@ -229,6 +229,14 @@
attributes.put( keypass, k);
   }
   
  +public boolean isKeystoreSet() {
  +return (attributes.get(keystore) != null);
  +}
  +
  +public boolean isKeypassSet() {
  +return (attributes.get(keypass) != null);
  +}
  +
   public static final String SSL_CHECK=
javax.net.ssl.SSLServerSocketFactory;
   public static final String SSL_FACT=
  
  
  



cvs commit: jakarta-tomcat/src/shell tomcat.bat

2001-08-19 Thread larryi

larryi  01/08/19 15:52:51

  Modified:src/shell tomcat.bat
  Log:
  Added a TOMCAT_INSTALL environment variable to allow Tomcat to
  be started with conf and lib in separate locations.
  
  Updated to make env option function properly.
  
  Revision  ChangesPath
  1.36  +99 -29jakarta-tomcat/src/shell/tomcat.bat
  
  Index: tomcat.bat
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/shell/tomcat.bat,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- tomcat.bat2001/07/17 03:46:05 1.35
  +++ tomcat.bat2001/08/19 22:52:51 1.36
  @@ -4,37 +4,49 @@
   rem
   rem Environment Variable Prerequisites:
   rem
  -rem   TOMCAT_HOME  (Optional) May point at your Tomcat distribution
  -remdirectory.  If not present, the current working
  -remdirectory is assumed.
  -remNote: This batch file does not function properly
  -remif TOMCAT_HOME contains spaces.
  +rem   JAVA_HOME  Must point at your Java Development Kit installation.
   rem
  -rem   TOMCAT_OPTS  (Optional) Java runtime options used when the start,
  -remstop, or run command is executed
  +rem   TOMCAT_HOME(Optional) Should point to the directory containing
  +rem  Tomcat's conf and webapps directory.
  +rem  If not present, the current working directory is
  +rem  assumed.
  +rem  Note: This batch file does not function properly
  +rem  if TOMCAT_HOME contains spaces.
   rem
  -rem   CLASSPATH(Optional) This batch file will automatically add
  -remwhat Tomcat needs to the CLASSPATH.  This consists
  -remof TOMCAT_HOME\classes and all the jar files in
  -remTOMCAT_HOME\lib. This will include the jaxp.jar
  -remand parser.jar files from the JAXP Reference
  -remimplementation, and the tools.jar from the JDK.
  +rem   TOMCAT_INSTALL (Optional) Should point to the directory containing
  +rem  Tomcat's lib directory.
  +rem  If not present, the current working directory is
  +rem  assumed.  If this doesn't contain a lib directory,
  +rem  or if the lib directory doesn't contain tomcat.jar.
  +rem  TOMCAT_HOME is used.
   rem
  -rem   JAVA_HOMEMust point at your Java Development Kit installation.
  +rem   TOMCAT_OPTS(Optional) Java runtime options used when the start,
  +rem  stop, or run command is executed
   rem
  -rem $Id: tomcat.bat,v 1.35 2001/07/17 03:46:05 costin Exp $
  +rem   NOTE: Tomcat does not use your system's CLASSPATH setting.  Instead
  +rem Tomcat starts using only tomcat.jar on the classpath and builds
  +rem its classpath internally.  To add your classes to those of
  +rem Tomcat, refer to the Tomcat Users Guide (tomcat_ug.html found
  +rem in the doc directory.
  +rem
  +rem $Id: tomcat.bat,v 1.36 2001/08/19 22:52:51 larryi Exp $
   rem -
   
   
   rem - Save Environment Variables That May Change 
   
  -set _CP=%CP%
   set _TOMCAT_HOME=%TOMCAT_HOME%
  +set _TOMCAT_INSTALL=%TOMCAT_INSTALL%
   set _CLASSPATH=%CLASSPATH%
   
   rem - Internal Environment Vars used somewhere --
   
  -set TEST_JAR=lib\tomcat.jar
  +set _NULL=nul
  +set _CONTAINER=contai~1
  +if not %OS% == Windows_NT goto cont
  +set _NULL=
  +set _CONTAINER=container
  +:cont
   
   rem - Verify and Set Required Environment Variables -
   
  @@ -43,14 +55,25 @@
   goto cleanup
   :gotJavaHome
   
  -if not %TOMCAT_HOME% ==  goto gotTomcatHome
  +if not %TOMCAT_HOME% ==  goto gotTcHome
   set TOMCAT_HOME=.
  -:gotTomcatHome
  -if exist %TOMCAT_HOME%\%TEST_JAR% goto okTomcatHome
  -echo Unable to locate %TEST_JAR%, check the value of TOMCAT_HOME.
  +:gotTcHome
  +if exist %TOMCAT_HOME%\conf\%_NULL% goto okTcHome
  +echo %TOMCAT_HOME%\conf not found.
  +echo Unable to locate Tomcat's conf directory, check the value of TOMCAT_HOME.
  +goto cleanup
  +:okTcHome
  +
  +if not %TOMCAT_INSTALL% ==  goto gotTcInstall
  +set TOMCAT_INSTALL=.
  +if exist %TOMCAT_INSTALL%\lib\tomcat.jar goto okTcInstall
  +set TOMCAT_INSTALL=%TOMCAT_HOME%
  +:gotTcInstall
  +if exist %TOMCAT_INSTALL%\lib\tomcat.jar goto okTcInstall
  +echo %TOMCAT_INSTALL%\lib\tomcat.jar not found.
  +echo Unable to locate lib\tomcat.jar, check the value of TOMCAT_INSTALL.
   goto cleanup
  -:okTomcatHome
  -
  +:okTcInstall
   
   rem - Prepare Appropriate Java Execution Commands ---
   
  @@ -67,7 +90,7 @@
   
   :setClasspath
   
  -set CLASSPATH=%TOMCAT_HOME%\lib\tomcat.jar
  +set CLASSPATH=%TOMCAT_INSTALL%\lib\tomcat.jar
   
 

Tomcat startup script

2001-08-19 Thread Bojan Smojver

I guess most people would like to run Tomcat with server HotSpot if
there is one. Can we do something like this (just to save most people a
bit of configuration file editing, environment variable setting and the
like):

--- tomcat.sh   Wed Jul 18 07:24:49 2001
+++ /usr/local/tomcat/bin/tomcat.sh Sat Aug 18 17:56:40 2001
@@ -101,7 +101,11 @@

 if [ $JAVACMD =  ] ; then
# it may be defined in env - including flags!!
-   JAVACMD=$JAVA_HOME/bin/java
+   if [ -n `java -version 21 | grep HotSpot` ]; then
+   HOTSPOT=-server
+   fi
+
+   JAVACMD=$JAVA_HOME/bin/java $HOTSPOT
 fi

 ##  Prepare CLASSPATH 

Bojan



mod_jk 1.2.0 (CVS) + TC 3.3 B1

2001-08-19 Thread Bojan Smojver

After finally getting over the 'graceful restart' issues...

Is this for some reason a 'forbidden' combination? I've observed some
really strange stuff going on with this combo - parameters don't get
passed correctly, even session stuff tends to be screwed (ie. same
session data appears in two totally different browsers).

Is this something that's known not to work or did I just screw things
up? Things work just fine when mod_jk shipped with TC 3.3 B1 is used. Is
mod_jk 1.2.0 only to be used with the latest TC 3.3 CVS snapshot?

If this is not a known thing, I can send some more data...

Bojan



RE: Tomcat 3.3 contextAdmin issues

2001-08-19 Thread Paulo Gaspar

Answer inline:

 -Original Message-
 From: Costin Manolache [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, August 18, 2001 8:29 PM
 
 On 18 Aug 2001 19:56:33 +0200, Paulo Gaspar wrote:

 ...

  The first two things that are really confusing are:
  - the existence of 2 lines of very similar classes 
(e.g.: TomcatAdmin and ContextAdmin) in the tadm
package at webapps\admin\WEB-INF\classes\tadm;
 
 Well, TomcatAdmin is the first tag I wrote, and it did a lot of things.
 Too many, actually, so I started to split it. ContextAdmin will focus on
 context tasks, TomcatAdmin for generic tomcat.
 
 Also, TomcatAdmin declares the ContextManager scripting variable, and
 that's a problem to be fixed - you can have only one tadm:admin in a
 page right now. 
 
Yes, I was thinking the same about that variable. I had to go around that
to improvise a context restart (by using % { % and % } %).

Your explanation sure helps understanding what functionality is intended
for each tag. I can take a look at that too. It is easier for me to 
understand the taglibs than the rest of Tomcat.
=;o)
 
  - and the fact that restart.jsp does not work as 
expected producing duplicate entries in the list 
presented by contextList.jsp.
 
 That's a bug. I'll take a look, I wrote restart.jsp mostly as a test -
 to make sure all modules are cleaning up after themself ( i.e. you do
 restart.jsp few times and check the thread count, memory use, etc - it
 should stay constant ). If some contexts are not removed - that must be
 fixed ( please add a bug so I'll remember ).

I will try (adding the bug).
 
  Looking at org.apache.tomcat.core.ContextManager did 
  not help a lot since its comments are not very clear
  either, as is the case of its shutdown() method where
  comments make me doubt about how cleanup should be done.
 
 Ok, what's not clear :-) ? As you know, I'm not very good at docs, but
 if you ask specific questions I may be able to answer ( and fix the
 comments along the way ).  

No one seems to be very good at docs on Tomcat. =;o)

In this case I am talking about the comments in the method
org.apache.tomcat.core.ContextManager.shutdown()

In this method's source code there are 2 blocks of cleanup code that 
were commented out. The fact that they were not just removed and the 
nature of a comment:
  remove the modules ( XXX do we need that ? )
before one of those blocks makes me wonder how sure it is that they
are correct.


  This restart thing probably has some relation with the
  work Costin is doing on EmbededTomcat - maybe the 
  information missing is the same.
 
 It has some relation, in the sense EmbeddedTomcat must be able to
 restart ( and it's using the same calls as restart.jsp ).

Yes, the cleanup issues are related.


Specific questions, besides the above ContextManager.shutdown() 
issue:
 - Why is it possible to add 2 or more contexts with the same name
   and base path? It is a cleanup issue that this happens with the 
   restart.jsp code, but shouldn't this kind of duplication also 
   be prevented?
 - To make a hot restart, it looks like modules should be restarted
   too. Is this correct?
 - When using restart.jsp, previously removed contexts (using the
   admin pages) were not added back. Why?
 - Where are existing contexts detected and loaded? Is it on a 
   module? And if yes, then which?

As you see from the above questions, I still ignore a lot.


Thanks a lot for your attention on this, Costin.


Have fun,
Paulo Gaspar




Re: Tomcat startup script

2001-08-19 Thread Craig R. McClanahan

With this patch, you would not be able to run Tomcat *without* HotSpot as
long as it existed -- which would often be useful in a debugging
situation.

You can tell Tomcat to start with this variable, without modifying the
startup scripts, by setting TOMCAT_OPTS (Tomcat 3.x) or CATALINA_OPTS
(Tomcat 4.x) to the set of options you want to pass to the JVM.  For
instance, you can run with the -server switch and set max heap size to 128
megabytes with:

  CATALINA_OPTS=-server -Xmx=128m

or

  TOMCAT_OPTS=-server -Xmx=128m

Craig



On Mon, 20 Aug 2001, Bojan Smojver wrote:

 I guess most people would like to run Tomcat with server HotSpot if
 there is one. Can we do something like this (just to save most people a
 bit of configuration file editing, environment variable setting and the
 like):
 
 --- tomcat.sh   Wed Jul 18 07:24:49 2001
 +++ /usr/local/tomcat/bin/tomcat.sh Sat Aug 18 17:56:40 2001
 @@ -101,7 +101,11 @@
 
  if [ $JAVACMD =  ] ; then
 # it may be defined in env - including flags!!
 -   JAVACMD=$JAVA_HOME/bin/java
 +   if [ -n `java -version 21 | grep HotSpot` ]; then
 +   HOTSPOT=-server
 +   fi
 +
 +   JAVACMD=$JAVA_HOME/bin/java $HOTSPOT
  fi
 
  ##  Prepare CLASSPATH 
 
 Bojan
 




Re: Tomcat startup script

2001-08-19 Thread Bojan Smojver

Craig R. McClanahan wrote:
 
 With this patch, you would not be able to run Tomcat *without* HotSpot as
 long as it existed -- which would often be useful in a debugging
 situation.
 
 You can tell Tomcat to start with this variable, without modifying the
 startup scripts, by setting TOMCAT_OPTS (Tomcat 3.x) or CATALINA_OPTS
 (Tomcat 4.x) to the set of options you want to pass to the JVM.  For
 instance, you can run with the -server switch and set max heap size to 128
 megabytes with:
 
   CATALINA_OPTS=-server -Xmx=128m
 
 or
 
   TOMCAT_OPTS=-server -Xmx=128m
 
 Craig

OK. Sounds reasonable.

Bojan



Re: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/server PoolTcpConnector.java

2001-08-19 Thread Christopher Cain

Quoting [EMAIL PROTECTED]:

 larryi  01/08/19 15:48:56
 
   Modified:src/share/org/apache/tomcat/modules/server
 PoolTcpConnector.java
   Log:
   Add methods to allow detecting if Keystore and Keypass have been
 set.

=)



Re: Tomcat startup script

2001-08-19 Thread Christopher Cain

Quoting Bojan Smojver [EMAIL PROTECTED]:

 I guess most people would like to run Tomcat with server HotSpot if
 there is one. Can we do something like this (just to save most people
 a
 bit of configuration file editing, environment variable setting and
 the
 like):
 
 --- tomcat.sh   Wed Jul 18 07:24:49 2001
 +++ /usr/local/tomcat/bin/tomcat.sh Sat Aug 18 17:56:40 2001
 @@ -101,7 +101,11 @@
 
  if [ $JAVACMD =  ] ; then
 # it may be defined in env - including flags!!
 -   JAVACMD=$JAVA_HOME/bin/java
 +   if [ -n `java -version 21 | grep HotSpot` ]; then
 +   HOTSPOT=-server
 +   fi
 +
 +   JAVACMD=$JAVA_HOME/bin/java $HOTSPOT
  fi
 
  ##  Prepare CLASSPATH 
 
 Bojan

That's a cool idea, IMHO.

- Christopher



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets CGIServlet.java InvokerServlet.java ManagerServlet.java

2001-08-19 Thread craigmcc

craigmcc01/08/19 17:33:34

  Modified:catalina/src/conf web.xml
   catalina/src/share/org/apache/catalina Globals.java
   catalina/src/share/org/apache/catalina/servlets
CGIServlet.java InvokerServlet.java
ManagerServlet.java
  Log:
  Make it not possible to use the invoker service to execute CGIServlet
  when it is not mapped.  (Same prohibition applies to ManagerServlet).
  
  Remove default servlet-mapping for CGI servlet.  User who want to enable
  this, because they are porting existing legacy applications, must either
  uncomment the entry in $CATALINA_HOME/conf/web.xml to make CGI service
  available to all web apps, or add an explicit mapping to your own web.xml
  file.
  
  Revision  ChangesPath
  1.18  +6 -2  jakarta-tomcat-4.0/catalina/src/conf/web.xml
  
  Index: web.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/conf/web.xml,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- web.xml   2001/06/01 00:18:37 1.17
  +++ web.xml   2001/08/20 00:33:34 1.18
  @@ -106,7 +106,9 @@
  param-namecgiPathPrefix/param-name
  param-valueWEB-INF/cgi/param-value
/init-param
  +!-- Uncomment this if you want CGIServlet loaded at startup time
load-on-startup6/load-on-startup
  +--
  /servlet
   
 !-- The mapping for the default servlet --
  @@ -136,11 +138,13 @@
 /servlet-mapping
   
!-- The mapping for the CGI Gateway servlet --
  - !-- Comment this out if you do not want CGI Gateway service --
  + !-- Uncomment this if you want CGI Gateway service --
  + !--
  servlet-mapping
  servlet-namecgi/servlet-name
  -   url-pattern/cgi-bin/*/url-pattern
  +   url-pattern/cgi-bin/*/url-pattern
  /servlet-mapping
  + --
   
 !-- Set the default session timeout (in seconds) --
 session-config
  
  
  
  1.35  +13 -4 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java
  
  Index: Globals.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Globals.java  2001/08/10 05:40:43 1.34
  +++ Globals.java  2001/08/20 00:33:34 1.35
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v 
1.34 2001/08/10 05:40:43 craigmcc Exp $
  - * $Revision: 1.34 $
  - * $Date: 2001/08/10 05:40:43 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v 
1.35 2001/08/20 00:33:34 craigmcc Exp $
  + * $Revision: 1.35 $
  + * $Date: 2001/08/20 00:33:34 $
*
* 
*
  @@ -69,7 +69,7 @@
* Global constants that are applicable to multiple packages within Catalina.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.34 $ $Date: 2001/08/10 05:40:43 $
  + * @version $Revision: 1.35 $ $Date: 2001/08/20 00:33:34 $
*/
   
   public final class Globals {
  @@ -156,6 +156,15 @@
*/
   public static final String ERROR_MESSAGE_ATTR =
   javax.servlet.error.message;
  +
  +
  +/**
  + * The request attribute under which the Invoker servlet will store
  + * the invoking servlet path, if it was used to execute a servlet
  + * indirectly instead of through a servlet mapping.
  + */
  +public static final String INVOKED_ATTR =
  +org.apache.ctalina.INVOKED;
   
   
   /**
  
  
  
  1.5   +22 -7 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
  
  Index: CGIServlet.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CGIServlet.java   2001/08/14 18:50:10 1.4
  +++ CGIServlet.java   2001/08/20 00:33:34 1.5
  @@ -1,6 +1,6 @@
   /*
  - * CGIServlet.java $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java,v
 1.4 2001/08/14 18:50:10 pier Exp $
  - * $Revision: 1.4 $, $Date: 2001/08/14 18:50:10 $
  + * CGIServlet.java $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java,v
 1.5 2001/08/20 00:33:34 craigmcc Exp $
  + * $Revision: 1.5 $, $Date: 2001/08/20 00:33:34 $
*
* 
*
  @@ -87,12 +87,14 @@
   import javax.servlet.ServletOutputStream;
   import javax.servlet.ServletContext;
   import 

cvs commit: jakarta-tomcat-4.0/tester/web/WEB-INF web.xml

2001-08-19 Thread craigmcc

craigmcc01/08/19 17:33:58

  Modified:tester/web/WEB-INF web.xml
  Log:
  Add an explicit mapping for the CGI servlet, since it is no longer
  available by default.
  
  Revision  ChangesPath
  1.47  +7 -0  jakarta-tomcat-4.0/tester/web/WEB-INF/web.xml
  
  Index: web.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/tester/web/WEB-INF/web.xml,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- web.xml   2001/08/15 23:44:24 1.46
  +++ web.xml   2001/08/20 00:33:58 1.47
  @@ -940,6 +940,13 @@
   
   !-- == Servlet Mappings == --
   
  +
  +!-- Map CGI Gateway Service for this Web App --
  +servlet-mapping
  +servlet-namecgi/servlet-name
  +url-pattern/cgi-bin/*/url-pattern
  +/servlet-mapping
  +
   servlet-mapping
   servlet-nameAggregate01/servlet-name
   url-pattern/Aggregate01/url-pattern
  
  
  



Re: Tomcat startup script

2001-08-19 Thread Christopher Cain

Quoting Christopher Cain [EMAIL PROTECTED]:

 That's a cool idea, IMHO.

With the option to not run HotSpot, as pointed out. Craig and Larry/Costin, if 
I wanted to add a small one-liner to a doc file pointing this out. I hadn't 
thought of it myself, and I'm not positive that I would have thought of using 
the *_OPTS variables to do it, so alot of other people might find it useful. 
Which doc file do you think it makes sense in? For 4.0, RUNNING.txt maybe? For 
3.3, README.txt maybe?

Props to Bojan ... it hadn't even occurred to me to set Tomcat to use HotSpot =)

- Christopher



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets CGIServlet.java

2001-08-19 Thread amyroh

amyroh  01/08/19 19:42:11

  Modified:catalina/src/share/org/apache/catalina/servlets
CGIServlet.java
  Log:
  Sets 404 not found when cgi script doesn't exist -- submitted by Pier P. Fumagalli.
  
  Revision  ChangesPath
  1.6   +8 -7  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
  
  Index: CGIServlet.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CGIServlet.java   2001/08/20 00:33:34 1.5
  +++ CGIServlet.java   2001/08/20 02:42:11 1.6
  @@ -1,6 +1,6 @@
   /*
  - * CGIServlet.java $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java,v
 1.5 2001/08/20 00:33:34 craigmcc Exp $
  - * $Revision: 1.5 $, $Date: 2001/08/20 00:33:34 $
  + * CGIServlet.java $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java,v
 1.6 2001/08/20 02:42:11 amyroh Exp $
  + * $Revision: 1.6 $, $Date: 2001/08/20 02:42:11 $
*
* 
*
  @@ -283,7 +283,7 @@
*
* @author Martin T Dengler [[EMAIL PROTECTED]]
* @author Amy Roh
  - * @version $Revision: 1.5 $, $Date: 2001/08/20 00:33:34 $
  + * @version $Revision: 1.6 $, $Date: 2001/08/20 02:42:11 $
* @since Tomcat 4.0
*
*/
  @@ -642,11 +642,12 @@
   try {
   ServletOutputStream out = res.getOutputStream();
   out.println(HTMLHEADTITLE$Name:  $/TITLE/HEAD);
  -out.println(BODY$Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java,v
 1.5 2001/08/20 00:33:34 craigmcc Exp $p);
  +out.println(BODY$Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java,v
 1.6 2001/08/20 02:42:11 amyroh Exp $p);
   
   if (cgiEnv.isValid()) {
   out.println(cgiEnv.toString());
   } else {
  +res.setStatus(404);
   out.println(H3);
   out.println(CGI script not found or not specified.);
   out.println(/H3);
  @@ -684,7 +685,7 @@
   
   /** For future testing use only; does nothing right now */
   public static void main(String[] args) {
  -System.out.println($Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java,v
 1.5 2001/08/20 00:33:34 craigmcc Exp $);
  +System.out.println($Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java,v
 1.6 2001/08/20 02:42:11 amyroh Exp $);
   }
   
   
  @@ -700,7 +701,7 @@
* /p
*
* @author   Martin Dengler [[EMAIL PROTECTED]]
  - * @version  $Revision: 1.5 $, $Date: 2001/08/20 00:33:34 $
  + * @version  $Revision: 1.6 $, $Date: 2001/08/20 02:42:11 $
* @sinceTomcat 4.0
*
*/
  @@ -1322,7 +1323,7 @@
* /p
*
* @authorMartin Dengler [[EMAIL PROTECTED]]
  - * @version   $Revision: 1.5 $, $Date: 2001/08/20 00:33:34 $
  + * @version   $Revision: 1.6 $, $Date: 2001/08/20 02:42:11 $
*/
   
   protected class CGIRunner {
  
  
  



System.err.println

2001-08-19 Thread Kenny Ma

I am using Tomcat 3.2.3/Redhat 7.1

I have a servlet program, the program line 1 is System.err.println(TEST)

when i run the servlet, the output goes into console

I want the err.println output to a file (/usr/local/apache/logs/error_log), 
what can I do ?
or how to config Tomcat ?


/* Kenny Ma
   [EMAIL PROTECTED] */