Re: how to do directory listing in tomcat 5.5

2010-03-17 Thread CBy

On 17-3-2010 8:45, Pid wrote:

On 17/03/2010 06:54, Brad Lajoie wrote:
I've been trying for so long to get directory listing in Tomcat 5.5 
to work
for my website and I still can't get it to work. Magically, at one 
point it

worked somewhat for directories with jpgs, css, js, etc files, but not
directories with video files such as mkv, avi, etc.


You did check Tomcat's permissions on those problematic 
files/directories, didn't you?




I've followed numerous sites instructing how to edit the web.xml in 
order to

get directory listings to work and still nothing works.

I'm developing in Eclipse, and running my web application, call it 
MyWebsite

for simplicity, on a Tomcat 5.5 server.

Here's one site I tried following to edit the web.xml:

http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q12


Edit it how?  You haven't actually stated what you've tried.


p




So I start up the server and run my website/webapp on it via:

http://localhost:8080/MyWebsite

This works just fine, but whenever I do:

http://localhost:8080/MyWebsite/images

This doesn't work, and yes there is an images directory in my web 
root which

in eclipse is MyWebsite/WebContent. So the images directory is in
MyWebsite/WebContent/images. This has become beyond frustrating and I 
really

need some help with this please.

I've also tried following the instructions at these sites:

http://tomcat.apache.org/tomcat-5.5-doc/default-servlet.html
http://linux-sxs.org/internet_serving/c581.html
http://wso2.org/blog/sumedha/1096
http://www.karakas-online.de/forum/viewtopic.php?t=9784

They're all relatively the same but nothing I do works! Please help!!

Thanks,
-Brad




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: I get this Error

2010-03-15 Thread CBy

Changing "manger" into "manager" might help.

CBy

On 15-3-2010 9:52, Karthik Nanjangude wrote:

Hi


SPEC
JDK1.5
WINDOWS 2003
TOMCAT 5.0.26.0


