RE: Tomcat on Windows: advantages of running as a service?

2005-10-12 Thread Peter Crowther
 From: Tom Burke [mailto:[EMAIL PROTECTED] 
 Sent: 12 October 2005 11:18
 To: Tomcat Users List
 Subject: Tomcat on Windows: advantages of running as a service?
 
 I'm running Tomcat 5.0.28 on a Windows 2003 server, and I need to 
 automatically shut it down  restart it. One way is to control it via 
 shutdown.bat  startup.bat, and run these as scheduled tasks at (say) 
 3:30am and 3:31am. However, I've noticed that while shutdown.bat will 
 shut it down if it was previously started as a service, startup.bat 
 won't run it as a service, it starts it at a command prompt.

Why not use net stop servicename and net start servicename with the
name of the Tomcat service?

 My question is: does this matter? If I'm running on Windows are there 
 any advantages to running Tomcat as a service? Or disadvantages to 
 running from the command prompt?

If you run it as a service: you can ensure it restarts if the machine
reboots unexpectedly for any reason; you can take actions if the service
crashes; and you can run the service as a specified user fairly simply.
If you run from the command line, you have none of these options.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: manager outofmemory exception

2005-10-11 Thread Peter Crowther
 From: Enrique Rodriguez [mailto:[EMAIL PROTECTED] 
 What i don't understand is that I sometimes get OutOfMemoryException
 when i upload new aplitications to the tomcat using the manager.
 
 I Profiled my aplication and i don't have any memory issue.

Just to check: Did your profiling include looking at PermGen?

 Is this a manager bug? Why the Total Memory is never higger 
 than 128 MB but I get OutOfMemoryExceptions?

Java always loads classes into the permanent generation (PermGen) and
never (to my knowledge) reclaims that space, even when you unload
classes.  So you may be running out of PermGen space.  You may wish to
increase that.  A search on a Tomcat archive for 'Permgen' should give
you plenty more information!

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Why getting this error?

2005-10-03 Thread Peter Crowther
 From: Ritchie Gillam [mailto:[EMAIL PROTECTED] 
 java.lang.OutOfMemoryError: PermGen space

Although your Java virtual machine has enough memory allocated to it,
something (probably the number of classes being loaded, or the number of
times you're reloading the webapp) is causing the permanent generation
to fill up.  This holds class files, for example.  PermGen defaults to
64 Mbytes, no matter how much heap space is allocated to Java.

Increase the memory allocated to PermGen using eg. -XX:MaxPermSize=128m
to double it.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Why getting this error?

2005-10-03 Thread Peter Crowther
 From: Ritchie Gillam [mailto:[EMAIL PROTECTED] 
 Thanks Peter!  Can you provide an example please?   Is this 
 defined somewhere in the server.xml file?

You should be able to set JAVA_OPTS, either within
$CATALINA_HOME/bin/catalina (from memory - CHECK! - it's too long since
I had to configure Tomcat on UNIX) or from the command line before
starting Tomcat:

export JAVA_OPTS=-XX:MaxPermSize=128m

Put it in the same place as the options to set your heap size.  If you
aren't already setting the heap size by some means, my guess is that
that'll be the next out-of-memory error you get!

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[OT] RE: Installing Tomcat 5.5 on Fedora 4 via Yum

2005-09-30 Thread Peter Crowther
 From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
 I've never understood this fascination for fooling around 
 with 3rd-party
 packaged versions of Tomcat, rather than using the unadulterated
 originals directly from the Tomcat download site.  The 
 process couldn't
 be much simpler: download, unzip/untar, run.  What am I missing?

That some people trust packaged versions for their OS to install more
reliably than un-packaged versions, to have been compiled using a
consistent set of library versions, or otherwise believe them to have
been blessed by the OS maintainers.  In the case of Tomcat, I'm with
you; but that's the exception, as I know it's pure Java.  I would be
cautious of downloading an arbitrary compiled application and trying to
run it on an arbitrary Linux distro, simply because of the library
version problems that plague Linux as much as Windows.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Running Tomcat as Non-Root under Linux listen for port 80

2005-09-27 Thread Peter Crowther
 From: NoKideen [mailto:[EMAIL PROTECTED] 
 Subject: Running Tomcat as Non-Root under Linux listen for port 80
 
 is there anybody know how to do this ?

Use the port redirection facilities in Linux (the details vary depending
on your kernel, but ipchains or iptables is a good place to start if I
recall) to forward all requests that come in on port 80 to port 8080.
That way, Linux can run as a non-root user but still see requests
arriving on port 80.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Running Tomcat as Non-Root under Linux listen for port 80

2005-09-27 Thread Peter Crowther
 From: Peter Crowther 
 That way, Linux can run as a non-root user but still see requests
 arriving on port 80.

Sorry.  Brain fade.  Replace 'Linux' with 'Tomcat' in the above.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: starting Tomcat service

2005-09-23 Thread Peter Crowther
 From: Tuan Quan [mailto:[EMAIL PROTECTED] 
 But I want the script to run at boot time, in Windows.

You might wish to look at srvany
(http://support.microsoft.com/default.aspx/kb/q137890/).  This allows
you to start any process as a Windows service.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Registering my own protocol in Tomcat

2005-09-22 Thread Peter Crowther
 From: Robert Koberg [mailto:[EMAIL PROTECTED] 
  Is there a possibility to get tomcat working with my own ASCII based
  protocol (instead of HTTP).
[...]
 Check out:
 
 http://java.sun.com/developer/onlineTraining/protocolhandlers/

Different use of 'protocol' - that won't help the original poster,
unfortunately.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: an advice neede for use of encodeURL method...

2005-09-22 Thread Peter Crowther
 From: jonas skrebys [mailto:[EMAIL PROTECTED] 
 a href=% response.encodeURL [...]
 ^
I think you're missing an '=' here?  Should be %=function();% to write
the result of function to the output.  Without that, the encoded URL
will not be written to the output stream.  View the source of the page
in your browser - I suspect the link will be a href=.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Can the Tomcat authentication module use an ASP.NET security token?

2005-09-21 Thread Peter Crowther
 From: Tracy Spratt [mailto:[EMAIL PROTECTED] 
 Subject: Can the Tomcat authentication module use an ASP.NET 
 security token?
 
 I have a Tomcat app (MM Flex app) that is called from an asp.net
 application which is secured by forms (cookie-based) authentication.
 (NOT NTLM / Windows Integrated)
 
 I don't want the user to have to log in again.
 
 I have a programmatic solution in mind, but it is going to be
 comparitively ugly.  
 
 Any ideas?

You're going to have to use that programmatic solution.  Forms
authentication (by default) sets a session-id cookie, and the asp.net
worker process maintains state information such as login details
internally.  You can't even get to it via classic ASP on the same IIS.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Out of Memory on Jakarta Tomcat 5.0.19, jdk1.5.0_04

2005-09-20 Thread Peter Crowther
 From: NoKideen [mailto:[EMAIL PROTECTED] 
 usually I use String to collect output first and out.print() 
 those String
 example :
 String a=;
 a+=Test 1;
 a+=Test 2;
 // very long , and almost 1 page 
 
 out.println(a);
 
 can this cause out of memory problem ?

It won't help much - you'll build up String objects very quickly.  See
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringBuffer.html for
a better approach that won't leave so many string fragments lying
around, roughly:

StringBuffer a = new StringBuffer();
a.append(Test 1);
a.append(Test 2);
...
out.println(a.toString());

However, this will merely cause the GC to run more frequently; it won't
run you out of memory.  Something else is causing that.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Multiple Remote Debugging of TOMCAT

2005-09-14 Thread Peter Crowther
 From: rahul [mailto:[EMAIL PROTECTED] 
 We are three people working on three different application which
 are deployed on a single remote machine
 We all want to remotely debug our application. 
 
 Is it possible with one instance of tomcat? (I think no)

At the same time?  Not to my knowledge - JPDA expects a single remote
connection, I think.

 If not, then there is only one solution 
 which is running multiple instance of tomcat
 
 Can anyone tell me how to go with this

What OS?  I run up to five instances on this machine, and have examples
of startup files for Windows... Contact me off-list for copies if you
want them.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Storing a request

2005-09-13 Thread Peter Crowther
 From: Ajay Arjandas Daryanani [mailto:[EMAIL PROTECTED] 
 I'm developing a authorization filter for Tomcat 5; in some cases, if
 the user credentials are invalid, I have to save the original request,
 redirect the user to an external authentication engine, handle the
 response and then proceed with the original request. The problem is, I
 can't find a way to clone the request or create a new one.
 
 Any comments are welcome.

There was a similar thread a couple of months back.  The conclusion of
that thread was that you cannot clone the original or create a new
request, and that there are sound architectural reasons for this.
Instead, you'll have to do it the proper way - store the data you need
from the original request in some appropriate manner, then handle the
new request using that stored data when it comes in.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: compile precompile jsps at runtime

2005-09-06 Thread Peter Crowther
 From: Zachi Hazan [mailto:[EMAIL PROTECTED] 
 Subject: Re: compile precompile jsps at runtime
 
 So, how can I do it with tomcat not out of the box?

One approach would be to cheat!  Tomcat compiles the page when the page
is first invoked.  So, you could for example define a special parameter
as part of the query string (such as 'precompile=true') and modify the
code for each page so that if the parameter is found, the page does
nothing.  However, Tomcat has still compiled it.

Then all you need is some kind of script (using cURL or a similar tool)
that fetches each page and adds a '?precompile=true' suffix.  Deploy,
run the script, and all your pages are precompiled.

Low-tech, I agree, and I suspect others on the list will be able to come
up with a better approach.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Multiple IP addresses

2005-09-02 Thread Peter Crowther
 From: Barnett, Brian W. [mailto:[EMAIL PROTECTED] 
 I seem to remember when I was working with IIS some years 
 ago, I could map
 multiple IP addresses to one instance of IIS, i.e., IIS could service
 multiple web sites for me, each web site having it's own, 
 unique IP address.
 Is there a way to do this with Tomcat stand alone or is 
 Apache Web Server or
 IIS required?

Works fine with Tomcat.  Modify your server.xml to have multiple
Services, each with its own set of innards like Connectors and Hosts,
and each with its own appbase.  Then use

address=numeric.ip.address.required

in each of the connector attributes to force a bind to just that IP
address for that connector.

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/http.html for the
details on Connector.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Multiple IP addresses

2005-09-02 Thread Peter Crowther
 From: Fadil [mailto:[EMAIL PROTECTED] 
 I do not understand very well, if we did this configuration, 
 (with a new IP 
 for tomcat and one for IIS web app on the same server) :
 
 we don't have to specify port number for IIS or Tomcat ?

Each would bind to port 80, each on its own IP address on the Web
server.  Port 80 is the default port for HTTP, so none of your URLs
would need a ':8080' or similar suffix.

 Can we fix tomcat's with by default 80 ? this configuration 
 doesn't mess if we want to use ldap or ssl?

If you have a separate IP address for Tomcat from the one you are using
for IIS, then you can also bind any other ports you need for Tomcat on
that separate IP address.  So Tomcat's SSL would be on tomcat's IP
address:443, IIS's SSL on IIS's IP address:443.

 Is this kind of installation is best than only one ip, IIS on 
 80, tomcat on 8080 and isapi redirector 1.14 ?

That depends on your specific requirements, I cannot give a general
answer.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Multiple IP addresses

2005-09-02 Thread Peter Crowther
 From: Fadil [mailto:[EMAIL PROTECTED] 
 But it doesn't work...

What error are you getting, from what?

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Servlet lush problems via JK-1.2.14 and TC_5.0.28

2005-09-01 Thread Peter Crowther
 From: Zsolt [mailto:[EMAIL PROTECTED] 
 When I start a long running servlet I want to give the user 
 some feedback
 about the progress, thus I just print some characters to the 
 browser from
 the servlet. It works fine when I go directly tomcat but when 
 I go through
 apache and tomcat connector I see the characters in the 
 browser only when
 the servlet is ready (that might take 20-30 minutes).
[...]
 How can I force a flush via connector?

I don't think you can.

If the process is going to be running for that length of time, would it
make sense to delegate the processing to some other object?  Then the
page can return immediately, with some appropriate code that requests
the browser to refresh the page at an appropriate interval.  During a
refresh, you could poll the request's status and return an appropriate
message.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: using disks SATA against SCSI in tomcat 5.5.9 cluster servers

2005-08-26 Thread Peter Crowther
 From: Acácio Furtado Costa [mailto:[EMAIL PROTECTED] 
 In the specification of the disks I have doubts because the 
 new disks SATA has great performance and speed and with cost 
 comparative minor to the SCSI Disks.  
   
 Considering applications WEB, where the WAR files are loaded 
 in memory and having enough memory (2 Gbytes) so that there 
 is not use of virtual memory (windows XP), would there be 
 some advantage to use disks SCSI?  or can we wait for the 
 same performance considering disks sata 7200 rpm against 
 disks scsi of 7200 rpm?  
   
 Could anybody explain to myself this doubts?

You will only really be able to answer this by benchmarking your application 
and finding out how much of the time it spends accessing the disk.

SCSI disks and controllers typically have two other advantages over SATA disks 
and controllers: faster average seek times, and more write cache.  However, if 
the performance under SATA is good enough, then you will not want to spend 
the extra for SCSI.

I support a number of live applications deployed on servers using mirrored SATA 
disks, as they are good enough for the clients.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: playing outside the tomcat 4 classloaders sandbox

2005-08-23 Thread Peter Crowther
 From: Fabien Benoit [mailto:[EMAIL PROTECTED] 
 I'm using Tomcat (4.1) and Axis 1.2 to provide a web service interface
 to a classical 2-tier application. My problem is, I need to access the
 existing API of this application, a single jar located outside the
 tomcat install. Copying this jar inside tomcat commmon lib dir or
 webapp lib dir is not permitted.
 Since tomcat gets rid of the system classpath

... But you can put it back by modifying catalina.{bat,sh} depending on
platform, which will be more robust than relying on a classloader.  If
you have a constraint that you're *also* not allowed to touch the Tomcat
startup files, then I would feed back that the combination of these
constraints will make any eventual solution *less* robust rather than
the intention behind the constraints of making more robust systems.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Redirect to 443

2005-08-23 Thread Peter Crowther
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] 
 Is posible to force redirect to 443 when a non-ssl request is 
 received (without having a security-constraint )?

You could, for example, write a filter for your webapp that checked
whether the protocol was secure on an icoming request and responded with
a redirect if not.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Calculating required memory

2005-08-18 Thread Peter Crowther
 From: Oleg [mailto:[EMAIL PROTECTED] 
 Now regarding shared/lib directory I thought that every 
 application loads 
 its own copy of those libraries, but if its only one time 
 load and since all 
 my applications are identical copies (only data changes) I 
 might as well 
 move all my classes into shared, before I only had struts, 
 hibernate jars and so on

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/class-loader-howto.html
is the page you want.  They're loaded by the Shared classloader, of
which there is only one per Tomcat instance.

 That wouldnt create any thread safety issues would it?

Potentially yes (so test with Jmeter or similar), and it might also
cause some fun and games with multiple servlets if any perform
initialization assuming they're the only user of a particular library.
Imagine one servlet running for an extended period using a library, then
a second servlet starting and calling the initialization code of that
library... You get the idea.  A well-written library should ride this
out.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Calculating required memory

2005-08-17 Thread Peter Crowther
 From: Oleg [mailto:[EMAIL PROTECTED] 
 I am trying to approximate the amount of memory my server 
 will need running 
 tomcat. I understand that a lot depends on how the appication handles 
 resources, however at this point I am trying to figure out 
 what will be the 
 mimimum needed. In my case I have virtual hosting setup, with 
 all hosts 
 sharing the same libraries, so I have struts, hibernate,... 
 all sitting in 
 shared/lib directory of Tomcat. Would I be correct to 
 estimate that Tomcat 
 will atleast need
 
 n(number of users/applications) * mb(total size of shared/lib)

As Chuck has already pointed out, no (but I'm going to try a slightly
different angle on it :-) ).  Each class that is loaded from shared/lib
will be loaded by the Shared classloader, so you'll only have one copy
of the class in your JVM.  Jars are compressed, so the sizes of the
loaded classes will be larger than the bytes occupied on disk; but not
all of the classes from a jar will be loaded, so the sizes will probably
be smaller.  Note, however, that any classes in the webapp's WEB-INF/lib
*will* be loaded once per webapp.  If you have large numbers of
applications, you may want to put more common libraries in shared/lib,
and you may also wish to increase the size of the permanent generation
(PermGen) in the JVM's memory model as this is where the classes are
stored.

Your per-session and per-page data will dwarf the space required for
classes; and, as Chuck pointed out, the only way to find out these sizes
is to profile the app.  This will also make sure that you're not going
to fall foul of any other performance limits, such as CPU use or disk
bandwidth.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: 64 Bit Machines and Tomcat

2005-08-16 Thread Peter Crowther
 From: J R [mailto:[EMAIL PROTECTED] 
 Are there 64 bit counterparts?  If not, would the 32
 bit ones definitely work?

Assuming you have a Java virtual machine that runs on your system, the
Tomcat Java classes will run unchanged.  The 'virtual' in 'virtual
machine' means that compiled Java classes are insulated from the details
of the underlying machine - Tomcat runs unchanged on Windows, MacOS*,
and many flavours of UNIX.

For further reading, check out 'application virtual machine' at
http://en.wikipedia.org/wiki/Virtual_machine and
http://en.wikipedia.org/wiki/Java_virtual_machine

- Peter

* Although Tomcat 5.5 is a bit awkward until Sun release a Java 1.5
virtual machine for Mac.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: 64 Bit Machines and Tomcat

2005-08-16 Thread Peter Crowther
 From: J R [mailto:[EMAIL PROTECTED] 
 Thanks... I didn't realize that Tomcat was pure Java.

There's the odd shell script and batch file to assist; other than that,
it's pure Java.  Certainly there's nothing that needs a
platform-specific compiler before it'll run, just the JVM.

 Being tortured through several CS classes that use
 Java.. I am familiar with its platform capabilities.

Heh.  Oh well, I get the 'teaching grandmother to suck eggs' prize for
the week.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: anonymising Tomcat

2005-08-05 Thread Peter Crowther
 From: Paul Singleton [mailto:[EMAIL PROTECTED] 
 Is it possible to configure Tomcat (5.5.9) so that a
 moderately able hacker couldn't figure out what is
 serving up our web apps?

It's possible to add the 'server' attribute to the connector definition
for the HTTP connector; server=BogoMAX v0.1 testing should anonymise
the single most obvious piece of information, but pick your own string
so that when the hacker searches Google for the string they don't find
this post.  See
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for
details.

It's possible that a more able hacker could also gain information from
the usual range of specially-crafted invalid TCP packets [so use a
decent firewall in front of the app server that detects and drops
these], from traffic analysis of the way in which the app server returns
data in the case of buffered and unbuffered pages, and likely from other
techniques that I've not considered.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: 1 jakarta server + multiple ip's

2005-08-04 Thread Peter Crowther
 From: Justin Jaynes [mailto:[EMAIL PROTECTED] 
 I tried the solution you offered (below) about
 creating more than one service and using the
 address=xxx parameter in the Connectors tags.  It
 works great.

Glad to hear it.

 However, what do you mean in your
 disclaimer that it is from the documentation and is
 untested?  Did you mean to say NOT from the
 documentation?

I mean that I have not personally tested the solution, but have instead
read the documentation and have come up with that solution.  I would
expect the Tomcat development team to have tested the address attribute
and its consequences.

 And if it is untested, but it is
 working, are there any reasons not to use it in a
 production server?  Is it safe?

I'm the wrong person to answer that - not being on the Tomcat dev team
and not running such a site myself!  However, from my poking around the
innards of UNIX, Windows and Tomcat over the years:

- Binding a socket to a particular IP address rather than all the
addresses on a machine is stable and well-tested on Windows and all the
UNIX networking stacks I know;

- Java's socket interface appears stable under such conditions;

- I am aware of a few other sites running Tomcat for production use
under such conditions - not least to get multiple SSLs onto one Tomcat
instance.  I have seen no traffic on this list over the past year or so
that would indicate Tomcat is unstable under these conditions, but it is
undoubtedly a less common configuration than running Tomcat with a
single listening socket.

Sorry to weasel-word the answer, Justin; I'm trying to make clear the
limits of my own knowledge and where I'm relying on others for
information.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: 1 jakarta server + multiple ip's

2005-08-02 Thread Peter Crowther
 From: [EMAIL PROTECTED] 
 I'm configuring a tomcat-server and the server has multiple 
 ip's. I would like
 to setup virtual hosts based on the ip-address. I wouldn't 
 like running
 multiple servers.
 
 What I've done: I have setup aliases for the possible 
 dns-names of the second
 virtual host (the possible names for one of the ip's). I have 
 also added the ip
 itself to the aliases link.
 However, I don't know how tomcat filter based on these names. 
 The ip-alias seems
 to work, so I'm wondering what tomcat is comparing it with.

Try this.  Beware, this is from the documentation and is untested!
Based on my 5.0.28 installation.

In your server.xml for Tomcat, set up two different Services - copy and
paste the existing chunk of XML for the Service, its Engine (and the
bits inside that) and its Connectors.

Change the appBase of the second Host to the place you want the second
virtual host to find its files.

In the Connectors of each Service, add:

address=ip.of.virtual.host

near the port=port attribute.  THis should cause the Connector to bind
to that IP rather than every IP on the machine.

Hope this helps.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: tomcat base vs. home

2005-08-02 Thread Peter Crowther
 From: Sternbergh, Cornell [mailto:[EMAIL PROTECTED] 
 Is Tomcat home the place tomcat looks for its stuff and Tomcat base
 where it looks for applications?  And then where would the HTML/JSP
 pages go?

Not quite.  HOME is where the Tomcat binaries live.  BASE allows you to
set up an alternative structure of conf/logs/temp/webapps/work so that
you can host multiple Tomcats from the same set of binaries - I use this
to run several Tomcat 5.0.28s.  My batch file is as follows:

set CATALINA_HOME=C:\Progra~1\APACHE~2\TOMCAT~1.0
set CATALINA_BASE=c:\cattery\bodington2
cd %CATALINA_HOME%\bin
start catalina run

Under c:\cattery\bodington2 (one of my Tomcat installations) you'll find
conf, logs, temp, webapps and work, with conf/server.xml and so forth.
So possibly not quite what you want - there's more there than just the
applications.

You might want to investigate the appBase attribute in server.xml,
however.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: TC5.5.9 Linux - shutdown port 8005 not bound BUG?

2005-08-01 Thread Peter Crowther
 From: Darryl L. Miles [mailto:[EMAIL PROTECTED] 
 Subject: TC5.5.9 Linux - shutdown port 8005 not bound BUG?
 I've never had TC bind itself to 127.0.0.1:8005 to allow correct 
 shutdown to occur.

[...]

 $ netstat -tanp | grep 80
 tcp0  0 :::127.0.0.1:8009   
 :::*LISTEN  4621/jsvc.exec

There it is, on 8009 not 8005.

 Should I file this as a bug ?

Depends - have you changed your server.xml at all?

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: TC5.5.9 Linux - shutdown port 8005 not bound BUG?

2005-08-01 Thread Peter Crowther
 From: Darryl L. Miles [mailto:[EMAIL PROTECTED] 
 Sorry yes... 8009 is the apj13 port (was figuring you'd guess).

Doh.  My bad - I use Tomcat directly, not via a front-end, so missed
that one.  Sorry Darryl (and anyone reading this thread in the
archives).

 My apache is using it locally I have added 
 address=127.0.0.1 for ajp13 
 so its not exposed externally.

Makes sense.

I'll crawl back into my hole now.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problem Running Tomcat on Russian MS Windows

2005-07-29 Thread Peter Crowther
 From: CW Lee [mailto:[EMAIL PROTECTED] 
 1) Why doesn't Tomcat work on Russian MS Windows?
 2) Is there anything i can do for Tomcat to run on Russian MS Windows?
 2) Is there any other solution which allows me to run JSP off Russian
 MS Windows?

CW, have you successfully installed and run Tomcat on a
non-Russian-language Windows, so that you can tell that you have it
working on a non-Russian and failing on a Russian OS?  Or is this the
first time you have tried to run Tomcat, and you happen to be running it
on a Russian-language Windows?  The steps to debug the problem in the
two cases are very different.

We'll need some more information in order to be able to help you:

- Windows version (Windows for Workgroups? Windows 95? Windows XP?
Longhorn? Give us some help here!)

- Java version and whether it's a runtime environment (JRE) or
development environment (JDK)

- Tomcat version (should be a 3-digit number eg. 5.0.28, 5.5.10)

- A more detailed description of what doesn't work

At the moment, we have the equivalent of Why doesn't my car work, how
can I fix it or are there other cars that work? - we need more
information!

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: HTTP/1.1 GZIP compression and its impact on server

2005-07-29 Thread Peter Crowther
 From: Ronald Klop [mailto:[EMAIL PROTECTED] 
 Ethernet uses packets of 1500 bytes, this includes some 
 headers. So if your html is smaller than about 1400 bytes 
 your are sending the same number of packets over your network 
 with or without compression.

Not entirely true, as for Internet use intermediate routers may have
their own Maximum Transfer Unit (MTU), and TCP tries to guess the MTU,
usually starting at a segment size of 576 bytes of payload and moving up
or down on a per-connection basis.  Finally, gigabit and above Ethernet
allow frame bursts and may allow larger frame sizes.

Unless you have only Ethernet between your server and your clients, with
no wide-area network segments, it's unwise to assume a packet size.
Even if you only have Ethernet, different OSs handle the TCP segment
size differently.

 If the performance of your application depends 
 on these small things you have a very efficient application. 
 ;-) I think you can better spend some time profiling the rest 
 of the application to win in cpu speed.

Absolutely!

 Compressing images is useless.

Assuming they're already in a compressed format such as GIF, JPEG, PNG.
Uncompressed formats such as BMP would still benefit, but I wouldn't
expect most folks to be using them in an Internet app!

- Peter

PS: Beware, my knowledge of the innards of TCP/IP was current some years
ago, and some of the numbers may be off!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: tomcat not starting properly

2005-07-26 Thread Peter Crowther
 From: blackwater dev [mailto:[EMAIL PROTECTED] 
 I am having trouble starting tomcat.  It gets to a point then 
 just stops. 
 
 What am I doing wrong?
 
 [EMAIL PROTECTED] bin]# ./catalina.sh jpda run
 Using CATALINA_BASE:   /usr/tomcat
 Using CATALINA_HOME:   /usr/tomcat
 Using CATALINA_TMPDIR: /usr/tomcat/temp
 Using JRE_HOME:   /usr/java/jdk1.5.0_04
 Listening for transport dt_socket at address: 8000

You have JPDA debugging enabled?

 Jul 26, 2005 8:48:25 AM org.apache.coyote.http11.Http11Protocol init
 INFO: Initializing Coyote HTTP/1.1 on http-80
 Jul 26, 2005 8:48:25 AM org.apache.catalina.startup.Catalina load
 INFO: Initialization processed in 2932 ms
 Jul 26, 2005 8:48:26 AM org.apache.catalina.core.StandardService start
 INFO: Starting service Catalina
 Jul 26, 2005 8:48:26 AM org.apache.catalina.core.StandardEngine start
 INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
 Jul 26, 2005 8:48:26 AM org.apache.catalina.core.StandardHost start
 INFO: XML validation disabled
 Jul 26, 2005 8:48:32 AM org.apache.coyote.http11.Http11Protocol start
 INFO: Starting Coyote HTTP/1.1 on http-80

OK, there's port 80

 Jul 26, 2005 8:48:33 AM org.apache.jk.common.ChannelSocket init
 INFO: JK: ajp13 listening on /0.0.0.0:8009

There's its shutdown port

 Jul 26, 2005 8:48:33 AM org.apache.jk.server.JkMain start
 INFO: Jk running ID=0 time=0/179  config=null
 Jul 26, 2005 8:48:33 AM 
 org.apache.catalina.storeconfig.StoreLoader load
 INFO: Find registry server-registry.xml at classpath resource
 Jul 26, 2005 8:48:34 AM org.apache.catalina.startup.Catalina start
 INFO: Server startup in 8138 ms

... all looks OK to me.  It starts up and is waiting for you to connect
to eg. http://localhost:80.  What isn't happening that you would expect?

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Preprocessing JSP pages

2005-07-18 Thread Peter Crowther
 From: Edward Hibbert [mailto:[EMAIL PROTECTED] 
 Indeed, we don't want to have them permanently present in the 
 JSP at all (i.e. convert the pre-processing into a run-time 
 check), also for performance reasons.  That was the original 
 motivation for making this stuff pre-processed.

If you haven't benchmarked the effect on performance of leaving the
switches in the code, you might like to look at the log4j site, where
there are benchmarks on log4j.  It's illuminating.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Copying an HttpServletRequest

2005-07-15 Thread Peter Crowther
 From: cristi [mailto:[EMAIL PROTECTED] 
 Is there any way to make a copy of an object implementing
 the HttpServletRequest interface ?

Alter the Tomcat codebase to implement that copy facility, remembering
to check through the codebase for pieces that would break.  You would
then be maintaining your own version of Tomcat.  However, see below for
why this is not a good idea.

 I have thought that maybe using HttpServletRequestWrapper could
 solve my problem but I'm not sure since the API does not specify
 if a new copy of the object sent to the constructor is created
 or not.

It doesn't, and this probably wouldn't help you even if it did.  If the
object was a shallow copy, then many of its dependent objects would be
shared with the Request from which it was copied; this means that you
would probably lose some context when the original Request was recycled.
If the object was a deep copy, then it would have its own copy of all of
the relevant fields - its own session and so on.  So you would have to
experiment in order to copy exactly the correct fields to exactly the
correct depth - and then the next version of Tomcat might change
something that caused your approach to fail, so you would almost
certainly have to pick a version and stick with it.


Can you tell us what you are trying to achieve?  There is almost
certainly an alternative way of getting to the same end without having
to copy requests but, until you give us a bit more detail, we can't help
you.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Copying an HttpServletRequest

2005-07-15 Thread Peter Crowther
 From: cristi [mailto:[EMAIL PROTECTED] 
 The  requirement  of  making  a  copy  of  the  HttpServletRequest  is
 generated  by the fact  that the  former programmers  have used  (in a
 natural manner):
 
 1) the HttpServletRequest.setAttributes()  to  send data  to the  jsp
 pages  creating  the response.  ( Thesedata   is  the  servlet
 computation result).
 
 2) within  the jsp  pages creating the  result various methods  of the
 HttpServletRequest (other than 
 HttpServletRequest.getAttributes() )
 object are used to get information from the request object.

OK.  I agree, that's natural - if not a good design for future
requirements change.

 Now there  is the requirement that  in the second request  sent to the
 servlet we  have to  use the computation  result of the  first request
 (that   isthose   data   thatyou   could   findusing   the
 HttpServletRequest.getAttributes() applied to  the request object sent
 in the first request ) to create the final HTML page.

OK.  So there's been a requirement change for which the original
approach was not designed, and so somebody on the business side (an
internal or external client) has to find the effort and the budget to
make that change, or decide that the change is too expensive and not
make it.  Somebody on the technical side has to inform them of the
expected effort, and keep them informed if that changes.

 Let's supose now  that in the second request we have  a way of finding
 the computation  result of  the first request.  This is not  enough to
 satisfy the second request because in order to render the HTML page of
 the second request  we also need other information  which can be found
 in   therequest   objectsent   during   thefirst   request
 (e.g. HttpServletRequest.getParameter() );
 
 I hope that I was explicit enough.

You have been - many thanks.

 We  knew it from the start that  a solution exists (saving
 and using all  the data that we need between the requests
 but  this  is  not  an  easy  task  now  since we have to
 analyze - and  to write - a lot of code),  but since  all
 this  data can be found  in the request object sent to the
 servlet with the  first  request we thought that making a
 copy of  the request object should  be very easy

A suggestion for future projects: never presuppose that an external
piece of software will make your life easy.  Sounds cynical, I know.

 (and very natural at the same time).

Um.  Yes, until someone makes another change in the original pages that
breaks your code to pull out the data.  The approach is fast to code,
but fragile in the face of changes.

I suspect that, if you still want to follow this approach, about the
best you can do will be to create an alternative request implementation
that stores the fields you need, plus code to copy them out of the
original request into your alternative implementation.  Your alternative
only needs to store the minimum of data that you need for your
application - of course, this is fragile if further changes are made and
you realise more data should have been stored, and your developer
assumes that your partially-implemented class is actually complete.  You
can then store that alternative object; as you have implemented it, you
will know about its lifecycle.

If you do this, I think you're making your application more and more
fragile.  Instead of this, I would take the time at least to write a few
functions to retrieve your data - you could choose to simply pass a
parameter to decide which data source to use, or you could use (say) an
Adapter pattern to write an interface to the data, one implementation
that takes that from the current request, and one implementation that
takes it from your preserved data store.  You've then insulated yourself
from further changes.  It may be up to the development team to decide
how much insulation they want; I'll just note that most applications
change more, and more frequently, than the developers expect.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: What is allowed to do with a HttpServletRequest ?

2005-07-14 Thread Peter Crowther
 From: cristi [mailto:[EMAIL PROTECTED] 
 I have a web application where I need to use in a second request the
 HttpServletRequest object sent to the same servelet in the first
 request.
[...]
   session.setAttribute( FIRST_REQUEST_OBJECT, request );

Unsafe.  Servlet containers may re-use request objects between
invocations.  Can't remember for sure, but I think Tomcat does so.  So
your second request object may be identical to your first request
object.

 It seems that it is not safe to do so. What can I do to 
 handle this situation ?

As Guillaume said: copy the state you need from the first request into
the session, rather than storing the entire request.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 5.5 and SQL Server

2005-07-11 Thread Peter Crowther
 From: Anderson, M. Paul [mailto:[EMAIL PROTECTED] 
 I am running Tomcat 5.5 with SQL Server on a separate machine.

 I am getting the following error at random times:

 Java.lang.Exception: java.sql.SQLException: [Microsoft][SQLServer 2000
 Driver for JDBC]Connection rest by peer: socket write error.

Any antivirus on either machine?  Especially anything that might hook the 
network stack?
 
Anything in SQL Server's server log?
 
If you run the SQL Profiler and set up a trace that logs exceptions and 
warnings, do you see anything?
 
- Peter
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Tomcat 4.1.37 and 5.0.2?? differences

2005-07-08 Thread Peter Crowther
 From: Mark Benussi [mailto:[EMAIL PROTECTED] 
 Subject: Tomcat 4.1.37 and 5.0.2?? differences
 
 
 I am having to change my ISP and was wondering what the main 
 differences were with these two servers.

http://jakarta.apache.org/tomcat/index.html

5.0.x is servlet spec 2.4 / JSP 2.0, like 5.5.

 Are Servlet filters supported

Yes, on both, I believe.

 and more importantly what J2EE does it
 typically run on?

Sorry, don't understand the question?  If you mean J2SDK, I rather
suspect most providers will be on a 1.4.2_xx release - Tomcat 4.1 and
5.0 both run on that.  If you don't mean the SDK version, could you
clarify?

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Silent runtime replace of a class

2005-07-08 Thread Peter Crowther
 From: Gal Robert [mailto:[EMAIL PROTECTED] 
 Thanky you very much, for your long answer.

No problem.

 It seems, your theory is absolutely correct, I even found
 an article with detailed information about setting up a high 
 availability Tomcat; here it is:
 http://www.javaworld.com/javaworld/jw-12-2004/jw-1220-tomcat.html

Heh.  Thanks, that's now added to my bookmarks!

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: 2 apps

2005-07-07 Thread Peter Crowther
 From: Sergey Livanov [mailto:[EMAIL PROTECTED] 
 I have 2 applications. The first is to be allowed from 
 internet, the second
 is to enter data. Two apps are in the webapps. How can I 
 configure tomcat
 to make cms unvisible from outside.

At least:

1) Use a filter or valve to examine the IP address of the incoming
request, and reject it if the IP address is external to your
organisation.  Add this filter to your invisible app.  Tomcat provides
some valves to do this by default.

2) Define two separate Services in conf/server.xml, each with their own
Connectors, Engines and Hosts.  Ensure the Connectors are on different
ports - say 80 and 8080 - and give them each their own appBase.  Put
your external app in the public appbase, the internal app in the private
appbase.  Now you can prevent external people accessing your internal
app by preventing access to (say) port 8080 from outside your firewall.

No doubt there are other approaches.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Make webapp jars downloadable

2005-07-07 Thread Peter Crowther
 From: Andrea Aime [mailto:[EMAIL PROTECTED] 
 Now, the client and the web application share a lot of jars, 
 so I would like
 to make the jars in web-inf/lib downloadable, so that the web 
 start can access them.
 
 At the moment I've put the jars both in web-inf/lib and in the
 root, but this basically doubles the size of my application.
 This is not very nice since I have to upload it to a test 
 server on my ISP
 and the upload connection is not very fast (ADSL line).
 
 Any solution?

Tomcat explicitly prevents access from a client to any file under
WEB-INF; Tomcat also insists on picking up its jars from WEB-INF/lib,
and as far as I know it's not possible to change that.  My suggestion
would be to write a few lines of code that copy the jar files you need
from WEB-INF/lib to the root when the application starts up or when you
hit a particular page - that way, at least you only have to upload them
once.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Silent runtime replace of a class

2005-07-06 Thread Peter Crowther
 From: Gal Robert [mailto:[EMAIL PROTECTED] 
 Often happens, that we must correct a little error in business logic.
 In these cases we usually patch a class file, and replace it in the 
 application, then redeploy it.
  From your (and other) responses it seems, there's no correct way to
 do such a patch without redeploying the application.

Unfortunately, I agree.

 On the other hand, your idea about tomcat clustering, and redirecting 
 requests sounds quite interesting. I think, this would 
 satisfy the above
 requirement. Can you give me some more information about your 
 idea? Does it require a deep know-how?

Not really, but it requires that your application has a certain feature:
that users using the application are independent, or that they only
interact through a common back-end system that is not part of the
webapp.  A bulletin board is a reasonable example: users can post, and
the posts are stored in a common database.  Each user accesses posts
through the webapp.  It wouldn't matter if each user had their own
separate webapp accessing the posts; nothing would appear to change.
Many applications have this feature; yours may well.  By contrast, an
interactive chat system that uses (say) a Map in the context to know
who's online doesn't have this feature - if you separate it across two
servers, each would only see half the users.

The multiple-server, staged upgrade is a standard technique in
high-availability systems, where you want to have more than one of
everything for redundancy.  I'm adapting it a little here, to fulfil
your requirement of on-the-fly upgrades.  No doubt others on this list
can fill in more details.  I should add a disclaimer: I've done this
with credit-card processing systems, but not with Tomcat, so I'm
speaking from theory.  The above should be taken with a large pinch of
NaCl until someone corroborates it for Tomcat.  That said, search the
archives for this list, as I recall a couple of discussions from people
who had almost exactly this setup.

If you have n identical nodes and a way of shifting the load away from
one of them, you can produce an idle node - at which point you can
upgrade it to the new version.  This part requires no more than several
identical Tomcat (or other servlet container) instances.  For high
availability, you'd run them on different machines.  For high
flexibility and to allow upgrades (your situation), you could choose to
combine them onto one machine if you wished to take the reliability risk
and understood the performance characteristics of the system.  Often,
it's cheaper for the business to buy another pizza-box server and shove
it in the rack than it is to pay someone's time to investigate the
'cheaper' way of doing it!

The new part is that you need a front-end load balancer.  This can be
done in hardware (Cisco's mid- and high-end routers have this facility,
for example).  I strongly suspect it can also be done in software; I'd
be very surprised if nobody had written this into some combination of
Linux kernel and modules.  I don't know whether it can be done using an
Apache front-end and JK; I suspect someone on this list could enlighten
us.  The load balancer sits 'in front of' your n identical nodes and has
its own IP address, which is the IP address by which your users connect
to the application.  That load balancer then redirects requests to the
nodes according to its policy.  That policy needs to include 'sticky'
sessions: a set of requests from a given user will always be directed to
the same node.  If your organisation has no experience of setting one of
these up, you'd probably want to buy in the expertise.

Now, to upgrade a node (say node B of two nodes labelled A and B), you
change the load balancer's policy: existing sessions remain sticky, but
all new sessions go to node A.  Monitor the number of sessions on node
B; when it drops to zero, it's safe to upgrade B, restart it and test it
- you know that no users will come in and disturb your tests.  Then
change load balancer policy to send new sessions to node B, wait for all
the sessions on A to complete, and do the symmetrical upgrade on A.
Finally, set your load balancer policy back to even distribution if you
wish to use the redundancy in this system.

You can short-circuit the whole process if you don't want the
redundancy: the load balancer always directs traffic to one 'current'
node, and most of the time you have one 'spare' node.  To upgrade, make
the change on the 'spare' node and test, then change policy to make the
'spare' node receive all new sessions.  Once all the sessions have
finished on the old 'active' node, the roles reverse - you have a new
'active' node that's been upgraded, and the 'spare' running the prior
version of the software.

- Peter
--
Peter Crowther, Director, Melandra Limited
John Dalton House, 121 Deansgate, Manchester M3 2AB
t: +44 (0)161 828 8736  f: +44 (0)161 832 5683

RE: Silent runtime replace of a class

2005-07-05 Thread Peter Crowther
 From: Sriram N [mailto:[EMAIL PROTECTED] 
 --- Gal Robert [EMAIL PROTECTED] wrote:
  we have a new user requriement: to be able to modifiy the 
  application without affecting user work.

That's a very broad requirement, and may not be achievable in its full
form.  Does this mean that users must be able to continue working while
a new version is deployed, unaware that a new version is being deployed
under their feet, keeping all session context and so on?  If so, I think
you're onto a loser unless you can cluster your Tomcat instances - at
which point you can point all your users to one of your instances (call
it instance1) until there are none on instance2, upgrade instance2,
point new users to instance2 until there are none on instance1, upgrade
instance1, then go back to using both instances if you wish.

This requires other software or hardware to keep track of which user
sessions are using which instance.

 You'll could place the context.xml in either the conf 
 directory, or in the
 war's WEB-INF folder. Just ensure that the reloadable 
 attribute is set to true.

Note that reloading a webapp when you have made changes may not allow
the user to continue working - for example, if you've changed what's in
the session then they may get errors.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problem compiling JSPs with Tomcat as Windows Service

2005-07-04 Thread Peter Crowther
 From: Trevor Quinn [mailto:[EMAIL PROTECTED] 
 When I deploy a web application to a Windows 2K server 
 running Tomcat 5.0.28 and JDK 1.5, I see Unable to compile 
 JSP errors on every JSP page, but only when Tomcat is 
 running as a Windows service. When I run Tomcat from the 
 console window, all pages compile and display correctly.

Check file permissions on the files Tomcat is trying to access.  If you
think you might have problems in this area, filemon from
http://www.sysinternals.com is an invaluable debugging tool as it can
show you the file accesses (and the results) in realtime.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JVM in Tomcat

2005-07-01 Thread Peter Crowther
 From: Gulshan Babajee [mailto:[EMAIL PROTECTED] 
 Hi, Can anyone please tell me how could I verify that all my 
 applications running in tomcat are using the same JVM instance.

Try the following chain of reasoning:

1. Only one JVM instance can listen on any given port, such as 8080;

2. The ports for a given Tomcat are set in conf/server.xml;

3. All my Tomcat apps are available on one of the ports listed in my
only conf/server.xml;

4. Therefore all my Tomcat apps are running in one JVM instance.

This fails if you have more than one conf/server.xml - in which case,
your apps probably aren't running in the same JVM.  Also, issues such as
RMI, Web services and the like can confuse the issue, as your apps may
be making use of services provided by components running in other JVMs.
You'd have to check the details of each webapp to verify this.

That's my view - can anyone else confirm or deny?

- Peter
--
Peter Crowther, Director, Melandra Limited
John Dalton House, 121 Deansgate, Manchester M3 2AB
t: +44 (0)161 828 8736  f: +44 (0)161 832 5683

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Application Level Classpath Setting

2005-07-01 Thread Peter Crowther
 From: Srinivas Ivaturi [mailto:[EMAIL PROTECTED] 
 I forget to mention these are 3 rd party JARS which I cannot 
 put in the LIB. 

Cannot by licensing terms, because the app will no longer work if you
do, or what?

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Application Level Classpath Setting

2005-07-01 Thread Peter Crowther
 From: Srinivas Ivaturi [mailto:[EMAIL PROTECTED] 
 It is not that it wont work , It is by design. 

OK.  So, to summarise:

- You have a set of jars that is too large to name on the classpath in
Windows;

- The jars are required for one webapp only, not for the whole of Tomcat
(so one could argue that a classpath-based solution is a poor solution
as it might interfere with other webapps deployed in the same
container);

- The jars would work if placed in the webapp's lib directory.

You don't wish to place the jars into the webapp's lib directory by
design, which prevents a simple solution that would apparently work.
If it doesn't work, I can't help much more unless you can give some more
information about why it doesn't work or why you'd prefer not to do
this.

I'm not aware of another solution that would work without amending the
Tomcat source and recompiling.  I don't think you can extend the
classpath in conf/server.xml or in web.xml (although I could be wrong;
this is from a fairly quick check).  So the only alternative I can think
of is to deploy an entire custom version of Tomcat.

Anyone else?

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: web hosting with tomcat

2005-07-01 Thread Peter Crowther
 From: vishwam [mailto:[EMAIL PROTECTED] 
 can tomcat serve as  web server alone?

Yes.

 Please can any one tell me the procedure what should be done ?

At the simplest, edit conf/server.xml to change port 8080 to port 80 and
restart Tomcat so that it reads the new port.  However, you may also
want to take further steps to harden Tomcat before exposing it on the
Internet - for example removing the standard applications and tightening
up the configuration options.  There was a discussion on-list about this
a while back if my memory isn't playing tricks on me; try an archive
search for securing or hardening Tomcat.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat in production

2005-07-01 Thread Peter Crowther
 From: Adam Lipscombe [mailto:[EMAIL PROTECTED] 
 1. Does anyone have an idea of how  many concurrent 
 users/requests TC can support in this sort of config?

Depends entirely on your app.  I've worked on one app
(http://bodington.org) where that configuration would be able to support
hundreds of concurrently-logged-in users, and is currently deployed at
several major UK universities (behind Apache - see below).

What is reasonable?

Unknowable without much more detail about your app.  Your only way of
finding out is to profile.  Configure a test blade, get hold of a
load-testing tool such as Jmeter, devise a benchmark load, and keep
upping the number of threads running that load until the app fails to
respond to all requests!

 3. Any other issues to consider?

Several subscribers to this list do not consider Tomcat secure enough to
be exposed directly to the Internet, preferring to use Apache as a
front-end.  This will reduce throughput and increase configuration
complexity, but can provide increased security.  For example, all of the
public Bodington sites are behind Apache.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Application Level Classpath Setting

2005-07-01 Thread Peter Crowther
 From: Anoop kumar V [mailto:[EMAIL PROTECTED] 
 In TC 5.x (this too FYI does not care abt the system classpath, but)
 you can modify the following lines in catalina.properties file under
 the conf dir ...
 
 SNIP

That's better than my version - thanks, Anoop.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Norton Antivirus is Blocking Tomcat Service access to Port 5001

2005-06-29 Thread Peter Crowther
 From: Muriithi O. Kimotho [mailto:[EMAIL PROTECTED] 
 I installed the latest tomcat in my WinXP Pro but my Norton 
 Antivirus 2005 shuts the Tomcat Service anytime i fire it up 
 then a popup saying a trojan is trying to communicate via Port 5001. 
 
 How can i solve this? I cannot start the Tomcat service at 
 all. Norton shuts is down after 3secs

1) Run a virus scan.  Is that trojan real?  If not...

2) Uninstall Norton and install a more useful AV?  (No, I'm not kidding
- Norton tends to get poor reviews these days compared to
free-for-personal-use AVs such as AVG).

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problem with security?

2005-06-10 Thread Peter Crowther
 From: Gagnon, Joseph M (US SSA) 
 I have a situation where I want to be able to provide user 
 access to an
 application by determining the identity of the requesting 
 user, without
 them having to go through a login procedure.

OK.  So what identity can the browser present that you wish to discover?
Are all your users on Windows, for example, and you wish to discover
their Windows username?  On UNIX?

The way HTTP works is that your servlet has to refuse access to a
resource before it can obtain any information at all about the user at
the other end of the connection.  So at the very least, you'll have to
investigate creating a servlet that requires authentication.  You can
then have some control over the kinds of authentication you say you'll
accept, and therefore whether the user's browser tries to satisfy the
request behind the scenes or whether it pops up that ugly dialog box
requesting a username and password.

If you're on Windows and want the user's Windows authentication, take a
look at the NTLM Authentication Filter - see
http://jcifs.samba.org/src/docs/ntlmhttpauth.html for details.  Note
that I've never used this and can't help any further than these
pointers.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Redirecting Tomcat to IIS (UNCLASSIFIED)

2005-06-09 Thread Peter Crowther
 From: Young, Ed CONT Anteon [mailto:[EMAIL PROTECTED] 
   I have an issue with redirecting my web application from Tomcat
 4.1 to IIS 6.0 on Windows 2003 Server. I have followed the steps in
 configuring the redirect but once I try to access the page using port
 80, I get an Under Construction error. How can this be rectified?

If you access the URL to which you're redirecting directly (i.e. without
going through the Tomcat application and it issuing the redirect), does
it work?

What's the default page for the IIS6 directory?  Have you removed
iisstart.htm from the directory in which you've deployed the IIS6 files?
If you look at the list of start pages on the 'Documents' tab of your
IIS6 sites, property pages, is that default page listed above
iisstart.htm?

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Servlet Concurrency Issues

2005-06-08 Thread Peter Crowther
 From: Michael Pasko [mailto:[EMAIL PROTECTED] 
 To mimic the desired behavior I've fixed
 the problem by adding this (implements SingleThreadModel)...
 
 public class ServletName implements SingleThreadModel

Note that SingleThreadModel isn't supported in more recent versions of
Tomcat.  This may or may not worry you depending on whether you want to
move to a more recent version :-).

 Now it would seem that if several 100 people were to access a 
 servlet that
 every time the following code was hit by a new thread:
 
 PrintWriter out = response.getWriter();
 
 It would direct all output (using out.println()) from all 
 threads to the most recent person to access the servlet.  

The servlet spec mandates that each concurrent request (which is
processed on its own thread) has distinct request and response objects
passed in, so response.getWriter() will get the writer for the current
thread's response object - which is guaranteed not to be the same as
that for any other request that's being processed at the same time.

Reading between the lines, by the way, this means that the container
may, if it wishes, recycle objects (and indeed threads) between
requests.  I know Tomcat 5.0 does this.

 Follow up question:  With this in mind, what is the most 
 common method of writing thread safe code?  

As Guru said, plus a couple of process-related points:

- Go through the spec for third-party code that you're using (libraries,
servlet containers and the like).  Check what guarantees they make about
thread-safety, and check what guarantees they make about object
uniqueness.  If you don't know what the rest of the system provides, you
can be in for some surprises.

- Test!  Jmeter (or some similar multi-threaded load testing tool) is
your friend.  As Knuth remarked, Beware of the above code; I have only
proved it correct, not tried it.  Writing solid thread-safe code takes
more thinking, and hence more time, than writing single-threaded code;
and the likelihood of defects goes up as you now have to think about
interactions between threads which may occur at arbitrary times.  In a
recent project, we bought an 8 CPU box with the slowest processors we
could find, simply so that we could load it up with requests fairly
trivially and so that it could sit and chug away at our test suite
looking for threading issues.  We found several...

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Servlet Concurrency Issues

2005-06-08 Thread Peter Crowther
 From: Remy Maucherat [mailto:[EMAIL PROTECTED] 
 Your statement is completely wrong, STM is fully supported in Tomcat
 5.5, with instance pooling for good performance.

Sorry, Remy - I should have checked rather than relying on memory.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How do you set the session timeout in tomcat so that the session only timeouts when the browser is closed?

2005-06-07 Thread Peter Crowther
 From: Harland, David [mailto:[EMAIL PROTECTED] 
 How do you set the session timeout in tomcat so that the session only
 timeouts when the browser is closed?

You don't.  There is no way in any Web architecture of reliably
detecting whether a browser has closed, or whether it has merely
disconnected from the server for now and will be reconnecting later.
This is a generic problem with any stateful browser-based application
and is not specific to Tomcat.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JAVA_OPTS??

2005-06-07 Thread Peter Crowther
 From: BATCHELOR, SCOTT (CONTRACTOR) [mailto:[EMAIL PROTECTED] 
 I really apologize if this has been answered previously but I 
 cannot find any definative documentation on the JAVA_OPTS 
 option.  I would like to bring myself up to date on what 
 might be accomplished using this setting.

Using JAVA_OPTS, you can pass any options *directly to the Java virtual
machine* on which you are running Tomcat.  Some of these options are
standard, others are VM-specific.  If you want to know the details,
check the documentation for your particular JVM - if it can be passed an
option, you can pass it in JAVA_OPTS.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Realm implemenation, passing additionnal informations to webapplication

2005-06-06 Thread Peter Crowther
 From: delbd [mailto:[EMAIL PROTECTED] 
 I thought to create a decorator class around  
 a Principal to 
 store this information and do a typecasting in webapp to 
 access additionnal informations. 

Or implement your own Principal - either would work I think.

 But the realm implementation is stored in 
 server/lib/myrealm.jar and am not 
 sure classes in server/lib/*.jar are visible to the webapplication.
 
 Any recommendation?

We've dealt with this in another project by splitting the implementation
into two jars: myrealm-impl.jar and myrealm-api.jar.  The API jar
contains the classes required by server and webapp (which should just be
the interface definitions if it's factored correctly), and goes into
common/lib.  The other jar contains the implementation and goes in
server/lib.  It worked for us; watch out for classloader issues if you
mention any class in the API that is in the implementation jar, as the
webapp won't be able to load those classes.

- Peter
--
Peter Crowther, Director, Melandra Limited
John Dalton House, 121 Deansgate, Manchester M3 2AB
t: +44 (0)161 828 8736  f: +44 (0)161 832 5683

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to read a file on disk from a servlet

2005-05-27 Thread Peter Crowther
 From: Kenneth Jensen [mailto:[EMAIL PROTECTED] 
 How do I get my servlet to read the keystore file, say if I put it in
 $CATAILNA_HOME/webapps/mywebapp/WEB-INF/lib/mykeystore.jks.

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletConte
xt.html#getResource(java.lang.String)

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[OT] RE: DNS Request distribution and TCP NAT distribution For Tomcat Cluster

2005-05-26 Thread Peter Crowther
[Marked off-topic as this now has nothing to do with Tomcat.]

 From: Steve Kirk [mailto:[EMAIL PROTECTED] 
 Can I ask how sure you felt of what you
 say here please:

Uhhh... how about 'the little pixies told me, and I believe everything
they say'? :-)  It's from a combination of knowing two folks who used to
run an ISP's DNS services to get details of the timeouts, plus a little
bit of digging into the format of SOA and A records.  In other words:
it's my opinion, do not take it as canon!  I'll try to explain my
reasoning below.

 I tried to research it
 but could not get to the bottom of it with any real info from 
 ISPs (the
 problem is that they seem to do their own thing to various 
 extents).

That is *exactly* the problem.  In essence, one cannot rely on some
aspects of the DNS specification in the real world, as real-world ISPs
hack with their software to improve performance for their environment in
ways that break the spec.  An example: I've taken cache expiry times on
a zone down to 5 minutes, several days before I knew I needed to move a
service to a new IP address; changed the DNS; and sure enough, some ISPs
were still handing out the old address 20 hours later because they
weren't respecting the stated expiry times and were substituting their
own, and the old service was still getting hits.

 I have set up roundrobin DNS for an ecommerce site in the 
 past without any
 complaints from users, and the  balance of load between a 
 pair of clustered servers seemed pretty even.

Good to know that it can work in the real world.  I can make all the
theoretical points I want, but the hard data in your statement is
probably worth more than the rest of this email.

 I would expect any DNS server run by an ISP
 (such as AOL) to receive the zone records from SOA intact, i.e. these
 major dns servers should know about all rr Ips for a given 
 dns name, and
 would therefore be able to RR distribute them to lower-tier 
 DNS servers.

Your expectation is incorrect, I think - even the large DNS servers make
standard requests for A records for the given FQDN, and cache the
result.  If the result contains a set of IP addresses in a particular
order, then that's what is obtained.  To my knowledge (my reasoning
falls down if this is not the case, so this is the bit to check!)
neither the returned A records themselves nor the returned SOA record
contain any indication that they should be handed out in a round-robin
fashion; and the SOA record would not typically be requested by another
server.

 I
 would have thought that the level at which DNS servers do not 
 pick up the
 fact that there is a RR DNS entry is where they do not do a 
 zone transfer
 from a primary DNS server - they simply act as a client and 
 cache what they
 get as a response, so they are unaware that there even are 
 more than one IP.

Even high-level DNS servers don't do zone transfers unless they're
secondaries for the zone.  And, even then, the information about whether
or not to use round-robin is an option set for the zone, not something
that appears in the SOA record for immediate use by the secondary.
Also, remember that many zones are configured to refuse zone transfer
requests from addresses that are not configured as secondaries.

 So overall I guess I'm saying I'd be surprised if AOL's DNS 
 servers only
 cached one entry of a RR set for a DNS name.  What are your thoughts?

I've revised my position slightly.  I think they'll cache the list in a
particular order, rather than a single entry; but the ordering of that
list will be fixed as they won't know to serve it in round-robin
fashion.  If you can confirm or challenge that position, I'd be
interested!

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [OT] RE: DNS Request distribution and TCP NAT distribution For Tomcat Cluster

2005-05-26 Thread Peter Crowther
 From: Steve Kirk [mailto:[EMAIL PROTECTED] 
 Thanks Peter, interesting.

Internet issues in the large tend to be - you get emergent behaviour
that is often unexpected :-).

 I think these are
 referred to as caching servers as opposed to secondary.  It's the
 secondaries that receive the zone transfers.

Yes.  Note that these roles are per-zone; a given DNS server may act as
a primary or secondary for some zones, and as a caching server for
others.

 Having said that, I'd have thought that a large ISP such as 
 AOL would have
 secondaries, (inaccesible by joe public), but would also have caching
 servers, which are the ones they make public.

It would be difficult to persuade those secondaries to be effective -
for what zones are they secondaries?  Let's say AOL want to act as a
secondary for foo.com.  How do AOL contact the owners of foo.com in
order to request that their secondary server is added to the list of
allowed IPs for zone transfers?  Other than that, AOL could then make
use of those servers as forwarders from their caching servers, I accept.

 Since they typically have
 several caching DNS servers, in theory there is a good chance 
 that each of
 them will get a different one of the RR Ips from their 
 secondary server, so
 in theory the RR goal is often achieved?

Assuming they are independent and not configured to use the same
forwarders, yes.  You might be surprised how few DNS servers an
organisation needs, though - Demon (my home ISP, and not a small one)
has two, and could probably get away with one except for redundancy.
I've not seen an ISP setup document yet that says to use primary and
secondary DNS of ns47.isp.net and ns32.isp.net - they're almost all ns0
and ns1 or ns1 and ns2, indicating that there are probably very few in
the organisation.

 For example I just used DOS
 nslookup to query my ISPs 2 main dns servers for 
 www.microsoft.com - they
 each returned a different address, although repeatedly 
 querying each one
 returns the same answer every time.  If I go through a local 
 caching DNS on
 my LAN, that returns a third address for MS - again, the same 
 one every time.

Yup.  So anyone using your ISP's DNS servers will get one of two IPs for
www.microsoft.com at present, out of the however many they have.  Lumpy
load balancing in action :-).

You likely haven't set up your own caching DNS to forward requests to
your ISP's DNS servers; otherwise you'd have had one of the same
answers.

 Basically, it's internal feature of the DNS server 
 to decide how
 it treats hostnames for which is has more than one IP.

Indeed.

 PS this has rekindled my interest so I just googled to 
 refresh my mind on
 the basics, this seems a useful page that explains what we 
 are talking about above.
 http://www.onjava.com/pub/a/onjava/2001/09/26/load.html 

Yes, that seems like a reaonable summary, although it doesn't really go
into the caching effects we're discussing here.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: DNS Request distribution and TCP NAT distribution For Tomcat Cluster

2005-05-25 Thread Peter Crowther
 From: John MccLain [mailto:[EMAIL PROTECTED] 
 1) for DNS Request Distribution - I dont understand. The 
 browser sends a URL
 to the DNS, the DNS responds back with an IP address. But 
 what if at that IP
 address, you have a web server listening on port 80?

The browser talks to that Web server.

 If 
 Tomcat is at that
 address also, Tomcat would have to listen on another port. Can the DNS
 distribute back to the browser the IP Address AND  the Tomcat 
 port so the
 browser connects to Tomcat on a non port 80 port?

Only if your original URL uses the name:port notation - there is nothing
in this scheme to prevent that.

 Also, is there a way to
 setup the DNS to Round Robin or check server load on the 
 servers in the
 Tomcat cluster so it knows which Tomcat server ip:port to 
 send back.

No standard way afaik.  Worse, downstream DNS servers may (often do)
cache the returned IPs for up to a day despite any cache expiry you put
on them.  If (say) the AOL DNS servers all get the same IP address in
their cache, all your AOL visitors will visit the same IP address.

DNS is a very lumpy way of doing load balancing.

 OR does
 this whole thing imply that you have an IP for each web 
 server (IIS)

IP address yes; IIS depends on whether you want IIS or Tomcat at the
business end of the cluster.

 and
 each web server is tied to each server in the Tomcat cluster via a jk2
 redirector?

If you wish to use that architecture, yes.

 2)TCP NAT distribution - Does this mean that when the browser 
 connects to
 the IP address, that that connection is intercepted and the request is
 distributed to a server in the Tomcat cluster?

Yes.

 If this is the case, then
 what does the interception?

Generically, a router that has this capability.  It's that router that
also does the NATing.  Many mid- to high-end hardware routers and some
software routing packages can do this.

 and how do you configure that thing to use a
 specific algorithm (server load, Round Robin, etc..) to 
 choose which server
 to forward the request to?

That is router-specific.  There is no standard (afaik) for the servers
to return load information, so you're stuck with proprietary solutions
*or* the router doesn't load-balance.

 can it forward to an IP:PORT or does it have to
 forward to an IP

That is router-specific.  Given that the capability typically exists on
mid- to high-end routers, most will also have the capability to change
the internal port that is in use.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Minimal server

2005-05-24 Thread Peter Crowther
 From: Dola Woolfe [mailto:[EMAIL PROTECTED] 
 What I'm primarily thinking about is what the user
 would need to have/install in order to use the
 program. And I want the user to simply click on a file
 and for the program to just run (provided the jre is
 installed).

Tomcat is capable of running without any formal installation, although
you'd have to be careful about where it put its working files and how it
unpacked WARs if you were distributing packed webapps.  There have been
a couple of threads about getting the whole thing to run off a CD
without touching the host machine's filestore at all; I think that would
be difficult to achieve as Tomcat, at least, needs to be able to write
to temp filestore.

I disagree slightly with your characterisation of the approach.  I agree
with you that a browser is often the simplest way to *display* a GUI;
however, one needs to provide code behind that browser-based GUI, and
I'm not aware of anything that really solves the problem of deploying
that code to the messy universe of many users' computers rather than to
the tidy universe of central Web servers.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: .asp and tomcat 5.5.9

2005-05-12 Thread Peter Crowther
 From: Trung Nguyen [mailto:[EMAIL PROTECTED] 
 Is there a way to configure tomcat 5.5.9 to support .asp extension?

If you mean 'serve static content that has a .asp suffix as MIME type
x/y', yes.  Configure a MIME-type in Tomcat's conf/web.xml (or your
webapp's web.xml) and you're done.

If you mean 'process Microsoft-style Active Server Pages in the same way
that IIS does', no.  The main product I know that could do that on
non-Microsoft platforms is http://www.sun.com/software/chilisoft/ - Mono
does similar for ASP.Net.  It might be barely possible to use Tomcat to
retrieve pages from such a back-end system and forward them to the
client browser, but I suspect it would be a poor engineering solution.

What are you trying to do?

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: .asp and tomcat 5.5.9

2005-05-12 Thread Peter Crowther
 From: Trung Nguyen [mailto:[EMAIL PROTECTED] 
 What we're trying to 
 do here is one of our client requested to show .asp instead 
 of .jsp  I know this is crazy, but I guess they're Microsoft 
 company :)
 
 Of course all our files end with .jsp

Ah!  OK, so what I think you want is to continue writing your pages as
Java Server Pages, but to rename them filename.asp instead of
filename.jsp, and for Tomcat to process filename.asp as a Java
Server Page?  I.e. this is purely eye candy for any user who reads too
much into a 'asp' suffix.

Am I correct here?  If so, look in Tomcat's conf/web.xml, find the
servlet-mapping that maps *.jsp to the JSP servlet, and add a mapping
for *.asp.  Then try it.

If I'm not correct and your client genuinely wants to run MS-style ASPs,
buy and run a Windows server!  The TCO will almost certainly be lower
than you putting the effort into finding an alternative solution, then
maintaining that solution.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Two instances configuration

2005-05-12 Thread Peter Crowther
 From: Diogo Martinez [mailto:[EMAIL PROTECTED] 
   does anybody know how to set up two instances of Tomcat 
 in a same
 machine, listening to different ports?

As well as configuring the connector, check and change the shutdown port
(near the top of conf/server.xml).  Each instance needs a unique
shutdown port in addition to any ports used by its connectors.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Is it possible to run a Tomcat 4.x and Tomcat 5.x on one computer

2005-05-11 Thread Peter Crowther
 From: ojay78 [mailto:[EMAIL PROTECTED] 
 I have 2 webapplications and one of them have to run with the 
 tomcat 4.x
 Version the other one I want do install it on the new 5.x 
 version. Can I install both tomcat versions on the same server?

Yes.  I have that configuration running here - 4.1.31 and 5.0.28.

 Are both versions independent, so when one crashs it has no 
 influence on the other?

They are independent.  Each runs in its own JVM.

 I tried it today but I could only detect one Tomcat process in the
 Taskmanager and I could only connect to the 4.x manager tool 
 although I gave
 one version the port 8080 and the other one 9090.???!!!

As Tim pointed out, check the shutdown ports as well (near the top of
server.xml as it is distributed) - they also need to be different.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Multiple tomcats - multiple JVM's?

2005-05-11 Thread Peter Crowther
 From: Thomas Nybro Bolding [mailto:[EMAIL PROTECTED] 
 When installing multiple instances of Tomcat 5.5x on the same 
 server do I then need to install multiple JRE's as well?

No.

 But with one JRE would one crashed instance of Tomcat crash 
 the others as well?

Separate the JRE (Java Runtime Environment) from the JVM (Java Virtual
Machine).  Each Tomcat instance runs in its own JVM - its own process.
All use the same JRE.  Think about running multiple copies of
Notepad.exe on Windows.  If one copy of Notepad crashes (the JVM), you
don't lose the others even though they're all using the same copy of the
file (the JRE).

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Question: Please tell me to connect Tomcat/Apache

2005-05-06 Thread Peter Crowther
 From: anshul [mailto:[EMAIL PROTECTED] 
 I think/read, Apache is better than Tomcat for HTML Web pages.

That is your decision, but...

 I asked, to run .jsp from ~/wwwroot

... you won't easily be able to mix, in the same directory, Apache
serving the HTML files and Tomcat serving the JSPs.  This appears to be
what you want to do.  *At the very least*, they will have to appear on
your Web site in different directories, even if they are served from the
same directory.

If you're comfortable with that, start at
http://jakarta.apache.org/tomcat/connectors-doc/index.html to see how to
configure JK between Apache and Tomcat.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Network Disk Not Exist Under Tomcat-5.5.9

2005-05-04 Thread Peter Crowther
 From: NanFei Wang [mailto:[EMAIL PROTECTED] 
 Why Network Disk Not Exist Under Tomcat-5.5.9 ?

Are you running Tomcat as a service?  If so, remember that drive
mappings (eg. mapping Y: to \\myserver\myshare) are user- and
session-specific.  You have mapped a drive as a user; the services on
your computer know nothing about this.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Amount of free disk space

2005-05-04 Thread Peter Crowther
 From: Mark Benussi [mailto:[EMAIL PROTECTED] 
 Is there a Java API call I can make to detect how much disk 
 space has been
 allocated to my account and the current amount used?

Depending on how hard they've nailed down the lid on Tomcat, you *might*
be able to invoke UNIX executables using Runtime.exec().  Then it's a
case of working out what quota program is on the machine - which in turn
depends on the UNIX version - and asking it.

An alternative would be to phone the service provider and ask how much
space has been allocated and used at one instant, and to write code to
traverse the filestore that contains your files counting up the file
sizes.  Add the constant for the difference between what you can see and
what they think you've used, and you have a usage checker that you can
re-run at any time.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: filesystem independent tomcat [OT]

2005-04-29 Thread Peter Crowther
 From: sandy kumar [mailto:[EMAIL PROTECTED] 
 I am doing some exploratory work on tomcat and was
 wondering If anyone has felt the need for tomcat which
 can be loaded across the network and doesnt rely on
 the underlying filesystem in anyway including the
 temporary work directory, logging, catalina_home,
 catalina_base etc ?
 
 Is there any such version already out there? If not,
 then does it break any servlet/jsp specs ?

It's very difficult to do (our project is doing something related).  One
problem is that the spec allows a servlet to store temp files using the
java.io.File interface, which isn't an easy one to get round.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: unable to send a java mail

2005-04-28 Thread Peter Crowther
 From: vishwam [mailto:[EMAIL PROTECTED] 
 iam trying to send a simple email using javamailAPI
 but iam getting the following error
 
 sun.net.smtp.SmtpProtocolException: 553 Sorry, that domain 
 isn't in my list of allowed rcpthosts.

That's a response from your mail server.  I suspect you're trying to
send it something like:

RCPT [EMAIL PROTECTED]

... where it's not allowed to accept mail for somedomain.com, probably
because the server's configured to stop it being used as a relay.

If you know who you're sending to, try this from the Tomcat server:

telnet mailserver 25
[and then type into the telnet window]
HELO name of Tomcat server
MAIL From:from address
RCPT To:recipient address

... and see whether you get a 553 error back from the RCPT.  That would
prove it.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: unable to send a java mail

2005-04-28 Thread Peter Crowther
 From: vishwam [mailto:[EMAIL PROTECTED] 
 my smtp server requires authentication with username  password
 
 but i couldn't find these smtp authentication fields in java mail
 specification

The section entitled 'transport' in
http://java.sun.com/developer/onlineTraining/JavaMail/contents.html
gives more information - essentially, use Transport.send (message,
username, password) to send the message.

- Peter


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: dedicating client ports

2005-04-27 Thread Peter Crowther
 From: Kristian Rink [mailto:[EMAIL PROTECTED] 
 Question: Is there an easy way to, within axis/tomcat, create a
 SOAP service listening on a different port than the tomcat server
 itself?

Yes, I think (beware: I have not tried this).  Create two Services in
your server.xml; each has its own set of Connectors and Hosts.  This
gives you two separate sets of webapps to play with, each on its own set
of connectors and hence ports.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Question about File writing and authorisation

2005-04-27 Thread Peter Crowther
 From: Maarten Janssen [mailto:[EMAIL PROTECTED] 
 I have a servlet that create output files (txt) on the fly 
 (with File obj
 etc). I can write these files anywhere on the server (where 
 the apllication
 is running), so thats great.
 But if I want to write them to another computer in the netwok 
 (accessed by
 \\name) I receive an access denied error. I am using windows NT.
 I tried to set authorisation of all different types of users 
 but didn't
 help. What kind of user is Tomcat and anybody an solution?

Whatever it's running as on the computer.  I assume your Tomcat is
running as a service?  If so, look at the service's 'log on as'
information in Admin ToolsServices.  My guess is that it's running as
LocalSystem, which means you have all privilages locally but *none* on
the network - this is dangerous for the local system.  If you're looking
to create a file elsewhere on the network, I'd create a domain user
account for Tomcat, grant it Log On As A Service on the Tomcat server
and use that.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: set header in all responses

2005-04-27 Thread Peter Crowther
 From: Rodrigo Avila [mailto:[EMAIL PROTECTED] 
 Is possible to put this headers in all responses generated by Tomcat?
 
 response.setHeader(Pragma,no-cache); response.setHeader
 (Cache-Control,no-history);
 response.setDateHeader(Expires,-1); 

Yes.  At worst, you could write a Valve that set those fields before
invoking the next valve in the chain, and put it into your server.xml.
There may well be more elegant solutions.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[OT] RE: development environment

2005-04-26 Thread Peter Crowther
 From: Patrick Lacson [mailto:[EMAIL PROTECTED] 
 I'm curious to what everyone's dev environment looks like.  

Dev: Athlon XP2200, 1Gbyte RAM, 80G hardware-mirrored HDDs*, Win2K
server, dual 1280x1024 TFTs.  Netbeans (when I have to), Ant, JUnit,
vim, CVSNT, putty.  Coffee machine next door - an important piece of
most developers' environments.

Test: 8-CPU Xeon 900, 2G RAM, 18G mirrored HDDs, Gentoo Linux, headless.
Ant, JUnit, vi, cvs, ssh.  In a secured machine room.  We're hacking
with a virtual file system and Tomcat internals, and we wanted a machine
where we could do some serious thread and load testing.  This came off
ebay for about $3k.

- Peter

* Yes, it's a workstation.  No, that's not an excuse for a developer to
have the HDD as a single point of failure :-).  These HDDs are
deliberately from different batches and different sources, so that it's
less likely they'll fail at close to the same time.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problem Binding Tomcat to Ports 80/443

2005-04-26 Thread Peter Crowther
 From: Craig [mailto:[EMAIL PROTECTED] 
 Apr 26, 2005 1:24:04 AM org.apache.coyote.http11.Http11Protocol init
 SEVERE: Error initializing endpoint
 java.net.BindException: Permission denied:80

Are you running the Tomcat process as root?  If not, you won't be able
to bind to ports 80 or 443 on most Unixes.

What has changed in your environment, if anything?  User logins?  Port
numbers?

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Multiple tomcat instances

2005-04-15 Thread Peter Crowther
 From: Kelly, Steve [mailto:[EMAIL PROTECTED] 
 Is it possible to run multiple instances of tomcat on the same server,
 for example to support production and test environments ?

Yes.  I run up to four on this machine - two (one 4.1, one 5.0) are
running as I type this.

Here's a Windows script that works (give or take the HOME path) for
Tomcat 4 and 5.0 - untested on 5.5, but I can't see why it should fail.
The UNIX equivalent is pretty obvious.  Check out CATALINA_HOME - where
Tomcat is installed - versus CATALINA_BASE - where this instance stores
its files.  Note the JAVA_OPTS for increased stack and heap sizes, too;
this line is optional.

C:\cattery is where I store the data for the four instances.

-- snip --
set CATALINA_HOME=C:\Program Files\Apache Group\Tomcat 4.1
set CATALINA_BASE=c:\cattery\instance1
set JAVA_OPTS=-Xms64m -Xmx256m
cd %CATALINA_HOME%\bin
startup
-- snip --

Under CATALINA_BASE for each instance, you'll need conf, logs, temp,
webapps, and work directories.  The easiest way to create these is to
copy them from CATALINA_HOME.  You'll then need to modify
conf/server.xml to make sure each instance is running on its own ports -
don't forget to change the shutdown port!

Good luck, yell if you have any problems getting this to work.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: java.lang.UnsupportedClassVersionError ?

2005-04-15 Thread Peter Crowther
 From: Pawson, David [mailto:[EMAIL PROTECTED] 
 Been trying out java 1.5
 Now back to using 1.4.2.06
 
 When I run what was a working servlet, I'm getting 
 the above error, and
 
 'Unsupported major.minor version 49.0'
 
 Is this Tomcat or java please?

Java.  A .class file has been compiled with a more recent compiler than
the runtime that's in use.  Did you compile the servlet with the 1.5
javac?  If so, clean out the .class files and recompile with 1.4.2.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: clustering without loadbalancing

2005-04-14 Thread Peter Crowther
 From: Gaurav Bansal [mailto:[EMAIL PROTECTED] 
 is apache necessary for this

No - in fact, it merely introduces another single point of failure,
which I assume is what you want to avoid.  However, you need *something*
that will choose whether the primary or standby instance receives any
given request from the user.  You could use any appropriate approach -
changing IP addresses, one or more front-end gateways that detect failed
requests, whatever meets your requirements.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: port number

2005-04-13 Thread Peter Crowther
 From: t.n.a. [mailto:[EMAIL PROTECTED] 
 I host applications on a machine where both apache and tomcat are 
 running. I access apache at port 80 and tomcat at 8080. Is it 
 possible 
 (using the tomcat apache connection, or some other way) to 
 access both at port 80?

Yes, but you'll have to decide under which part of your Apache site
you'll show your Tomcat pages.  The trick is to install mod_jk to
connect from Apache to Tomcat (and make sure you've got a JK connector
enabled in Tomcat).  Then you can map part or all of the Tomcat URL
space into a virtual directory under Apache.  JK is independent of
Tomcat's HTTP connector so, if you wish, you can even remove Tomcat's
connector on port 8080 once you've done this - the Apache = JK =
Tomcat route becomes the only route through which you can access Tomcat.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: about Jakarta Slide commercial use

2005-04-11 Thread Peter Crowther
 From: Yu Jie [mailto:[EMAIL PROTECTED] 
 Though we know that Jakarta Slide
 is under the Apache License 2.0 , we are still not
 quite sure what to do with the situation of commercial
 use. 

DISCLAIMER: The following is personal opinion.  I am not a lawyer.  You
should not rely on this advice.  If you are concerned about the
implications of a license, you should consult your lawyers before taking
any further action.

That said...

Nothing in the Apache License 2.0 stops you from selling software
distributed under that license.  You can charge whatever you want for
your software.  You do not need to distribute the source code of any
software - yours or the software under the Apache license.  However, you
do have to keep to the terms in section 4 of the license.  You do not
need to contribute your code as Open Source.  You do not need to pay
anyone in order to use the software (although donations to the Apache
Foundation or to individual coders are always very welcome).

The Apache license is, deliberately, a very free license.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Webdav issue with non ASCII characters

2005-04-11 Thread Peter Crowther
 From: Fernando Salazar de Paz [mailto:[EMAIL PROTECTED] 
 when I request a PDF file a new
 (second) request is made by Acrobat Reader. Acrobat Reader 
 uses ISO-8859-1
 and Tomcat will not be able to decode the uri properly. What 
 is the reason for the second request ?

The Acrobat reader IE plug-in wants to control the download of the PDF
rather than leave it to IE.  I would expect some other plug-ins to work
the same way.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: tomcat as Windows service - access to resources

2005-04-07 Thread Peter Crowther
 From: Jiang, Peiyun [mailto:[EMAIL PROTECTED] 
 I'm running Tomcat 5.0 on Windows 2000. I logon to Windows as 
 user1 and I have a mapped drive G: that requires separate 
 login (I user the same user name and password, so it 
 automatically logs in). 
 (1) If I login as user1 and start Tomcat from the start 
 script, I can access drive G: from a servlet.
 (2) If I login as user1 and run Tomcat as a Windows service, 
 I don't have access to G: from a servlet. Even if I change 
 the service property using user1 to log on, I still don't 
 have access to G: from a servlet.

Processes that run as services don't load the user profile of the user,
they just take on the user's network identity.  Amongst other things,
the profile stores drive mappings.  This means that no service (to my
knowledge) gets any drive mappings.  A typical workaround is to use the
UNC name of the mapped drive.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: creating a BBS with tomcat - how secure is it?

2005-04-07 Thread Peter Crowther
 From: Christoph Kukulies [mailto:[EMAIL PROTECTED] 
 Anyone knowing of a BBS (Bulletin Board System) based on tomcat?

mvnForum will run on Tomcat, and I know a couple of universities doing
exactly that.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [Way off topic] Getting MSOutlook calendar to interface with Tomcat-served data

2005-04-03 Thread Peter Crowther
 From: Rob Hunt [mailto:[EMAIL PROTECTED] 
 I'd like to serve calendar/event info to the calendar in MS 
 Outlook (or is that LookOUT!?).  I know that it's possible to 
 create output that can be statically imported, but I'd like 
 to make it as easy as possible to periodically/on-demand 
 synchronize Outlook with a Tomcat server.

'Synchronize' as in a one-way download from Tomcat, or as in a two-way
process?

Outlook 2000+ has the notion of a COM add-in that would work for this -
construct such an add-in, give it a property page so that you can
configure its Tomcat server, and let it poll every so often.  We've done
similar work in the past.

Will there always be an Exchange server behind this?  That would make
life a lot easier if there are a significant number of users, as the
sync could be done 'behind the scenes' by a daemon running on/near that
server.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[OT] Serialization (was RE: Clustering question)

2005-04-01 Thread Peter Crowther
 From: Dale, Matt [mailto:[EMAIL PROTECTED] 
 Yes this is a problem. All objects contained within a 
 serializable object must in turn be serializable themselves.

Or marked as 'transient'.  This omits them from serialization.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat Connection refused :-(

2005-04-01 Thread Peter Crowther
 From: gaurav [mailto:[EMAIL PROTECTED] 
   My tomcat server is not working !! no matter what I do 
 every thing I going till I day installed oracle 9i :-(

What Tomcat version?

What operating system?  I assume some UNIX variant given the trace.

Did you install anything else on the machine at the same time as Oracle
9i?  Any operating system changes?  Any firewall changes?  Any reboot
that could have brought into operation a pending change that someone had
made at some earlier time?

What does 'netstat -a' show?  With Tomcat shut down, it should show
nothing on Tomcat's ports; with Tomcat running, it should show Tomcat's
ports as LISTENING.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat Connection refused :-(

2005-04-01 Thread Peter Crowther
 From: gaurav [mailto:[EMAIL PROTECTED] 
 I am using tomcat 5.5.7 on Fedora 3 with jdk1.5.0_02

Thanks.

 my i have disable firewal and stopped Iptables !!

OK.

 netstat -a | grep tomcat or 8080- nothing , zero , blank

You already said that you had moved the Tomcat port from 8080, though?
If so, I wouldn't expect anything on 8080.  And I would expect something
on Tomcat's shutdown port as well (check your server.xml for its port
number) - is that not starting either?

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat -- port 80 for Linux

2005-03-30 Thread Peter Crowther
 From: Jury Levykin [mailto:[EMAIL PROTECTED] 
 I use tomcat 5.5 as main web server at Linux host. Me need 
 run tomcat in port 80.
 
 To solve this task I see two way:
 1. Running tomcat as daemon in port 80 by jsvc command.
 2. Running apache in port 80 and use mod_jk to redirect users 
 request to tomcat.
 
 What way is most secure?

3. Use port forwarding to forward port 80 to port 8080 :-).  No root
access needed at runtime, merely a one-off at configuration time.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Data file owner and group difficulties

2005-03-30 Thread Peter Crowther
 From: James T. Studebaker [mailto:[EMAIL PROTECTED] 
 Yes, Tomcat runs as tomcat:nobody.  I can not run Tomcat as 
 jims:jims since
 jims is a virtual host account.  I should have mentioned this 
 in my initial
 email.  I am one of numerous users who have an account that has access
 tomcat.  The file structure of the account has a webapps 
 directory where I
 install a java web application to be served by Tomcat.  The 
 owner:group for
 this account is jims:jims.  Other users will have a different 
 owner:group.
 However Tomcat runs as tomcat:nobody, the default 
 configuration.  All users
 need to have the ability to create and read data files with 
 the owner:group of their own accounts.  Can this be done?

In that environment?  No.  In an environment where you had more control
over Tomcat?  Not securely.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[OT] RE: Tomcat Hang on Linux (hangs the entire system)

2005-03-30 Thread Peter Crowther
[Marked off-topic as almost certainly not directly Tomcat-related]

 From: Steve Vanspall [mailto:[EMAIL PROTECTED] 
 My only option is to reboot the machine.
 But it hangs half way and has to be physically powered off.

As others have suggested, this may well be bad RAM - or I've had similar
symptoms with two motherboards (from different manufacturers) that were
OK at low bus speeds but on the edge at specced speed.  The RAM is the
more likely issue.

I suggest downloading and booting with Memtest86+
(http://www.memtest.org/) as a first test.  Plan to leave it running for
several hours.  It will log any errors it finds in the lower part of the
screen.

A second test is to run cpuburn (http://pages.sbcglobal.net/redelm/).
cpuburn itself is a useful test, but I strongly recommend running burnbx
and burnmmx for a few minutes each with each of their 'E' and 'L'
parameters - E and L exercise L2 cache and RAM respectively.  These will
run while the machine is up.  If they exit unexpectedly, or the machine
spontaneously restarts, you've found your culprit!

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Location of javascript files.

2005-03-29 Thread Peter Crowther
 From: Pawson, David [mailto:[EMAIL PROTECTED] 
 When I convert the jsp file to 
 /project/WEB-APPS/class/x.class
 
 where would you expect the javascript file to be found please?

By what URL is the client accessing the page (FileProperties or
right-clickProperties in IE)?  It needs to be in that folder, assuming
you've stuck with the relative path.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: question about multiple instances and multiple domains

2005-03-23 Thread Peter Crowther
 From: Bedrijven.nl [mailto:[EMAIL PROTECTED] 
 And what if i don't want to use apache??

Alternative approaches could include allocating each application its own
IP address, ensuring that each Tomcat instance binds to port 80 on its
own IP address.  This assumes you have sufficient IP addresses
available.  Or, as Tim says, you need an alternative proxy.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: question about multiple instances and multiple domains

2005-03-23 Thread Peter Crowther
 From: Bedrijven.nl [mailto:[EMAIL PROTECTED] 
 how can I bind each ipaddress to port 80?? And how to assign 
 a ipaddress to an application?

1. On paper, allocate an IP address range to your applications.
Remember that if these apps are going to be accessed externally, you'll
need a separate *external* IP for each app.  Let's say that you have 5
apps, and have allocated 172.20.1.241 to .245 to them.

2. Configure your Tomcat server machine's network interface(s) to bind
to all of these addresses.  Details vary by OS.  Ping the IPs and check
that the server responds to each one (firewall permitting).

3. Configure your DNS so that www.application1.com points to the IP
172.20.1.241, application2.com to ...242, and so on.  Ping the names and
check that the server responds to each one (firewall permitting).

4. Add an 'address' attribute to each instance's connector in
conf/server.xml (see, for example,
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/http.html ).
Make sure it matches the application.  So for application 1's instance,
add 'address=172.20.1.241' to the connector.  Start the instances.
Use a browser to check that each application responds on its old port
(9000, 9100 etc) but only on the IP address that you've assigned to it.

5. Stop the instances.  Modify the 'port' attribute of each connector to
80.  Start the instances.  They should now all start on port 80; verify
that you can connect to application 1 simply by typing
http://www.application1.com .

Note that the apps will no longer respond on localhost - they will
*only* be available on their designated IP address.

- Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   >