Multiple tomcat instances in linux server

2009-07-28 Thread given . shirinda
Hi Guyz.


I want to run multiple tomcats in my server,I tried the following  tutorials 
from this link http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html.

I created the following folders 

tomcat_instance1
tomcat_instance2
tomcat_instance3


I  have copied conf/server.xml and web.xml to the above mentioned folder from 
apache-tomcat-5.5.25.


I did export the following Variables,
CATALINA_HOME=/opt/apache-tomcat-5.5.25
CATALINA_BASE=/opt/tomcat_instances1

For tomcat_instances1.
I made this changes

Server port=8005 shutdown=SHUTDOWN to Server port=8025 
shutdown=SHUTDOWN
Connector port=8080 maxHttpHeaderSize=8192... to Connector port=8010
maxHttpHeaderSize=8192...
Connector port=8009 enableLookups=false redirectPort=8443 
protocol=AJP/1.3 / to
Connector port=8019 enableLookups=false redirectPort=8443 
protocol=AJP/1.3 /

For tomcat_instances2.
I made this changes

Server port=8005 shutdown=SHUTDOWN to Server port=8035 
shutdown=SHUTDOWN
Connector port=8080 maxHttpHeaderSize=8192... to Connector port=8011
maxHttpHeaderSize=8192...
Connector port=8009 enableLookups=false redirectPort=8443 
protocol=AJP/1.3 / to
Connector port=8019 enableLookups=false redirectPort=8443 
protocol=AJP/1.3 /


when I start the parent tomcat

/opt/apache-tomcat-5.5.25/bin/.startup.sh

The logs file for this apache-tomcat-5.5.25 is empty

when I type this to browser,
http://localhost:8080 it says Failed to Connect

when I start the second tomcat ,it worked fine 

http://localhost:8010


I dont get the point where I missed it.

Feel free to send me the step-by-step installation manuals
Best Regards

-- 
***
STATE INFORMATION TECHNOLOGY AGENCY
***
MIYELANI GIVEN SHIRINDA.

E-LEARNING CONSULTANT [SAKAI]
DEPARTMENT: TECHNOLOGY LAB
___
Tel :012 470 1526
Cell:0730133879
E-Mail 1:given.shiri...@sita.co.za
E-Mail 2:mgshiri...@webmail.co.za
___

Failure is simply the opportunity to begin again,this time more intelligently.

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



RE: Problem with deploying an application

2009-07-28 Thread Nikos Spanoudakis
Dear Chuck,

Thanks for your quick response, I checked out the points that you made and I
have the following findings:

From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 

 From: Nikos Spanoudakis [mailto:ni...@science.tuc.gr]
 Subject: Problem with deploying an application
 
 I try to deploy an application that executes fine on a linux machine.

Is the Linux system running the same version of Tomcat?

No, the Linux system has the Tomcat 6, however The build is for tomcat 5.5.
The same application has been deployed in a Windows system with Tomcat 5.5.

You might want to compare Tomcat's common and shared directories on the
SunOS system with those on the Linux box.

They are almost the same, the other system (now I am talking about the
Windows with Tomcat 5.5) has the jasper-compiler-jdt.jar file in Tomcat's
common/lib that is missing in my tomcat installation. Moreover, my
installation has the ant.jar file in the Tomcat's common/lib that is not
present in the Windows with Tomcat 5.5 installation. 

What's in the WEB-INF/web.xml file for the webapp?

Please find the file attached. Do you see a problem there?

 java.lang.NoClassDefFoundError:
 org/apache/commons/io/output/DeferredFileOutputStream

You are likely missing the commons-io jar.  Since the webapp appears to be
dependent on it, it would normally be located in WEB-INF/lib of the webapp.
However, it may be in another location on the Linux system, such as Tomcat's
shared/lib or common/lib directories.

The commons-io.jar file is included in the WEB-INF/lib folder of the
application.

You can also get the same error if you have /two/ copies of the above jar
in one branch of the classloader tree; in this case, you'll need to remove
one of them.

No double files in the application and tomcat common folders. However, the
application has the antlr-2.7.2.jar in the WEB-INF/lib folder while in the
Tomcat's common/lib my installation has the ant.jar file. Could it be a
problem?

 - Chuck

Thank you again, I hope the information above can lead you to another piece
of advice for me...
Nikos
?xml version=1.0 encoding=UTF-8?
web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; version=2.4 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
  servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
init-param
  param-namedebug/param-name
  param-value3/param-value
/init-param
init-param
  param-namedetail/param-name
  param-value3/param-value
/init-param
load-on-startup0/load-on-startup
  /servlet
  servlet-mapping
servlet-nameaction/servlet-name
url-pattern*.do/url-pattern
  /servlet-mapping
  !-- welcome-file-list
welcome-fileindex.jsp/welcome-file
  /welcome-file-list --
  descriptionMySQL Service App/description
  resource-ref
  descriptionDB Connection/description
  res-ref-namejdbc/eprotocol/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
  /resource-ref