Downloaded :  http://tomcat.apache.org/download-60.cgi
Core  :  
zip<http://mirrors.kahuki.com/apache/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.zip>  
(pgp<http://www.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.zip.asc>, 
md5<http://www.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.zip.md5>)
Deployer:  
zip<http://mirrors.kahuki.com/apache/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26-deployer.zip>
  
(pgp<http://www.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26-deployer.zip.asc>,
 
md5<http://www.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26-deployer.zip.md5>)


Having Configured the "tomcat-users.xml"  as displayed  below






When clicked on "Tomcat Manager" in browser URL  http://:/
with Userid / Password  as per the tomcat-users.xml


I get this Error
HTTP Status 403 - Access to the requested resource has been denied
Could not fine any changes in 
http://mirrors.kahuki.com/apache/tomcat/tomcat-6/v6.0.26/RELEASE-NOTES

:(


N.S.Karthik


   



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat doent run on Vista

2010-03-14 Thread CBy
Might have something to do with Vista's User Access Control. Did you 
install in C:\Program Files? As a test, try C:\Program_Files instead.


CBy

On 14-3-2010 7:29, Cummins College wrote:

Hi,

Does tomcat have a problem running on Windows Vista? I cannot run my web
application with vista as OS and jdk1.5
What changes do I need to make? I also have Fedora loaded on my machine.

Thanks

   



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Configuring SSL on Tomcat 5.5.28

2010-03-08 Thread CBy

On 8-3-2010 20:40, Jessica Krosschell wrote:

Good afternoon,
I am implementing SSL on Tomcat 5.5.28 (on a Windows Server 2008 box) 
for the first time as part of a BusinessObjects implementation.  My 
client wants to use a self signed certificate and I was able to create 
one using the keytool utilities with a keystore, but it has already 
expired (it's been 90 days).  How can I create a self signed 
certificate that lasts longer?


Use -validity numberOfDays (default 90).

CBy

Do I need to use something like OpenSSL?  I have looked on the Tomcat 
documentation and spent many hours googling, but I'm not completely 
clear on the process.

I've included screenshots of my process to help describe what I'm doing.
Thanks,
Jessica

--
Jessica (Batista) Krosschell
Senior Engineer - BI Division
Guident
198 Van Buren Street
Suite 120
Herndon, VA 20170
Mobile: 703-597-1552
Email: jkrossch...@guident.com <mailto:jkrossch...@guident.com>
Website: www.guident.com <http://www.guident.com>



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




Re: [OT] Question on Executor (thread pool)

2010-03-08 Thread CBy

On 8-3-2010 17:07, Caldarale, Charles R wrote:

From: CBy [mailto:tom...@byrman.demon.nl]
Subject: Re: [OT] Question on Executor (thread pool)

I am still curious though on when and how to use Tomcat's Executor. I
someone could provide me with a nice example, I would be most grateful.
 

Tomcat's thread pools used to be on a connector basis, so each had to be sized 
for the maximum load expected on the server.  Having a single executor shared 
by some connectors provides a more consistent way of tuning the server as a 
whole, while still allowing an individual thread pool for any connector that 
requires it.

To second Chris' comment: sharing a thread pool between Tomcat and the 
dedicated needs of your webapp is just asking for trouble.  Don't try to force 
commonality on things that are unrelated, especially when it's so easy not to.
   



Thanks for your advise, Chuck. To be honest, I am totally confused now.
I thought it was pretty common to share precious resources across web
apps. Isn't database connection pooling often implemented this way? If
mine isn't, what then would be a good use case for using the shared
class loader?

What is so easy about writing a dedicated service for this?




  - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
__

   



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] Question on Executor (thread pool)

2010-03-08 Thread CBy

Thanks for your help, Chris.

With "you could create a service" you mean a process not managed by 
Tomcat? The class loader route seems less flexible but easier. I think 
I'll try that first.


I am still curious though on when and how to use Tomcat's Executor. I 
someone could provide me with a nice example, I would be most grateful.


CBy

On 8-3-2010 16:27, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

CBy,

On 3/8/2010 7:03 AM, CBy wrote:
   

My web service wraps a command-line application that is rather resource
demanding. To manage the maximum number of instances that can run
concurrently, it uses a (custom) thread pool.
 

Are you on Java 1.5+?  (If not, you should be).

If you are, you can use one of the fine implementations of executors in
java.util.concurrent, such as ThreadPoolExecutor.

   

Now that I have to
develop similar services, I would like to share the pool instead. I was
thinking of switching to Tomcat's Executor -
http://tomcat.apache.org/tomcat-6.0-doc/config/executor.html - but
cannot find any examples on how to use it.
 

I don't believe user code has any access to Tomcat's thread pool(s). Why
not run your own thread pool(s) for this particular requirement?

   

If I uncomment the corresponding lines in server.xml, can I then use the
default tomcatThreadPool by just instantiating
org.apache.catalina.core.StandardThreadExecutor?
 

Almost certainly not. You'd have to create your own
StandardThreadExecutor, configure it, and then use it. The same is true
if you were to use the Java API-provided one, except you wouldn't tie
yourself to Tomcat in that case.

   

Do I have to call start() and stop() on StandardThreadExecutor or is
this handled by Tomcat?
 

If you used StandardThreadExecutor, Tomcat wouldn't be managing it: you
would.

   

Is it possible to block on the execute() method of StandardThreadExecutor?

Can you only have one Executor per Connector?

My current thread pool uses java.util.concurrent.ExecutorService, which
allows to submit (execute) a Callable (instead of Runnable) task. This
is very convenient for returning the exit code of the command line
application to my Java code. It seems to me that this isn't possible
with StandardThreadExecutor or any other executor that implement the
|org.apache.catalina.Executor| interface?

Would it be appropriate to not use Tomcat's Executor and share my custom
thread pool among all services by using Tomcat's common/shared class
loader?
 

I think that would be better. On the other hand, you could create a
service that runs these things on your behalf, and then connect to that.
Then, you only have one thread pool in use, here. I think that will be
less fragile than trying to share a thread pool across web applications.
This also allows you to do thing like re-locate webapps that use the
pool without having to figure out what to do next: you just connect to
the same service you always did. It also makes it possible for you to
load-balance such a service if necessary without figuring out how to
change the clients of the service.

Hope that helps,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuVF2QACgkQ9CaO5/Lv0PArSgCgwkGmosZtlnDJUWAGyJpeEX7L
QUsAoJZVO27SQITXqGQ/a193yY90650c
=wdN3
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

   



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Question on Executor (thread pool)

2010-03-08 Thread CBy

Hi,

My web service wraps a command-line application that is rather resource 
demanding. To manage the maximum number of instances that can run 
concurrently, it uses a (custom) thread pool. This all works fine, but 
my current thread pool is local to my service. Now that I have to 
develop similar services, I would like to share the pool instead. I was 
thinking of switching to Tomcat's Executor - 
http://tomcat.apache.org/tomcat-6.0-doc/config/executor.html - but 
cannot find any examples on how to use it. Hopefully, someone can help 
me with the following questions:


If I uncomment the corresponding lines in server.xml, can I then use the 
default tomcatThreadPool by just instantiating 
org.apache.catalina.core.StandardThreadExecutor?


Do I have to call start() and stop() on StandardThreadExecutor or is 
this handled by Tomcat?


Is it possible to block on the execute() method of StandardThreadExecutor?

Can you only have one Executor per Connector?

My current thread pool uses java.util.concurrent.ExecutorService, which 
allows to submit (execute) a Callable (instead of Runnable) task. This 
is very convenient for returning the exit code of the command line 
application to my Java code. It seems to me that this isn't possible 
with StandardThreadExecutor or any other executor that implement the 
|org.apache.catalina.Executor| interface?


Would it be appropriate to not use Tomcat's Executor and share my custom 
thread pool among all services by using Tomcat's common/shared class loader?


CBy




Re: AW: HowTo restart VHosts on 6.0.20

2010-01-14 Thread CBy-2



markt-2 wrote:
> 
> That isn't wrong - that is by design. The links on the manager page that
> lists deployed applications aren't guaranteed to work since there is no
> guarantee that a webapp will respond to an http GET request of
> /contextpath. Nearly all do, but the manager is one of the exceptions.
> 

True, but it can be a bit confusing and might be the reason why it didn't
work for Alexander.
-- 
View this message in context: 
http://old.nabble.com/HowTo-restart-VHosts-on-6.0.20-tp27158947p27160432.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: AW: HowTo restart VHosts on 6.0.20

2010-01-14 Thread CBy-2


markt-2 wrote:
> 
> CBy-2 left out an important detail. You'll need to copy the manager
> directory (and all the contents) from /webapps to /webappA
> 
> There are ways to organise this so you only have a single manager
> directory but just copying it is the quickest solution.
> 

I didn't mention it, because I always refer to a single manager directory,
i.e. the default one, which works fine for me. Perhaps it didn't work for
Alexander because he used /manager instead of /manager/html to access it?
(All the Tomcat distributions I worked with have this link wrong too: try to
click the /manager link in the manager application.)

Carsten
-- 
View this message in context: 
http://old.nabble.com/HowTo-restart-VHosts-on-6.0.20-tp27158947p27160221.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: HowTo restart VHosts on 6.0.20

2010-01-14 Thread CBy-2



Alexander Diedler wrote:
> 
> We want to have the possibility, to reload every VHost seperatly by using
> the MANAGER App in every vhost. What have we to do?
> 

You can make the manager web app available by placing an XML fragment file
with just the Context element in each Conf/Catalina/[virtual host]
directory.


Alexander Diedler wrote:
> 
> 2nd question: How we can secure the manager app in every context only be
> accessed by special IP ranges?
> 

See Remote Host Filter in
http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html
-- 
View this message in context: 
http://old.nabble.com/HowTo-restart-VHosts-on-6.0.20-tp27158947p27159305.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Advise on configuring SSL

2009-11-25 Thread CBy

Hi,

In my current working environment, Tomcat 6.0.18 is behind Apache. I 
don't know why they chose this setup, because Apache only acts as a 
proxy, it doesn't host anything. I do have experience in setting up SSL 
for stand-alone Tomcat, but have no experience with Apache whatsoever. 
Since I do have administrative rights for Tomcat, but not for Apache, I 
was thinking of letting Tomcat handle SSL. Is that sensible or is it 
better to configure this with Apache in this case?


CBy

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Need some SSL Config help.

2009-07-24 Thread CBy



Josh Gooding wrote:

One more thing.  Here is my server.xml information that is relative:





On Fri, Jul 24, 2009 at 10:25 PM, Josh Gooding wrote:

  

Hello again.

Now that I have deployed my project on Tomcat 6.0.18 with a MySQL 5.1 db, I
need to clamp the server down tight using SSL.  I've already created my
keystore file and I am able to get the server to serve on port 443 (by going
to http://localhost:443).  I can get it to Subsequent attempts to serve as
https://localhost are proving not to be fruitful.

Aren't you trying to serve both HTTP and HTTPS at the same port here? If 
your server responds to http://localhost:443, you cannot expect 
https://localhost to work at the same time. (You can redirect all HTTP 
traffic to HTTPS if that is what you want.)



I have a webserver (tomcat) that is in development status that I want to
clamp down.  I am using a realm to login using j_security_check to login to
the software.  Right now what I want to do is install the Apache webserver
and get it talking to tomcat (not hard).  I created my keystore file and I
know it works because I've tested it.  What I need to know are these things
(btw, if they are in the docs, please just say so and I'll look harder)

If I want to use SSL for each person logging into the instance (which is
using Tomcat to serve) do I need to have SSL on both Apache webserver and
Tomcat, just the webserver, or just tomcat?

Right now for example, if I go to 
http://server.com/[companyid]I get a simple 
login / pwd (using j_sec_chk).  I'm using a realm
configuration in my It's not using SSL.  Following Tomcat's instructions, I
have SSL configured on my test server, and it seems to run if I go to
http://test.com:443/index.jsp. I get the default tomcat page.  However if
I go to https://test.com/index.jsp, I get "cannot connect or website not
responding"  I can't remember which one.  Is this a simple configuration
thing or will this solve itself if I install the webserver and connect tc
and apache web?

Second, since I am using j_security_check for login, are there native
classes in tomcat that will allow me to utilize j_sec_chk and SSL?  Is there
another method of logging in that I should use?  I can write my own custom
classes, but I am not really clear on if there is something better that is
native.  i'm looking at needing a 3 strikes and your locked out
functionality across SSL.  This is a simple yes there is a better way and
it's part of tomcat, or write your custom code.  I'm not looking for the
typical "please do it for me" requests that I normally see on dev / user
lists.

Since each company has exactly ONE html page (which is only a welcome
page), I honestly don't see the need to install the webserver except the
fact that it is the right way of doing things.  Is my thinking off on this?

For some reason, my brain is becoming like a sponge for tomcat
configuration.  So forgive me for asking a ton of questions.  I'm reading
both the tomcat documentation and an O'Reilly book on tomcat, and I want to
get good enough at this that I can configure it in any environment.  I
really enjoy tomcat and become knowledgeable enough that I don't fel like
such a newbie asking questions.  Any insight or direction would be greatly
appreciated.

Warm regards,

Josh




  



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Problem with system property

2009-07-08 Thread CBy

Hi,

We have a third-party webapp that sets the following system property:

System.setProperty("javax.xml.transform.TransformerFactory","net.sf.saxon.TransformerFactoryImpl"); 



This effectively forces all other webapps to use Saxon as an XLST/XQuery 
processor, see:


http://java.sun.com/javase/6/docs/api/javax/xml/transform/TransformerFactory.html#newInstance%28%29 



Other webapps, which are perfectly happy with the default, now suddenly 
have to include saxon9.jar to get successfully deployed. I can imagine 
conflicting webapps in the future. I feel a bit hijacked by this 
third-party application (we do not have the source code). What is the 
best way to deal with this?


T.i.a.

Carsten


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat shutdown problem due to running threads.

2009-06-17 Thread CBy
Thank you, Christopher. It appears that I now have to ways to solve my 
problem. Calling shutdown() stops the threads orderly, so I think I'll 
opt for the ContextListener, although I am not 100% sure.


Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Carsten,

On 6/17/2009 4:33 AM, CBy wrote:
  

O'Reilly's Tomcat The Definitive Guide advises me to invoke the
setDaemon(true) method on any Thread object a web application creates to
keep them from hanging the JVM when Tomcat shuts down. My web service,
however, uses a thread pool that is created via
java.util.concurrent.Executors.newFixedThreadPool(NTHREADS) and I don't
know how to make them daemon threads in this case.



Can you adjust that code? If so, use the form of that method that takes
a ThreadFactory object. Something like this ought to do it:

public class DaemonThreadFactory
implements ThreadFactory
{
   public Thread newThread(Runnable r)
   {
  Thread t = new Thread(r);
  t.setDaemon(true);

  return t;
   }
}

  

My new plan was to register a shutdown hook with the JVM in my web
service and to invoke shutdown() or shutdownNow() on the ExecutorService
in it (the method above returns an ExecutorService). Unfortunately, this
does not seem to work.



You should do as André suggests and use a ServletContextListener. You
should probably use the same listener to both create and teardown the
thread pool.

I recently had my first experience with Executors in Java. I have to say
that I love 'em. So simple, yet so powerful.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAko5KyoACgkQ9CaO5/Lv0PDgcQCfVTfVdv3xUXsEFhh+PYWy9uII
hpoAn37qoHfLeSVot+FjaYI3XS+8deeH
=j4WL
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

  



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat shutdown problem due to running threads.

2009-06-17 Thread CBy
Thanks for pointing me in the right direction André. A 
ServletContextListener fixed my problem.



André Warnier wrote:

CBy wrote:
O'Reilly's Tomcat The Definitive Guide advises me to invoke the 
setDaemon(true) method on any Thread object a web application creates 
to keep them from hanging the JVM when Tomcat shuts down. My web 
service, however, uses a thread pool that is created via 
java.util.concurrent.Executors.newFixedThreadPool(NTHREADS) and I 
don't know how to make them daemon threads in this case.


My new plan was to register a shutdown hook with the JVM in my web 
service and to invoke shutdown() or shutdownNow() on the 
ExecutorService in it (the method above returns an ExecutorService). 
Unfortunately, this does not seem to work.


Is there another way to be notified when Tomcat shuts down, so I can 
shutdown the thread pool accordingly?



From a non-expert (but the expterts are mostly asleep right now) :
maybe this ?
http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat shutdown problem due to running threads.

2009-06-17 Thread CBy
O'Reilly's Tomcat The Definitive Guide advises me to invoke the 
setDaemon(true) method on any Thread object a web application creates to 
keep them from hanging the JVM when Tomcat shuts down. My web service, 
however, uses a thread pool that is created via 
java.util.concurrent.Executors.newFixedThreadPool(NTHREADS) and I don't 
know how to make them daemon threads in this case.


My new plan was to register a shutdown hook with the JVM in my web 
service and to invoke shutdown() or shutdownNow() on the ExecutorService 
in it (the method above returns an ExecutorService). Unfortunately, this 
does not seem to work.


Is there another way to be notified when Tomcat shuts down, so I can 
shutdown the thread pool accordingly?


Thanks in advance,

Carsten

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org