/web-app



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

java.util.logger

2009-07-28 Thread Geofrey Rainey
Hi,

 

I'm trying to understand java logging.

 

I have the following configured in logging.properties:

 

 - here's the handle

handlers = 1lm.org.apache.juli.FileHandler

 

 - now add some properties to the handler

1lm.org.apache.juli.FileHandler.level = FINEST

1lm.org.apache.juli.FileHandler.directory = ${catalina.base}/logs

1lm.org.apache.juli.FileHandler.prefix = auth.

 

 -  add the handler to an application class for logging within the class

auth.DatasourceLoginModule.handlers = 1lm.org.apache.juli.FileHandler

 

 

Now, here's some example application code:

 

 -  the following lines are examples of lines that don't log anything

 

logger.entering(DatasourceLoginModule.class.getName(), entering
verify);

logger.fine(Acquiring connection from datasource.);

 

 -  however this is the only line anywhere that creates a log entry

 

logger.info(e.getMessage());

 

 

I changed the log level to others but this doesn't make any
difference, why do only logger.info messages get logged to the log
file authdate.log and nothing else?

 

Regards,

Geoff.

==
For more information on the Television New Zealand Group, visit us
online at tvnz.co.nz 
==
CAUTION:  This e-mail and any attachment(s) contain information that
is intended to be read only by the named recipient(s).  This information
is not to be used or stored by any other person and/or organisation.


Re: Multiple tomcat instances in linux server

2009-07-28 Thread Pid

On 28/7/09 10:31, given.shiri...@sita.co.za wrote:

Hi Guyz.


I want to run multiple tomcats in my server,I tried the following  tutorials 
from this link http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html.

I created the following folders

tomcat_instance1
tomcat_instance2
tomcat_instance3


I  have copied conf/server.xml and web.xml to the above mentioned folder from 
apache-tomcat-5.5.25.


I did export the following Variables,
CATALINA_HOME=/opt/apache-tomcat-5.5.25
CATALINA_BASE=/opt/tomcat_instances1

For tomcat_instances1.
I made this changes

Server port=8005 shutdown=SHUTDOWN  toServer port=8025 
shutdown=SHUTDOWN
Connector port=8080 maxHttpHeaderSize=8192... toConnector port=8010
maxHttpHeaderSize=8192...
Connector port=8009 enableLookups=false redirectPort=8443 
protocol=AJP/1.3 /  to
Connector port=8019 enableLookups=false redirectPort=8443 
protocol=AJP/1.3 /

For tomcat_instances2.
I made this changes


If you're running multiple Tomcats you also need to change the shutdown 
port number for each one, to make them all unique.



Server port=8005 shutdown=SHUTDOWN  toServer port=8035 
shutdown=SHUTDOWN
Connector port=8080 maxHttpHeaderSize=8192... toConnector port=8011
maxHttpHeaderSize=8192...
Connector port=8009 enableLookups=false redirectPort=8443 
protocol=AJP/1.3 /  to
Connector port=8019 enableLookups=false redirectPort=8443 
protocol=AJP/1.3 /


So you made the AJP connectors the same?
If you don't need them, just comment them out.

p



when I start the parent tomcat

/opt/apache-tomcat-5.5.25/bin/.startup.sh

The logs file for this apache-tomcat-5.5.25 is empty

when I type this to browser,
http://localhost:8080 it says Failed to Connect

when I start the second tomcat ,it worked fine

http://localhost:8010


I dont get the point where I missed it.

Feel free to send me the step-by-step installation manuals
Best Regards




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



Unlock accept issue

2009-07-28 Thread BALCER, Marcin (Marcin)
Hi
I am having problem when shutting down tomcat.

Tomcat: 6.0.14.
OS: Linux  2.6.16.21-0.8-smp #1 SMP Mon Jul 3 18:25:39 UTC 2006 x86_64
Java: 1.5.0_14 Java(TM) 2 Runtime Environment, Standard Edition (build 
1.5.0_14-b03) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_14-b03, mixed mode)

The scenario is as follows:

org.apache.tomcat.util.net.JIoEndpoint.pause is called
calls: unlockAccept();

org.apache.tomcat.util.net.JIoEndpoint.stop is called
calls: unlockAccept();

The second call is not necessary when the connector has already been paused in 
my opinion.
Please consider changing the JioEndpoint code as follows:

  public void stop() {
if (running) {
running = false;
if (!paused) {
unlockAccept();
}
}
}

The same problem exists in org.apache.tomcat.util.net.AprEndpoint


In my scenario Tomcat is stopped under heavy load. From tomcat logs I can see 
that most of the stop time is consumed to by the unlockAccept method (see 
stack trace and logs below).

Tomcat log:
2009-07-28 13:34:12,914 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
[221] - Pausing Coyote HTTP/1.1 on http-8800
2009-07-28 13:34:13,921 (  ) INFO  org.apache.catalina.core.StandardService 
[576] - Stopping service internal
2009-07-28 13:34:13,921 (  ) INFO  org.apache.catalina.core.StandardService 
[576] - Stopping service internal
2009-07-28 13:35:05,290 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
[237] - Stopping Coyote HTTP/1.1 on http-8800
2009-07-28 13:38:14,295 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
[221] - Pausing Coyote HTTP/1.1 on http-7080
2009-07-28 13:38:14,295 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
[221] - Pausing Coyote HTTP/1.1 on http-7443
2009-07-28 13:38:15,381 (  ) INFO  org.apache.catalina.core.StandardService 
[576] - Stopping service main
2009-07-28 13:38:15,381 (  ) INFO  org.apache.catalina.core.StandardService 
[576] - Stopping service main
2009-07-28 13:38:15,621 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 28 instance(s) to be deallocated
2009-07-28 13:38:15,621 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 28 instance(s) to be deallocated
2009-07-28 13:38:16,737 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 24 instance(s) to be deallocated
2009-07-28 13:38:16,737 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 24 instance(s) to be deallocated
2009-07-28 13:38:17,778 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 24 instance(s) to be deallocated
2009-07-28 13:38:17,778 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 24 instance(s) to be deallocated
2009-07-28 13:38:17,885 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 75 instance(s) to be deallocated
2009-07-28 13:38:17,885 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 75 instance(s) to be deallocated
2009-07-28 13:38:19,004 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 59 instance(s) to be deallocated
2009-07-28 13:38:19,004 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 59 instance(s) to be deallocated
2009-07-28 13:38:20,044 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 47 instance(s) to be deallocated
2009-07-28 13:38:20,044 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 47 instance(s) to be deallocated
2009-07-28 13:38:20,855 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
[237] - Stopping Coyote HTTP/1.1 on http-7080
2009-07-28 13:38:20,859 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
[237] - Stopping Coyote HTTP/1.1 on http-7443
2009-07-28 13:38:20,860 (  ) INFO  org.apache.coyote.http11.Http11NioProtocol 
[183] - Pausing Coyote HTTP/1.1 on http-8080
2009-07-28 13:38:20,860 (  ) INFO  org.apache.coyote.http11.Http11NioProtocol 
[183] - Pausing Coyote HTTP/1.1 on http-8443
2009-07-28 13:38:21,866 (  ) INFO  org.apache.catalina.core.StandardService 
[576] - Stopping service comet
2009-07-28 13:38:21,866 (  ) INFO  org.apache.catalina.core.StandardService 
[576] - Stopping service comet
2009-07-28 13:38:21,867 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 84 instance(s) to be deallocated
2009-07-28 13:38:21,867 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 84 instance(s) to be deallocated
2009-07-28 13:38:22,910 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 72 instance(s) to be deallocated
2009-07-28 13:38:22,910 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 72 instance(s) to be deallocated
2009-07-28 13:38:23,954 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 63 instance(s) to be deallocated
2009-07-28 13:38:23,954 (  ) INFO  

How to programmatically set the JAAS Subject in Tomcat 5.5

2009-07-28 Thread tbalent

We have an implementation of a J2EE servlet filter that we use in Tomcat that 
restricts connections based on either a list of trusted source IP addresses, 
or a secret header value, or a combination of both.
 
This servlet filter is currently used with perimeter authentication / 
authorization occurring in an Apache proxy that is enabled with a 3rd Party 
agent. When the agent allows the HTTP request through (to Tomcat or a J2EE 
application server), it adds HTTP request headers. One header is the 
authenticated user and the other is a list of comma-separated groups that
the
authenticated user belongs to.
 
Our goal is to add code to this J2EE servlet filter to use these HTTP
request 
headers to create a JAAS subject from these headers so that applications
using 
the filter can then make use of the JAAS subject programatically or via 
declarative security (e.g., via security-constraint, annotations, etc.)
Note 
that we ideally would like to do all of this without implementing / defining
a 
JAAS LoginModule and CallbackHandler if at all possible. (The perimeter 
authentication ensures that the user has already properly authenticated; the 
trusted source IP and/or secret header ensures that the request came via the 
Apache proxy where the 3rd Party agent is enabled.) 

We have implemented similar code with Oracle's WebLogic Server using code 
something like this (most of this is WebLogic specific code):

 public void doSetJAASSubject(final Subject subject,
   HttpServletRequest request) throws Exception
 {
   if (admin == null) {
 AuthenticatedSubject authAdmin = (AuthenticatedSubject)
  
AccessController.doPrivileged(PrivilegedActions.getKernelIdentityAction());
 admin = authAdmin.getSubject();
   }
   weblogic.security.Security.runAs(admin,
 new PrivilegedAction()
 {
   public Object run()
   {
 PrincipalValidatorImpl validator = new PrincipalValidatorImpl();
 Iterator it = subject.getPrincipals().iterator();
 while (it.hasNext()) {
   Principal principal = (Principal)it.next();
   validator.sign(principal);
 }
 return null;
  }
});
ServletAuthentication.runAs(subject, request);
  }

So, the questions are; is it possible to do this in Tomcat? And if so, how
do we do it so that the JAAS subject is available programatically, for use 
with security-constraint, etc. without requiring the development teams
lots 
of additional configuration or any additional implementation.
 
Thank you,

-- 
View this message in context: 
http://www.nabble.com/How-to-programmatically-set-the-JAAS-Subject-in-Tomcat-5.5-tp24698094p24698094.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: Multiple tomcat instances in linux server

2009-07-28 Thread André Warnier

Pid wrote:

On 28/7/09 10:31, given.shiri...@sita.co.za wrote:

Hi Guyz.


...



For tomcat_instances1.
I made this changes

Server port=8005 shutdown=SHUTDOWN  toServer port=8025 
shutdown=SHUTDOWN


etc..

Pid, you missed it.  The OP seems to have made the necessary changes.


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



Re: How to programmatically set the JAAS Subject in Tomcat 5.5

2009-07-28 Thread André Warnier

tbalent wrote:
...
authorization occurring in an Apache proxy that is enabled with a 3rd Party 
agent. When the agent allows the HTTP request through (to Tomcat or a J2EE 

...
This may or may not be relevant to your issue :
The AJP protocol used between Apache and Tomcat, allows Apache to pass 
an authenticated user-id to Tomcat in the request.
I do not remember precisely at what level this parameter lives, but it 
is invoked as tomcatAuthentication=false either in the connector 
(mod_jk in my case) or in the Connector in Tomcat.

You may want to look this up, to see if it applies in your case.

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



Re: How to programmatically set the JAAS Subject in Tomcat 5.5

2009-07-28 Thread André Warnier

André Warnier wrote:

tbalent wrote:
...
authorization occurring in an Apache proxy that is enabled with a 3rd 
Party agent. When the agent allows the HTTP request through (to Tomcat 
or a J2EE 

...
This may or may not be relevant to your issue :
The AJP protocol used between Apache and Tomcat, allows Apache to pass 
an authenticated user-id to Tomcat in the request.
I do not remember precisely at what level this parameter lives, but it 
is invoked as tomcatAuthentication=false either in the connector 
(mod_jk in my case) or in the Connector in Tomcat.

You may want to look this up, to see if it applies in your case.


Complement :
http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html
(at end of page)

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



Re: Trouble setting up virtual host

2009-07-28 Thread Lisa D Beggs/AC/VCU
From:
Mark Eggers its_toas...@yahoo.com
To:
Tomcat Users List users@tomcat.apache.org
Date:
07/27/2009 10:55 PM
Subject:
Re: Trouble setting up virtual host




As usual, late to the thread.

I'll use C) then:

  C) on another workstation :
  
  - close the browser and re-open it.
  - in the browser, find the place where you can clear the cache.
  - do it (clear the cache)
  - request the URL :

   http://adm138/InfoViewApp
  
  - indicate the result here :
  
  
  A:  Internet Explorer cannot display the webpage

This usually means that the other workstation cannot translate between the 
name you gave the host on the other workstation (adm138) and the IP 
address of your server.

I also noticed that while you use the fully qualified name in the other 
example (www.fmdreports.vcu.edu) you use the short name in your tests 
(adm138).

There are several things to try here, to see where the breakdown is.  I'll 
use numbers since everyone else is using letters.

1. From another workstation, open a DOS window (if it's Windows) or a UNIX 
shell command (if it's UNIX), and type the following:

ping adm138

1a) If you get:
Ping could not find the host adm138, then the other workstation does not 
know how to translate between the name and the IP address.

1b) If you get:
Four lines with a bunch of numbers, then the other workstation knows how 
to translate between the name and the IP address


**A:  Yes I get the replys back, it is able to ping ADM138


2. From another workstation, open a DOS window (if it's Windows) or a UNIX 
shell command (if it's UNIX) and type the following:

ping adm138.fmdreports.vcu.edu

2a) If you get:
Ping could not find the host adm138.fmdreports.vcu.edu, then the other 
workstation does not know how to translate between the name and the IP 
address.


**A:  I can not ping adm138.fmdreports.vcuedu - HOWEVER, I can ping 
fmdreports.vcu.edu (and this is how we want the user to be name to be 
setup so that is setup correctly)

2b) If you get:
Four lines with a bunch of numbers, then the other workstation knows how 
to translate between the name and the IP address

adm138.fmdreports.vcu.edu may be the fully qualified name, but this 
depends on how your network administrator has set up something called DNS.

Firewall check
==

Windows comes with a built-in firewall.  On XP/Professional it's located 
in Start-Control Panel-Network Connections.  You'll have to single-click 
on the active network (the one your server connects to) to see Change 
Firewall Settings on the left hand side.

Once you click on that (Change Firewall Settings), you should be able to 
edit the settings by selecting Exceptions tab.  Hopefully you'll see two 
entries for Java(TM) Platform SE Binary.  Make sure that the JRE you're 
using to run Tomcat is there (by clicking on edit and reading the 
properties).

Short term fix (once you've checked your firewall)
==

If you have administrative privileges on the other workstation (Windows) 
or root access (UNIX), you can add some information in a file called 
hosts.  On Windows, it's located in the %windir%\System 32\drivers\etc 
directory.  In UNIX it's located in /etc

The line you need to add is the following:

aaa.bbb.ccc.ddd adm138

where aaa.bbb.ccc.ddd is the IP address of the machine with your Tomcat 
server.

If the fully qualified name is supposed to be adm138.fmdreports.vcu.edu, 
then add this line instead to the hosts file

aaa.bbb.ccc.ddd adm138 adm138.fmdreports.vcu.edu

where aaa.bbb.ccc.ddd is the IP address of the machine with your Tomcat 
server.

Long term (proper) fixes
=

There are really two parts to this fix.  The first part is to get your 
network administrator to add this hostname and IP address to your campus 
DNS server.  The DNS server is responsible for translating between 
human-readable names and IP addresses.  Once the name you have chosen for 
your server is in DNS, all machines using DNS servers will know how to 
interpret the name of the host.

**A:  They have done this www.fmdreports.vcu.edu is replacing the lengthy 
URL name of the web browser application(Infoview) that our users are using 
to use when viewing/scheduling Crystal Reports.  This is a Crystal Reports 
Server running Tomcat (not sure if you saw the initial post.

The second part of the fix is to alter your virtual host definition in 
server.xml.  In general, it's a good idea to only use fully qualified 
names in the server.xml file.

So, in part, your host element should look like this:

Host name=fully-qualified-host-name . . . . 

/Host

For example:

Host name=adm138.fmdreports.vcu.edu . . . 

/Host

However, if you want to have this virtual host respond to other names, you 
can add aliases for each name.  To do that, just add an alias element for 
each name you want.

Host name=fully-qualified-host-name . . . .
  Aliassome-other-name/Alias
  

Re: Multiple tomcat instances in linux server

2009-07-28 Thread Pid

On 28/7/09 14:49, André Warnier wrote:

Pid wrote:

On 28/7/09 10:31, given.shiri...@sita.co.za wrote:

Hi Guyz.


...



For tomcat_instances1.
I made this changes

Server port=8005 shutdown=SHUTDOWN toServer port=8025
shutdown=SHUTDOWN


etc..

Pid, you missed it. The OP seems to have made the necessary changes.


doh.
once again, email before coffee proven to be a fail condition.

p



-
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: HttpServletRequest.getReader() returns nothing

2009-07-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Swati,

On 7/27/2009 11:22 PM, Swati Rastogi -X (swrastog - Infosys at Cisco) wrote:
 I have removed all calls to getParameter family of methods on the
 request object and I can still see the issue. I have checked all
 servlet filters - No processing has been done on request object. This
 issue is seen when content-type=application/x-www-form-urlencoded.
 Issue is not seen when content-type=text/xml.

As Martin pointed out, using text/xml does not satisfy the requirements
of the servlet container to parse stdin into parameters.

 Two questions
 A) How to know from where getParameter is being called from the code?

Write a filter or valve, wrap the request and override the getParameter
family of methods to dump stack traces when they are called. Install
your filter as the /first/ filter in the call chain (by mapping it at
the top of the filter-mapping elements in web.xml). Especially if you
are using a web application framework, these calls can be made without
you realizing they are happening.

 B) Is it okay to use content-type=text/xml

It is definitely okay to use text/xml, though application/xml is often
used as well.

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

iEYEARECAAYFAkpvMIwACgkQ9CaO5/Lv0PBiTwCeMubICUcOI8RkCzL9XvadR2Zg
NqwAnAxkVTZNL+iusf7wCbkmf/fTRWrG
=w/hX
-END PGP SIGNATURE-

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



Re: Unlock accept issue

2009-07-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Marcin,

You may have better luck posting this to the tomcat-dev mailing list
(d...@tomcat.apache.org). You will have to join the list before posting.

- -chris

On 7/28/2009 7:55 AM, BALCER, Marcin (Marcin) wrote:
 Hi
 I am having problem when shutting down tomcat.
 
 Tomcat: 6.0.14.
 OS: Linux  2.6.16.21-0.8-smp #1 SMP Mon Jul 3 18:25:39 UTC 2006 x86_64
 Java: 1.5.0_14 Java(TM) 2 Runtime Environment, Standard Edition (build 
 1.5.0_14-b03) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_14-b03, mixed 
 mode)
 
 The scenario is as follows:
 
 org.apache.tomcat.util.net.JIoEndpoint.pause is called
 calls: unlockAccept();
 
 org.apache.tomcat.util.net.JIoEndpoint.stop is called
 calls: unlockAccept();
 
 The second call is not necessary when the connector has already been paused 
 in my opinion.
 Please consider changing the JioEndpoint code as follows:
 
   public void stop() {
 if (running) {
 running = false;
 if (!paused) {
 unlockAccept();
 }
 }
 }
 
 The same problem exists in org.apache.tomcat.util.net.AprEndpoint
 
 
 In my scenario Tomcat is stopped under heavy load. From tomcat logs I can see 
 that most of the stop time is consumed to by the unlockAccept method (see 
 stack trace and logs below).
 
 Tomcat log:
 2009-07-28 13:34:12,914 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
 [221] - Pausing Coyote HTTP/1.1 on http-8800
 2009-07-28 13:34:13,921 (  ) INFO  org.apache.catalina.core.StandardService 
 [576] - Stopping service internal
 2009-07-28 13:34:13,921 (  ) INFO  org.apache.catalina.core.StandardService 
 [576] - Stopping service internal
 2009-07-28 13:35:05,290 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
 [237] - Stopping Coyote HTTP/1.1 on http-8800
 2009-07-28 13:38:14,295 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
 [221] - Pausing Coyote HTTP/1.1 on http-7080
 2009-07-28 13:38:14,295 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
 [221] - Pausing Coyote HTTP/1.1 on http-7443
 2009-07-28 13:38:15,381 (  ) INFO  org.apache.catalina.core.StandardService 
 [576] - Stopping service main
 2009-07-28 13:38:15,381 (  ) INFO  org.apache.catalina.core.StandardService 
 [576] - Stopping service main
 2009-07-28 13:38:15,621 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 28 instance(s) to be deallocated
 2009-07-28 13:38:15,621 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 28 instance(s) to be deallocated
 2009-07-28 13:38:16,737 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 24 instance(s) to be deallocated
 2009-07-28 13:38:16,737 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 24 instance(s) to be deallocated
 2009-07-28 13:38:17,778 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 24 instance(s) to be deallocated
 2009-07-28 13:38:17,778 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 24 instance(s) to be deallocated
 2009-07-28 13:38:17,885 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 75 instance(s) to be deallocated
 2009-07-28 13:38:17,885 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 75 instance(s) to be deallocated
 2009-07-28 13:38:19,004 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 59 instance(s) to be deallocated
 2009-07-28 13:38:19,004 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 59 instance(s) to be deallocated
 2009-07-28 13:38:20,044 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 47 instance(s) to be deallocated
 2009-07-28 13:38:20,044 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 47 instance(s) to be deallocated
 2009-07-28 13:38:20,855 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
 [237] - Stopping Coyote HTTP/1.1 on http-7080
 2009-07-28 13:38:20,859 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
 [237] - Stopping Coyote HTTP/1.1 on http-7443
 2009-07-28 13:38:20,860 (  ) INFO  org.apache.coyote.http11.Http11NioProtocol 
 [183] - Pausing Coyote HTTP/1.1 on http-8080
 2009-07-28 13:38:20,860 (  ) INFO  org.apache.coyote.http11.Http11NioProtocol 
 [183] - Pausing Coyote HTTP/1.1 on http-8443
 2009-07-28 13:38:21,866 (  ) INFO  org.apache.catalina.core.StandardService 
 [576] - Stopping service comet
 2009-07-28 13:38:21,866 (  ) INFO  org.apache.catalina.core.StandardService 
 [576] - Stopping service comet
 2009-07-28 13:38:21,867 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 84 instance(s) to be deallocated
 2009-07-28 13:38:21,867 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 84 instance(s) to be deallocated
 2009-07-28 13:38:22,910 (  ) INFO  org.apache.catalina.core.StandardWrapper 
 [1355] - Waiting for 72 

Re: Multiple tomcat instances in linux server

2009-07-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

To whom it may concern,

On 7/28/2009 5:31 AM, given.shiri...@sita.co.za wrote:
 I want to run multiple tomcats in my server,I tried the following
 tutorials from this link
 http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html.

That link is for clustering. If you just want to run multiple Tomcat
instances, just read the RUNNING.txt file that ships with Tomcat: the
section is called Advanced Configuration - Multiple Tomcat Instances.

 Server port=8005 shutdown=SHUTDOWN to Server port=8025 
 shutdown=SHUTDOWN

Good.

 Connector port=8080 maxHttpHeaderSize=8192... to Connector port=8010
 maxHttpHeaderSize=8192...

Good.

 Connector port=8009 enableLookups=false redirectPort=8443 
 protocol=AJP/1.3 / to
 Connector port=8019 enableLookups=false redirectPort=8443 
 protocol=AJP/1.3 /

Good.

 For tomcat_instances2.
 I made this changes
 
 Server port=8005 shutdown=SHUTDOWN to Server port=8035 
 shutdown=SHUTDOWN

Good.

 Connector port=8080 maxHttpHeaderSize=8192... to Connector port=8011
 maxHttpHeaderSize=8192...

Good.

 Connector port=8009 enableLookups=false redirectPort=8443 
 protocol=AJP/1.3 / to
 Connector port=8019 enableLookups=false redirectPort=8443 
 protocol=AJP/1.3 /

Bad: this one is set to the same as above. I think you probably meant to
use port=8020, based upon how you've been numbering things.

Note that the redirectPort will have to be something that will get you
to an HTTPS connector, which you haven't defined. If a user is
redirected to an HTTPS URL, then the port number will be wrong.

 when I start the parent tomcat
 
 /opt/apache-tomcat-5.5.25/bin/.startup.sh

.startup.sh? What about running startup.sh?

 The logs file for this apache-tomcat-5.5.25 is empty

Which exact file did you look at?

 when I type this to browser,
 http://localhost:8080 it says Failed to Connect
 
 when I start the second tomcat ,it worked fine 
 
 http://localhost:8010

Right: one of your Tomcats started correctly (the one that started
first) and one failed to start because the port number (8019) was
unavailable.

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

iEYEARECAAYFAkpvNQkACgkQ9CaO5/Lv0PB2fQCdGrzsHuS0jDwnRX5CiOwPOpQb
zF4AoLSwxKcfBo7QhhEaa5mheVOcRe6r
=UQKV
-END PGP SIGNATURE-

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



Re: Application Context (and/or) SERVICE element load orders when starting Tomcat 5/6.

2009-07-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jean,

On 7/22/2009 10:39 AM, JeanNiBee wrote:
 So in effect I'm deferring all interaction w/ RAM to be at request time and
 not startup time correct?

Well, you're delaying such interactions until the first request is
processed. A reasonable startup procedure would be to start Tomcat and
immediately hit a URL to configure it, then open everything to the public.

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

iEYEARECAAYFAkpvZ/wACgkQ9CaO5/Lv0PCyZwCgqjahXBUeEofeUQYRs/VahYqJ
0LcAmwdE0esjaKqBMfBbF7vfTX/P925q
=alIa
-END PGP SIGNATURE-

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



Re: Unlock accept issue

2009-07-28 Thread Filip Hanik - Dev Lists

or open a bug report @
https://issues.apache.org/bugzilla/enter_bug.cgi?product=Tomcat%206

Filip

On 07/28/2009 11:10 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Marcin,

You may have better luck posting this to the tomcat-dev mailing list
(d...@tomcat.apache.org). You will have to join the list before posting.

- -chris

On 7/28/2009 7:55 AM, BALCER, Marcin (Marcin) wrote:
   

Hi
I am having problem when shutting down tomcat.

Tomcat: 6.0.14.
OS: Linux  2.6.16.21-0.8-smp #1 SMP Mon Jul 3 18:25:39 UTC 2006 x86_64
Java: 1.5.0_14 Java(TM) 2 Runtime Environment, Standard Edition (build 
1.5.0_14-b03) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_14-b03, mixed mode)

The scenario is as follows:

org.apache.tomcat.util.net.JIoEndpoint.pause is called
 calls: unlockAccept();

org.apache.tomcat.util.net.JIoEndpoint.stop is called
 calls: unlockAccept();

The second call is not necessary when the connector has already been paused in 
my opinion.
Please consider changing the JioEndpoint code as follows:

   public void stop() {
 if (running) {
 running = false;
 if (!paused) {
 unlockAccept();
 }
 }
 }

The same problem exists in org.apache.tomcat.util.net.AprEndpoint


In my scenario Tomcat is stopped under heavy load. From tomcat logs I can see that most 
of the stop time is consumed to by the unlockAccept method (see stack trace 
and logs below).

Tomcat log:
2009-07-28 13:34:12,914 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
[221] - Pausing Coyote HTTP/1.1 on http-8800
2009-07-28 13:34:13,921 (  ) INFO  org.apache.catalina.core.StandardService 
[576] - Stopping service internal
2009-07-28 13:34:13,921 (  ) INFO  org.apache.catalina.core.StandardService 
[576] - Stopping service internal
2009-07-28 13:35:05,290 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
[237] - Stopping Coyote HTTP/1.1 on http-8800
2009-07-28 13:38:14,295 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
[221] - Pausing Coyote HTTP/1.1 on http-7080
2009-07-28 13:38:14,295 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
[221] - Pausing Coyote HTTP/1.1 on http-7443
2009-07-28 13:38:15,381 (  ) INFO  org.apache.catalina.core.StandardService 
[576] - Stopping service main
2009-07-28 13:38:15,381 (  ) INFO  org.apache.catalina.core.StandardService 
[576] - Stopping service main
2009-07-28 13:38:15,621 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 28 instance(s) to be deallocated
2009-07-28 13:38:15,621 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 28 instance(s) to be deallocated
2009-07-28 13:38:16,737 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 24 instance(s) to be deallocated
2009-07-28 13:38:16,737 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 24 instance(s) to be deallocated
2009-07-28 13:38:17,778 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 24 instance(s) to be deallocated
2009-07-28 13:38:17,778 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 24 instance(s) to be deallocated
2009-07-28 13:38:17,885 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 75 instance(s) to be deallocated
2009-07-28 13:38:17,885 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 75 instance(s) to be deallocated
2009-07-28 13:38:19,004 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 59 instance(s) to be deallocated
2009-07-28 13:38:19,004 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 59 instance(s) to be deallocated
2009-07-28 13:38:20,044 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 47 instance(s) to be deallocated
2009-07-28 13:38:20,044 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 47 instance(s) to be deallocated
2009-07-28 13:38:20,855 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
[237] - Stopping Coyote HTTP/1.1 on http-7080
2009-07-28 13:38:20,859 (  ) INFO  org.apache.coyote.http11.Http11Protocol 
[237] - Stopping Coyote HTTP/1.1 on http-7443
2009-07-28 13:38:20,860 (  ) INFO  org.apache.coyote.http11.Http11NioProtocol 
[183] - Pausing Coyote HTTP/1.1 on http-8080
2009-07-28 13:38:20,860 (  ) INFO  org.apache.coyote.http11.Http11NioProtocol 
[183] - Pausing Coyote HTTP/1.1 on http-8443
2009-07-28 13:38:21,866 (  ) INFO  org.apache.catalina.core.StandardService 
[576] - Stopping service comet
2009-07-28 13:38:21,866 (  ) INFO  org.apache.catalina.core.StandardService 
[576] - Stopping service comet
2009-07-28 13:38:21,867 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 84 instance(s) to be deallocated
2009-07-28 13:38:21,867 (  ) INFO  org.apache.catalina.core.StandardWrapper 
[1355] - Waiting for 84 instance(s) to be deallocated
2009-07-28 13:38:22,910 (  ) 

Re: Tomcat upgrade 5.5 - 6 affecting apache server

2009-07-28 Thread Lucas Vickers
got it working

thank you Wesley and David

On Sun, Jul 26, 2009 at 11:59 AM, Wesley Acheson
wesley.ache...@gmail.comwrote:

 I'd probably copy and change it.  see
 http://tomcat.apache.org/connectors-doc/generic_howto/quick.html  It
 requrired to list the tomcat instances and what ports they listen to AJP
 over.

 On Sat, Jul 25, 2009 at 9:20 PM, David Smith d...@cornell.edu wrote:

  If I remember write, this file has all the mount directives for various
  webapps hosted by tomcat.  It might have even been auto-generated in
  your tomcat 5.5 environment by the tomcat service.  I would migrate the
  stuff in workers.properties to their equivalent in apache httpd config
  files and drop the reference from jk.conf.
 
  --David
 
  Lucas Vickers wrote:
   Hello,
   I'm on a pre-configured box (I'm learning).
   I upgraded my tomcat from 5.5 to 6, and I found that my apache server
 can
   not start because:
  
   /usr/local/apache/conf/jk.conf
   references
  
   JkWorkersFile /usr/local/jakarta/tomcat/conf/workers.properties
  
   which is not available in tomcat 6.
  
   what should be done in this situation?  remove the reference, copy the
  file
   over from my 5.5 dir?
  
   thanks!
   Lucas
  
  
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 



Access to home page

2009-07-28 Thread Mohit Anchlia
tomcat 6:

How can I limit access to the home page so that people are not able to
access the home page?

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



Re: Access to home page

2009-07-28 Thread stever
You want authentication 
--Original Message--
From: Mohit Anchlia
To: Tomcat Users List
ReplyTo: Tomcat Users List
Subject: Access to home page
Sent: Jul 28, 2009 21:27

tomcat 6:

How can I limit access to the home page so that people are not able to
access the home page?

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



Sent via BlackBerry from T-Mobile

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



Re: Access to home page

2009-07-28 Thread Hassan Schroeder
On Tue, Jul 28, 2009 at 9:27 PM, Mohit Anchliamohitanch...@gmail.com wrote:

 How can I limit access to the home page so that people are not able to
 access the home page?

Pulling the plug on the server would work.

Or you could describe a less restrictive, but more precise, use case :-)

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

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



Re: Access to home page

2009-07-28 Thread Mohit Anchlia
How do I setup authentication?

On Tue, Jul 28, 2009 at 9:32 PM, ste...@up-south.com wrote:
 You want authentication
 --Original Message--
 From: Mohit Anchlia
 To: Tomcat Users List
 ReplyTo: Tomcat Users List
 Subject: Access to home page
 Sent: Jul 28, 2009 21:27

 tomcat 6:

 How can I limit access to the home page so that people are not able to
 access the home page?

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



 Sent via BlackBerry from T-Mobile

 -
 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