Re: Veritas Clustering for Tomcat
On 3 Dec 2012, at 06:53, Sameera, Shaakunthala shaakunth...@millenniumit.com wrote: Hi Pid, Please see my responses in-line below. Thanks! -- Shaakunthala -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Friday, November 30, 2012 5:17 PM To: Tomcat Users List Subject: Re: Veritas Clustering for Tomcat On 30/11/2012 06:36, Sameera, Shaakunthala wrote: Hi, Is there a Veritas clustering agent available for Tomcat? A what? What does it do? [Shaakunthala: ] Veritas is a high availability clustering software by Symantec. My actual requirement is to integrate JIRA with Veritas and run in high availability mode. And, JIRA is only supported on Tomcat. An agent is a component which monitors the application and perform the failover whenever a problem occurs. As per the following page, currently there's no agent available. https://sort.symantec.com/agents Symantec want me to accept some kind of license agreement before looking at their website, which as I'm disinclined to use my time doing, I can't see what you're referring to. [Shaakunthala: ] Sorry about that. I found it on Wikipedia [ http://en.wikipedia.org/wiki/Veritas_Cluster_Server ]. Veritas clustering agents are available for Apache, JBoss and few other open source software as well. Wondering why there's no agent for Tomcat. Perhaps it's Symantec's job to develop the agent? Yup. I have not heard of their solution before. p Are there any alternatives? Perhaps you could explain what it is, what you're trying to achieve, give us a bit of context and then we can help. p -- [key:62590808] This e-mail transmission (inclusive of any attachments) is strictly confidential and intended solely for the ordinary user of the e-mail address to which it was addressed. It may contain legally privileged and/or CONFIDENTIAL information. The unauthorized use, disclosure, distribution printing and/or copying of this e-mail or any information it contains is prohibited and could, in certain circumstances, constitute an offence. If you have received this e-mail in error or are not an intended recipient please inform the sender of the email and MillenniumIT immediately by return e-mail or telephone (+94-11) 2416000. We advise that in keeping with good computing practice, the recipient of this e-mail should ensure that it is virus free. We do not accept responsibility for any virus that may be transferred by way of this e-mail. E-mail may be susceptible to data corruption, interception and unauthorized amendment, and we do not accept liability for any such corruption, interception or amendment or any consequences thereof. www.millenniumit.com - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: 答复: Re:Tomcat7.0-Setting property 'threadPriority' did not find a matching property
On 3 Dec 2012, at 05:43, Weixiang kurt.weixi...@huawei.com wrote: Thank you, after I changed 'java.lang.Thread#MAX_PRIORITY' to integer '10', the warning disappeared in tomcat 7. But I user 'java.lang.Thread#MAX_PRIORITY' in tomcat 6.0.35 and there's no any warning. So I was wondering whether the tomcat 6 block this warning or not? I'd be interested to hear about the load profile and application behaviour you are attempting to modify (improve?). p -邮件原件- 发件人: xueshengzj [mailto:xueshen...@163.com] 发送时间: 2012年12月3日 13:36 收件人: Tomcat Users List 主题: Re:Tomcat7.0-Setting property 'threadPriority' did not find a matching property Hi, have you seen the error that show it. It tell us that the property is not matched. The thread priority for threads in the executor, the default is Thread.NORM_PRIORITY. It should return integer. 在 2012-12-03 12:53:08,Weixiang kurt.weixi...@huawei.com 写道: Tomcat version:7.0.29 Question: I config in my server.xml for a HTTP Connector named “MGMT”: threadPriority=java.lang.Thread#Thread.MAX_PRIORITY When application is starting up,the catalina.out gives some warning information: WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'threadPriority' to 'java.lang.Thread#MAX_PRIORITY' did not find a matching property. I search on google and did not get any useful help; I also search documentation on the apache.org and make sure that 'threadPriority' is a legal attribute for HTTP Connector,so I wonder why would this warning information will come up. Please tell me what’s wrong, Thank you! Patch my server.xml for more information: ?xml version='1.0' encoding='utf-8'? !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- !-- Note: A Server is not itself a Container, so you may not define subcomponents such as Valves at this level. Documentation at /docs/config/server.html -- Server port=-1 shutdown=SHUTDOWN !-- Security listener. Documentation at /docs/config/listeners.html Listener className=org.apache.catalina.security.SecurityListener / -- !--APR library loader. Documentation at /docs/apr.html -- Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / !--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -- Listener className=org.apache.catalina.core.JasperListener / !-- Prevent memory leaks due to use of particular java/javax APIs-- Listener className=org.apache.catalina.core.JreMemoryLeakPreventionListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / Listener className=org.apache.catalina.core.ThreadLocalLeakPreventionListener / !-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html -- GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources !-- A Service is a collection of one or more Connectors that share a single Container Note: A Service is not itself a Container, so you may not define subcomponents such as Valves at this level. Documentation at /docs/config/service.html -- Service name=Catalina !--The connectors can use a shared executor, you can define one or more named thread pools-- !-- Executor name=tomcatThreadPool namePrefix=catalina-exec- maxThreads=150 minSpareThreads=4/ -- !-- A Connector represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080 --
Re: Tomcat 7 is not working on windows 7....
Hello Sir, I am Java Developer. i develop web application using servlet and JSP. My problem is that i am not able to get server started in eclipse Juno.using Tomcat 7 with windows 7. Please Guide me for the same Installation Process of tomcat 7 on windows 7 I was previously using Windows XP and everything was fine But with Windows 7 i am Having the problem Please guide me regarding this Thanks... Jugal Thakkar jugalthakkar1...@gmail.com
Re: Tomcat 7 is not working on windows 7....
On 03/12/2012 09:15, Jugal Thakkar wrote: Hello Sir, I am Java Developer. i develop web application using servlet and JSP. My problem is that i am not able to get server started in eclipse Juno.using Tomcat 7 with windows 7. Please Guide me for the same Installation Process of tomcat 7 on windows 7 I was previously using Windows XP and everything was fine But with Windows 7 i am Having the problem Please guide me regarding this Two options: 1. Read this: http://www.catb.org/esr/faqs/smart-questions.html and follow the excellent advice it offers. 2. Apply the following logic: - It worked on Windows XP - It doesn't work on Windows 7 - Therefore a bug in Windows 7 is the root cause - Either: a) Report the problem to Microsoft and get them to fix it b) Uninstall Windows 7 and re-install Windows XP Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 7 is not working on windows 7....
Jugal Thakkar wrote: Hello Sir, I am Java Developer. i develop web application using servlet and JSP. My problem is that i am not able to get server started in eclipse Juno.using Tomcat 7 with windows 7. Please Guide me for the same Installation Process of tomcat 7 on windows 7 I was previously using Windows XP and everything was fine But with Windows 7 i am Having the problem What problem ? Can you describe, step by step, starting from the download of the Tomcat that you are trying to install, what instructions you are following, what you are doing, and where exactly you have a problem ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Mod_jk - loadbalancer
Hi, I use mod_jk loadbalancing. (JkMount /WebApp/* loadbalancer ) I want to use only one loadbalancer. Can I set specific url after balancing ? For example, firstly every request will go to loadbalancer. Then if request is /WebApp/A*.com, it will go to node1. If request /WebApp/B*.com, it will go to node2 worker.loadbalancer.balance_workers=node1,node2. Regards,
Re: Mod_jk - loadbalancer
I use mod_jk loadbalancing. (JkMount /WebApp/* loadbalancer ) I want to use only one loadbalancer. Why are you using load balancing? Why do you want to use only one loadbalancer? Can I set specific url after balancing ? For example, firstly every request will go to loadbalancer. Then if request is /WebApp/A*.com, it will go to node1. If request /WebApp/B*.com, it will go to node2 Why do you not just proxy these requests and skip the load balancing? Confused Chris
Re: Mod_jk - loadbalancer
Orhan Karasakal wrote: Hi, I use mod_jk loadbalancing. (JkMount /WebApp/* loadbalancer ) I want to use only one loadbalancer. Can I set specific url after balancing ? For example, firstly every request will go to loadbalancer. Then if request is /WebApp/A*.com, it will go to node1. If request /WebApp/B*.com, it will go to node2 worker.loadbalancer.balance_workers=node1,node2. I may not understand correctly what you really want, but from your explanation above, it does not look like load balancing. What you seem to want is to forward some requests to one Tomcat back-end (worker1), and some others to another Tomcat back-end (worker2). If that is the case, you should do this : JkMount /Webapp/URL-1/* worker1 JkMount /Webapp/URL-2/* worker2 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Mod_jk - loadbalancer
I can solve the problem when I use more than loadbalancer. A lot of requests come our system so we use loadbalancer. But I want to send requests to specific nodes. Is not there any way while using one loadbalancer ? On Mon, Dec 3, 2012 at 11:57 AM, chris derham ch...@derham.me.uk wrote: I use mod_jk loadbalancing. (JkMount /WebApp/* loadbalancer ) I want to use only one loadbalancer. Why are you using load balancing? Why do you want to use only one loadbalancer? Can I set specific url after balancing ? For example, firstly every request will go to loadbalancer. Then if request is /WebApp/A*.com, it will go to node1. If request /WebApp/B*.com, it will go to node2 Why do you not just proxy these requests and skip the load balancing? Confused Chris
Re: Mod_jk - loadbalancer
But firstly I want to send requests to loadbalancer and then according to url, sending the other nodes. I have a lot of nodes and I have to use loadbalancer for every request On Mon, Dec 3, 2012 at 12:02 PM, André Warnier a...@ice-sa.com wrote: Orhan Karasakal wrote: Hi, I use mod_jk loadbalancing. (JkMount /WebApp/* loadbalancer ) I want to use only one loadbalancer. Can I set specific url after balancing ? For example, firstly every request will go to loadbalancer. Then if request is /WebApp/A*.com, it will go to node1. If request /WebApp/B*.com, it will go to node2 worker.loadbalancer.balance_**workers=node1,node2. I may not understand correctly what you really want, but from your explanation above, it does not look like load balancing. What you seem to want is to forward some requests to one Tomcat back-end (worker1), and some others to another Tomcat back-end (worker2). If that is the case, you should do this : JkMount /Webapp/URL-1/* worker1 JkMount /Webapp/URL-2/* worker2 --**--**- To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.orgusers-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 7 is not working on windows 7....
2012/12/3 Mark Thomas ma...@apache.org: On 03/12/2012 09:15, Jugal Thakkar wrote: Hello Sir, I am Java Developer. i develop web application using servlet and JSP. My problem is that i am not able to get server started in eclipse Juno.using Tomcat 7 with windows 7. Please Guide me for the same Installation Process of tomcat 7 on windows 7 I was previously using Windows XP and everything was fine But with Windows 7 i am Having the problem Please guide me regarding this Two options: 1. Read this: http://www.catb.org/esr/faqs/smart-questions.html and follow the excellent advice it offers. +1 2. Apply the following logic: - It worked on Windows XP - It doesn't work on Windows 7 - Therefore a bug in Windows 7 is the root cause - Either: a) Report the problem to Microsoft and get them to fix it b) Uninstall Windows 7 and re-install Windows XP There is also FAQ available, such as http://wiki.apache.org/tomcat/FAQ/Windows#Q8 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Mod_jk - loadbalancer
Orhan, 1) do not top-post. It is difficult to follow the logical flow of the conversation when you do that. Orhan Karasakal wrote: On Mon, Dec 3, 2012 at 12:02 PM, André Warnier a...@ice-sa.com wrote: Orhan Karasakal wrote: Hi, I use mod_jk loadbalancing. (JkMount /WebApp/* loadbalancer ) I want to use only one loadbalancer. Can I set specific url after balancing ? For example, firstly every request will go to loadbalancer. Then if request is /WebApp/A*.com, it will go to node1. If request /WebApp/B*.com, it will go to node2 worker.loadbalancer.balance_**workers=node1,node2. I may not understand correctly what you really want, but from your explanation above, it does not look like load balancing. What you seem to want is to forward some requests to one Tomcat back-end (worker1), and some others to another Tomcat back-end (worker2). If that is the case, you should do this : JkMount /Webapp/URL-1/* worker1 JkMount /Webapp/URL-2/* worker2 But firstly I want to send requests to loadbalancer and then according to url, sending the other nodes. I have a lot of nodes and I have to use loadbalancer for every request Then I believe that the answer to your question is : no, you cannot do that. Mod_jk does not foresee such a case, as far as I know. But mod_jk, like Tomcat, is open-source. So you could take the code and modify it as per your wishes. Or you could post an enhancement request. Or you could change your architecture, and introduce an intermediate level of load-balancing : 1st level : Apache httpd with mod_proxy_http and load-balancing, balances to 2d level : Apache httpd with mod_jk, balances to 3d level : Tomcat workers - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Mod_jk - loadbalancer
On 12/3/2012 11:18, Orhan Karasakal wrote: But firstly I want to send requests to loadbalancer and then according to url, sending the other nodes. Session affinity should handle that. But if you wish something else use some other loadbalancer, eg. mod_rewrite round-robin and multiple mod_jk workers. Regards -- ^TM - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Mod_jk - loadbalancer
Mladen Turk wrote: On 12/3/2012 11:18, Orhan Karasakal wrote: But firstly I want to send requests to loadbalancer and then according to url, sending the other nodes. Session affinity should handle that. Session affinity should ensure that once a session is started with one application on a particular worker, follow-up requests by the same browser to the same application should continue to go to the same tomcat worker. But it does not allow one to control to which worker the *first* request to a particular application will go, or does it ? But if you wish something else use some other loadbalancer, eg. mod_rewrite round-robin and multiple mod_jk workers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
?????? tomcat jdbc pool stackoverflow error used with spring
Thanks for help. I submit a bug here: https://issues.apache.org/bugzilla/show_bug.cgi?id=54235 Yanky -- -- ??: Konstantin Kolinkoknst.koli...@gmail.com; : 2012??12??2??(??) 6:24 ??: Tomcat Users Listusers@tomcat.apache.org; : Re: tomcat jdbc pool stackoverflow error used with spring 2012/12/2 ?? 22687...@qq.com: Hi: I'm evaluating jdbc pool after reading some blogs on tomcatexpert.com. But when I try to switch to jdbc pool from dbcp, I'm getting stackoverflow error like this: Caused by: java.lang.StackOverflowError at java.util.concurrent.AbstractExecutorService.init(AbstractExecutorService.java:71) at java.util.concurrent.ThreadPoolExecutor.init(ThreadPoolExecutor.java:1270) at java.util.concurrent.ThreadPoolExecutor.init(ThreadPoolExecutor.java:1163) at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:117) at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116) at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103) at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127) at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:86) at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDataSource(PooledConnection.java:224) at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:180) at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:699) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:631) at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:485) at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:143) at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116) at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103) at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127) at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:86) at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDataSource(PooledConnection.java:224) at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:180) at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:699) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:631) at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:485) at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:143) at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116) at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103) at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127) at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:86) at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDataSource(PooledConnection.java:224) and I noticed that someone had the same issue before but not answered: http://mail-archives.apache.org/mod_mbox/tomcat-users/201107.mbox/%3c32046311.p...@talk.nabble.com%3E my web app is a typical springmvc+hibernate application, and here is my applicationcontext datasource part: bean id=dataSource class=org.apache.tomcat.jdbc.pool.DataSource destroy-method=close property name=driverClassName value=${telregistry.jdbc.driverClassName} / property name=url value=${telregistry.jdbc.url}/ property name=username value=${telregistry.jdbc.username}/ property name=password value=${telregistry.jdbc.password}/ property name=initialSize value=5/ property name=initSQL value=SELECT 1/ property name=minIdle value=5/ property name=maxIdle value=50/ property name=maxActive value=100/ property name=maxWait value=6000/ property name=validationInterval value=180/ property name=validationQuery value=SELECT 1/ /bean my system: win7 32bit jdk1.7.0_9(also test on jdk1.6.0_25) mysql 5.5(also test oracle11g) spring 3.1.0 jdbc pool(tomcat-jdbc-7.0.30.jar from official maven repo) Also I test jdbc pool under tomcat7 as a container resource. It works. It seems that jdbc pool cannot come along with spring. 1. Please file an issue in Bugzilla. There were no fixes in jdbc-pool module between 7.0.30 and the current version 7.0.33, so the bug should still be there. 2. This is caused by property name=initialSize value=5/ in your configuration. The ConnectionPool.init(..) method tries to open those 5 connections and fails with a recursion. Best regards, Konstantin Kolinko - To unsubscribe, e-mail:
Re:[OT] tomcat 7 udp connector
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/2/12 1:04 AM, Jost Boekemeier wrote: I'm using gmail from android, which includes quoted text at the bottom. So I don't have much control over the layout. Sure you do. Scroll to the bottom of the message and tap after the final text. Don't blame your tools. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlC8s0MACgkQ9CaO5/Lv0PCrYgCghOq6R6Lzg0US6D9oGKsCx7PB hlIAni/VgzTbCucnljghdzVhpXWaZ5N3 =STJm -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat 7 udp connector
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jost, On 12/2/12 1:04 AM, Jost Boekemeier wrote: I won't explain php Java bridge. It's just a library which requires a jee (tomcat) environment. We currently have code, written in php, which comnunicates whith trackboxes (mostly systech a1) via udp/tcp and Java clients via http; in other words: we have a http server, written in php, which also accepts udp and tcp requests. We want to replace our proprietary code with standard components. Wer know that tomcat can handle http and tcp. But what's the best way to implement a udp listener? I guess I have to add a new connector. There is no getting around that: you *will* need to implement your own connector. Unfortunately, the existing connectors are all TCP-oriented so you are very unlikely to be able to re-use the connector (and protocol handler) base code that is used by the existing (BIO/NIO/APR) connectors which all require a reliable channel. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlC8tFQACgkQ9CaO5/Lv0PDNVQCeIJ7eKwkmE4sZc7/wgL/g5k9Z MfYAn1gie2DzObm8QobfH0XRDA9l6NSt =QVoY -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat 7 udp connector
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pid, On 12/1/12 8:13 PM, Pid wrote: On 01/12/2012 21:15, Jost Boekemeier wrote: Hi, I don't think tomcat is hard-wired the way you suggest. [sigh] Suggest? Tomcat, as does the Servlet Spec, focuses on web applications, ie ones served over HTTP. The Connector implementations are configurable, but there is no UDP implementation shipped with Tomcat. Nor is there a raw Servlet, TCP implementation. And the servlet spec doesn't require http. What a strange statement. The javax.servlet.http package, (being part of the spec), does rather seem to focus on it and the 3.0 spec mentions HTTP on a fairly large number of it's pages. To be fair, javax.servlet.Servlet does not require HTTP. Of course, 99% of the uses of a Java Servlet container are to serve HTTP requests. On the other hand, ServletRequest and ServletResponse (even in their non-HTTP flavors) are quite obviously set up to handle streaming, bidirectional connections. Sure, one could use DatagramSocket under the covers to implement something that looked like a streaming (and reliable) connection to the client, but since the servlet spec does not include any APIs for detecting/handling dropped packets, etc. it really is an odd choice to implement a UDP-based servlet (at least when using the spec definition of a servlet). In the past I've written a servlet container which uses raw tcp instead of http. I'd be interested in the architecture of such a beast: using an unreliable connection for binary and character streams via the servlet APIs seems untenable. The only way I would think it could work is if you simply ignored the unreliable nature of UDP and assumed that all messages would be successfully received and no problems would arise. In those cases where that's a good bet (for example, all communication is on localhost or even a local network), the cost of using TCP seems so small as to be not worth the development effort to support UDP. Probably the tomcat dev ml is more appropriate. The Tomcat devs are all active on this list. There is no need to post over there quite yet. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlC8uQQACgkQ9CaO5/Lv0PC0rQCgqV7e2gptSn1Yo0gt9P9HSksr bWUAnjqchRd1nQfb4CTTe01ON1xemaR4 =Maly -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Mod_jk - loadbalancer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Felix, On 12/3/12 6:49 AM, Felix Schumacher wrote: Am 03.12.2012 11:59, schrieb André Warnier: Mladen Turk wrote: On 12/3/2012 11:18, Orhan Karasakal wrote: But firstly I want to send requests to loadbalancer and then according to url, sending the other nodes. Session affinity should handle that. Session affinity should ensure that once a session is started with one application on a particular worker, follow-up requests by the same browser to the same application should continue to go to the same tomcat worker. But it does not allow one to control to which worker the *first* request to a particular application will go, or does it ? You may want to add jsessionid=.[JVMRoute] to your url. That way mod_jk will send your request to the right worker. +1 This is how you can, for instance, send a request to a specific backend but still use your load balancer. Note that it's the JVMroute, not the worker, that gets selected. So, if you have more than one worker with the same jvmroute, I'm not sure what will happen. That's probably not a valid configuration, anwyay. The other obvious solution is to just contact the back-end server directly. Since OP is using AJP, that's not entirely straightforward. If I were doing it, I would set up a separate URL space that went to specific back-end workers. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlC8wmQACgkQ9CaO5/Lv0PDadgCgrVdtOPb2JhZapUpV1+yWh8wO RdUAnjXCFJ1xrBVw+vqoBVdR3TcbfU0m =HPX2 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Mod_jk - loadbalancer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Orhan, On 12/3/12 8:10 AM, Orhan Karasakal wrote: If it is possible, then we set. Now we are not using this design :) I think, it is not possible. I disagree: the sane parts of your request are definitely possible. requests from /wepapp1/* - worker2,worker3 requests from /webapp2/* - worker1, worker4, worker5 httpd.conf JkMount /webapp1/* lb1 JkMount /webapp2/* lb2 workers.properties (seriously abridged) worker.lb1.balance_workers=worker2,worker3 worker.lb2.balance_workers=worker1,worker4,worker5 worker.worker1.jvmroute=tomcat1 worker.worker2.jvmroute=tomcat2 worker.worker3.jvmroute=tomcat3 worker.worker4.jvmroute=tomcat4 worker.worker5.jvmroute=tomcat5 If you want to make a request that will definitely go to worker5, then do this: curl http://hostname/webapp2/server-status;jsessionid=.tomcat5 But you obviously cannot do this: curl http://hostname/webapp1/server-status;jsessionid=.tomcat5 ...because tomcat5/worker5 isn't in the lb pool for /webapp1. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlC8wzsACgkQ9CaO5/Lv0PCfLgCcCEkR68W5SuLLb5wdT+JrbW+l aFcAnicJMYY0t7j77H20QIrZhdSIOoXg =P5gU -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Reuse JNDI Properties
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin, On 12/3/12 8:03 AM, Martin Gamper wrote: Hey everybody! I am looking for a solution to reuse a JNDI Property which is set in the context.xml : in my ${catalina.home}/conf/context.xml following Environment name=nodeName type=java.lang.String value=superFantasticNode override=false / I use this value for several different purposes. Now I want to define (for my J2EE application) another value for special Log- Files. And therefore I use another JNDI property ... and in this Property I'd like to reuse the previously set nodeName-variable. In my Fantasy it would work like this: Environment name=loggingPath value=${catalina.home}/logs/${nodeName}.log type=java.lang.String override=false / But it does not. Tomcat has a very limited set of cases where ${...} will do replacements for system properties. I think it's definitely worth filing an enhancement request for this kind of thing: it's a *very* useful feature to have. Do you know any solution (despite from changing my code) to achieve this? I would do a search-and-replace as part of the deployment process. Is this something that does into META-INF/context.xml (at the webapp level) or into conf/context.xml (at the server level)? If at the webapp level, you'd have to re-roll a WAR file for each server you want to target. That's not necessarily a big deal: you can script it with ant or even bash if you want (unzip, replace, update-zip). I guess the same thing could be done at the server level, though it would only have to be done once each time you install (or upgrade) Tomcat. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlC8xMwACgkQ9CaO5/Lv0PD/yACcDehCXdQwQv0DepMXvoKjNrIs YSEAoKuitDvT3ziCeV3tYh/nkSVMLRzn =5me9 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: 答复: Re:Tomcat7.0-Setting property 'threadPriority' did not find a matching property
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pid, On 12/3/12 3:35 AM, Pid * wrote: On 3 Dec 2012, at 05:43, Weixiang kurt.weixi...@huawei.com wrote: Thank you, after I changed 'java.lang.Thread#MAX_PRIORITY' to integer '10', the warning disappeared in tomcat 7. But I user 'java.lang.Thread#MAX_PRIORITY' in tomcat 6.0.35 and there's no any warning. So I was wondering whether the tomcat 6 block this warning or not? I'd be interested to hear about the load profile and application behaviour you are attempting to modify (improve?). If you increase the thread priority, the threads will run faster. Duh. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlC8xbYACgkQ9CaO5/Lv0PDZQACgnyQANWU+7/VY/JRob4sQePsw 8fsAoKMywENSuQA2GMEJ6kjkYULNIfO0 =pKNh -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: 答复: Re:Tomcat7.0-Setting property 'threadPriority' did not find a matching property
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Weixiang, On 12/3/12 12:42 AM, Weixiang wrote: Thank you, after I changed 'java.lang.Thread#MAX_PRIORITY' to integer '10', the warning disappeared in tomcat 7. But I user 'java.lang.Thread#MAX_PRIORITY' in tomcat 6.0.35 and there's no any warning. So I was wondering whether the tomcat 6 block this warning or not? Tomcat 6 silently ignores values it cannot set properly. In Tomcat 6, you are also *not* setting your thread priority to MAX_PRIORITY -- you just don't know it. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlC8xfwACgkQ9CaO5/Lv0PAC/QCglovQAm1bbQSHyhjSgi0VmWo7 1UsAoJAKNqCzxbmQxZhWqKkvxIf16yYx =q0Jc -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 7 is not working on windows 7....
On 12/3/2012 2:28 AM, Konstantin Kolinko wrote: 2012/12/3 Mark Thomas ma...@apache.org: On 03/12/2012 09:15, Jugal Thakkar wrote: Hello Sir, I am Java Developer. i develop web application using servlet and JSP. My problem is that i am not able to get server started in eclipse Juno.using Tomcat 7 with windows 7. Please Guide me for the same Installation Process of tomcat 7 on windows 7 I was previously using Windows XP and everything was fine But with Windows 7 i am Having the problem Please guide me regarding this Two options: 1. Read this: http://www.catb.org/esr/faqs/smart-questions.html and follow the excellent advice it offers. +1 +1 2. Apply the following logic: - It worked on Windows XP - It doesn't work on Windows 7 - Therefore a bug in Windows 7 is the root cause - Either: a) Report the problem to Microsoft and get them to fix it b) Uninstall Windows 7 and re-install Windows XP There is also FAQ available, such as http://wiki.apache.org/tomcat/FAQ/Windows#Q8 First of all, it works for me (although I mostly use NetBeans and mostly use Linux). 1. Install the appropriate JRE a. 1.6.0_37 32 bit or 64 bit depending on your system b. 1.7.0_09 32 bit or 64 bit depending on your system 2. Download and install the J2EE version of Eclipse Juno a. It's a zip file b. Unpack it in C:\Users\[username] [username] is your user name - don't use the square brackets it will make it's own directory c. Make shortcuts on the desktop and the start menu 3. Make a directory in C:\Users\[username] a. [username] is your user name - don't use the square brackets b. Call that directory Apache 4. Download Tomcat a. get the latest version (7.0.33 as I write this) b. get the zip file c. get the 32 bit or 64 bit depending on your system 5. Unpack the zip file in C:\Users\[username]\Apache a. this is the directory you made in step 3 b. it will create its own directory (apache-tomcat-7.0.33) 6. Edit C:\Users\[username]\Apache\apache-tomcat-7.0.33\conf\tomcat-users.xml a. Actually not necessary since Eclipse doesn't use the manager app b. However, you may want to use the manager app outside of Eclipse c. Make the contents of tomcat-users.xml like this: tomcat-users !-- roles -- role rolename=manager-gui/ role rolename=manager-script/ role rolename=manager-jmx/ role rolename=manager-status/ !-- users -- user name=manager password=password roles=manager-gui / user name=mgr-script password=password roles=manager-script/ user name=mgr-jmx password=password roles=manager-jmx/ user name=mgr-status password=password roles=manager-status/ /tomcat-users d. Note, I wrapped my lines so it would fit in email. e. Choose better passwords 7. Verify that Tomcat runs a. double-click on C:\Users\[username]\Apache\apache-tomcat-7.0.33\bin\startup.bat b. Browse to http://localhost:8080 c. See the Tomcat start page d. double-click on C:\Users\[username]\Apache\apache-tomcat-7.0.33\bin\shutdown.bat 8. Add server to Eclipse Juno a. Start Eclipse b. Open the Servers window (Windows-Show View-Others-Servers) c. Right-mouse click in the Servers window d. Choose New-Server e. Follow the Wizard You now have Tomcat 7.0.33 running from within Eclipse Juno. The keys are: 1. Do not install as a service 2. Install in your own directory, otherwise you'll be fighting UAC . . . . just my two cents. /mde/ (Beats packing and moving in the rain) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: 答复: Re:Tomcat7.0-Setting property 'threadPriority' did not find a matching property
On 03/12/2012 15:31, Christopher Schultz wrote: Pid, On 12/3/12 3:35 AM, Pid * wrote: On 3 Dec 2012, at 05:43, Weixiang kurt.weixi...@huawei.com wrote: Thank you, after I changed 'java.lang.Thread#MAX_PRIORITY' to integer '10', the warning disappeared in tomcat 7. But I user 'java.lang.Thread#MAX_PRIORITY' in tomcat 6.0.35 and there's no any warning. So I was wondering whether the tomcat 6 block this warning or not? I'd be interested to hear about the load profile and application behaviour you are attempting to modify (improve?). If you increase the thread priority, the threads will run faster. Duh. Quite. Alternatively, it might be the case that setting the thread priority will have no measurable effect at all. If any effect. The OP is trying to set the thread priority on what appears to be an HTTP connector (marked in a comment for 'management'). Of the 3 connectors configured, the config is as follows: port protocol threads accept 13089 BIO+HTTP 120 200 13080 NIO+HTTP 1200 2000 13443 NIO+HTTPS 200 2000 The value of the acceptCount attributes are bonkers, IMHO. This should never be larger than the number of threads in the pool - if the apps really need to support 1200 inbounds, either increase the number of threads or add another Tomcat instance. The HTTPS thread count value (being the default) *may* be accurate/appropriate or it might not, but it seems low given the other numbers. p -- [key:62590808] signature.asc Description: OpenPGP digital signature
RE: Tomcat with multiple domains
-Original Message- From: André Warnier [mailto:a...@ice-sa.com] Sent: Friday, November 30, 2012 9:11 AM To: Tomcat Users List Subject: Re: Tomcat with multiple domains Jeffrey Janner wrote: -Original Message- From: Paul van Hoven [mailto:paul.van.ho...@googlemail.com] Sent: Wednesday, November 28, 2012 5:29 PM To: Tomcat Users List Subject: Re: Tomcat with multiple domains Hi! Thanks for your quick and detailed answers. Actually I think I did all the things you mentioned but it still does not work. So here are the changes I made: 1. I checked that the following entries are in the engine tag: Server port=8005 shutdown=SHUTDOWN ... Service name=Catalina ... Engine name=Catalina defaultHost=localhost Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true [Jeff Janner] You need a /Host here. All elements must have a begin tag and an end tag! If there are no sub-elements, you can combine the begin and end tags as tagname ... /. Please find a good introductory reference on XML markup language before continuing. Host name=www.my2nddomain.com appBase=/opt/apache-tomcat-7.0.32/my2nddomain unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host Haaa. Good catch, Jeffrey. Everyone else missed that. So it probably swallowed the second Host's tags in the first, with who knows which results. Surprising that Tomcat still starts. You wouldn't believe how any times I've had to correct something like this for customer self-installs, even with what I think is proper documentation to guide them. It really does come down to understanding the structure of XML. Jeff - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Issues Logging wtith log4j at common and webapp levels
Well I managed to accomplish my goal 100% with the help of some new features in Log4j 2.x (currently beta-3). My eventual setup was to use the BasicContextSelector to ensure only a single logging heirarchy was created for the whole VM regardless of webapps. Then I tag events per-webapp using a ServletFilter to manipulate the ThreadContext, and send them all through a central RoutingAppender which in turn directs the entries (based on the tag) to the appropriate FileAppender. Since the tagging is done at the request level, both webapp specific classes, central libraries, and even VM-wide singletons used by a request all carry that tag (it uses ThreadLocal internally) and thus get routed properly. As for the remaining System.out calls in JSP files, separate Loggers are defined for those to capture the events created by swallowOutput (which don't carry the tag) and manually route them the appropriate FileAppender. Eventually that extra fluff can go away though. Another nice part about this is I only have a single instance of the logj4 libraries a single centralized configuration file, which is A Good Thing(tm) for this setup. Lots of other features in log4j2 that I was able to benefit from as well like dynamic reconfiguration and such, so I also set up my internal Tomcat logging (read: anything without a tag) to route into Tomcat's log. Sorry JULI, you just weren't good enough for me ;) On 02/10/2012 20:29, Mark Thomas wrote: Thanks for the clear question. While it was quite long, it was very readable, relevant and on point. That meant I got to the end rather than giving up after a few lines which is what usually happens with me and long questions. So in summary, I'm just trying to get shared libraries to have their log4j-based logging written to the webapp-specific log files of the calling webapp. Is this possible? If so, what's the trick? It can be done - with some caveats. Tomcat does this with Jasper. The short version is: - The loggers can not be static - There must be an instance of the class per web-app. If you have singletons and an instance per webapp doesn't make sense then the only option that comes to mind (after not much thinking) is that you need to pass the logger to the singleton rather than it using its own. HTH, Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Nagios plugin script for use with JMXProxy
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Athanasios, On 11/28/12 11:23 AM, Athanasios Kostopoulos wrote: On 28/11/12 17:19, Mark H. Wood wrote: On Tue, Nov 27, 2012 at 05:37:18PM -0500, Christopher Schultz wrote: I have developed a Perl script that can be used with Nagios to check on a Tomcat instance via the manager's JMXProxyServlet. Someone asked me to publish it, which I'm happy to do. I'm just wondering what the best thing to do is. Allow me to add my thanks! I see several options: 1. Submit a patch to the Tomcat source 2. Drop the file into the Tomcat wiki 3. Stick the file on Apache's related-projects stash -- I have forgotten the address at this point :( 4. Host it on my own website Maybe Nagios has a third-party plugins corral? Many thanks from me as well. Indeed Nagios has a third-party plugins corral, you can reach it at http://exchange.nagios.org/directory/Plugins There you can also find instruction there on how to submit your own project AFAICT, they do not provide hosting... only listings. So, I still need a place to actually put the code. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlC9B2gACgkQ9CaO5/Lv0PAKbwCgrO4t6vVjmVoisHCdA90RMPkE SswAn0D60IFK2Q2RqYycvnkLGO3qwrRJ =xC8p -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Issues Logging wtith log4j at common and webapp levels
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, On 12/3/12 1:57 PM, David Johle wrote: Well I managed to accomplish my goal 100% with the help of some new features in Log4j 2.x (currently beta-3). Holy crap, the log4j folks are finally going to release an update. After the abortive attempt some years ago, I'm glad they are once again pushing for a 2.0-release. ...and of course, I now have to change everything about the way I use log4j. :( - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlC9CVoACgkQ9CaO5/Lv0PDl9gCfU9o0jGC13Z2NyhaOKWBzXIr/ 3cUAoJz0tVZmVZulYQ/mT4TygxKkWJPe =cFYt -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Issues Logging wtith log4j at common and webapp levels
David Johle wrote: Well I managed to accomplish my goal 100% with the help of some new features in Log4j 2.x (currently beta-3). My eventual setup was to use the BasicContextSelector to ensure only a single logging heirarchy was created for the whole VM regardless of webapps. Then I tag events per-webapp using a ServletFilter to manipulate the ThreadContext, and send them all through a central RoutingAppender which in turn directs the entries (based on the tag) to the appropriate FileAppender. Since the tagging is done at the request level, both webapp specific classes, central libraries, and even VM-wide singletons used by a request all carry that tag (it uses ThreadLocal internally) and thus get routed properly. As for the remaining System.out calls in JSP files, separate Loggers are defined for those to capture the events created by swallowOutput (which don't carry the tag) and manually route them the appropriate FileAppender. Eventually that extra fluff can go away though. Another nice part about this is I only have a single instance of the logj4 libraries a single centralized configuration file, which is A Good Thing(tm) for this setup. Lots of other features in log4j2 that I was able to benefit from as well like dynamic reconfiguration and such, so I also set up my internal Tomcat logging (read: anything without a tag) to route into Tomcat's log. Sorry JULI, you just weren't good enough for me ;) I am not sure that I understand everything here (Tomcat logging has long been quite a puzzle for me), but I seem to perceive the hope of seeing a long-time dream come true, as a sysadmin with limited Tomcat/Java/Juli/log4j knowledge : setting up *one* logging configuration that will just swallow everything from Tomcat and webapps - no matter how sneaky - into preferably one logfile to start with, with a sensible rotation. And /then/ start refining, as needed. If so, many thanks. Would you care to enter the setup instructions in a WiKi article ? I'm willing to be the test pigeon with a couple of running Tomcats, own webapps, foreign webapps etc. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Context Path for a subdirectory
On 12/2/2012 4:54 AM, Konstantin Kolinko wrote: 2012/11/30 Terence M. Bandoian tere...@tmbsw.com: Hi, Chuck- I don't mean to be argumentative but, with Tomcat 6.0.29, I found that static files from an images subdirectory of a web application were not cached by Internet Explorer 7. As a workaround, I created a context for the images subdirectory and left it nested in the web application. The files from that directory were then cached by IE7. The difference was that the following response headers were included when there was no separate context defined for the subdirectory: Pragma: No-cache Cache-Control: no-cache Expires: Wed, 31 Dec 1969 18:00:00 CST Something else I found unusual was that ETag and Last-Modified headers were provided in both configurations. Apparently, some browsers (e.g. Firefox) utilize that information even when the no-cache and Expires headers are provided. I realize this is a non-standard configuration but it worked with 6.0.29 and 6.0.35. The no-cache headers are added to resources that are protected by a security constraint. That is for an obvious reason: if a resource is cached locally, you cannot protect it. It is usually a good idea to do not protect such static files. Regarding a.war/foo/bar vs a#foo.war/bar, Tomcat always selects a webapp first - one that matches the longest path. Then it selects a resource in the selected webapp. It is mentioned in the Introduction section of the config/context.html page of the Configuration Reference Guide. One example of using this rule is ROOT/admin/index.html page in Tomcat 5.5. When a user requests http://localhost:8080/admin/; and the admin webapp is not installed, the ROOT/admin/index.html page is called and says that no such application is here. If the admin webapp is installed, then its welcome page (admin/index.jsp) is displayed. Best regards, Konstantin Kolinko Hi, Konstantin- That makes sense. A security constraint was indeed defined for the main application using the URL pattern /*. However, no security constraints were defined for the subdirectory contexts and so the no-cache headers were eliminated. Thank you for the explanation. -Terence Bandoian - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Context Path for a subdirectory
___ From: Christopher Schultz [ch...@christopherschultz.net] Sent: Friday, November 30, 2012 8:13 PM To: Tomcat Users List Subject: Re: Context Path for a subdirectory -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Leo, On 11/30/12 5:52 PM, Leo Donahue - RDSA IT wrote: Ok, so before I upgraded to Tomcat 7.0.33 to use the container supplied remote address filter, what were my options to restrict access to just a subdirectory of a web app in Tomcat 6.0.35? Please remember that you aren't protecting a directory. Ever. You are protecting a url-pattern and nothing more. - -chris 1st, sorry for the format, I'm on vacation and webmail doesn't format replies the way I'd like. (sorry chuck, not taking your advice from before on getting out more. maybe tomorrow...) I have heard this before, and now I'm beginning to understand why I keep hearing this same comment. I now realize my choice of words in describing what I was trying to do leads to this comment. As many times as I've heard, you're not protecting a directory, and some other people use the phrase 'resource'... I always thought that there was some trick to getting by the url-pattern that no one wanted to mention. As far as the URL vs directory, the server is pretty locked down - so I'm told, and the IP I use is the IP of the host. Ultimately I wanted to restrict access to the URL /rest/admin to requests made by the local host only to that URL. webapps rest www admin Leo - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Context Path for a subdirectory
Leo Donahue - RDSA IT wrote: ___ From: Christopher Schultz [ch...@christopherschultz.net] Sent: Friday, November 30, 2012 8:13 PM To: Tomcat Users List Subject: Re: Context Path for a subdirectory -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Leo, On 11/30/12 5:52 PM, Leo Donahue - RDSA IT wrote: Ok, so before I upgraded to Tomcat 7.0.33 to use the container supplied remote address filter, what were my options to restrict access to just a subdirectory of a web app in Tomcat 6.0.35? Please remember that you aren't protecting a directory. Ever. You are protecting a url-pattern and nothing more. - -chris 1st, sorry for the format, I'm on vacation and webmail doesn't format replies the way I'd like. (sorry chuck, not taking your advice from before on getting out more. maybe tomorrow...) I have heard this before, and now I'm beginning to understand why I keep hearing this same comment. I now realize my choice of words in describing what I was trying to do leads to this comment. As many times as I've heard, you're not protecting a directory, and some other people use the phrase 'resource'... I always thought that there was some trick to getting by the url-pattern that no one wanted to mention. As far as the URL vs directory, the server is pretty locked down - so I'm told, and the IP I use is the IP of the host. Ultimately I wanted to restrict access to the URL /rest/admin to requests made by the local host only to that URL. webapps rest www admin Ok, so the way I would go about it, taking into acount my limited knowledge about webapp' security constraints and the like, but having written at least one servlet filter before : 1) your webapp is the rest webapp 2) inside that webapp, the url category which you want to protect against accesses by other client IP's than localhost is : /www/admin and /www/admin/*. (The /rest part falls off, because you are already inside of it). 3) you can for that write your own servlet filter, or use an existing one : see http://www.tuckey.org/urlrewrite/ 4) the basic plan is to insert a servlet filter into your webapp stack, which filter will only be active (inserted in the request processing chain) when a URL of the type in item (2) above is involved; and it will not be activated and play no role in other cases (e.g. for URL paths outside of /rest/www/admin) (*) 5) you configure this in the web.xml of your webapp (../webapps/rest/WEB-INF/web.xml) exactly as shown on the webpage indicated above, except for filter-mapping ... url-pattern/www/adminurl-pattern url-pattern/www/admin/*url-pattern ... /filter-mapping (*) The UrlRewriteFilter is probably a bit heavy-duty for the simple filtering which you want. But at the same time, it is well-written, well-tested, optimised, and you will probably benefit from knowing it, as it can do *much* more than what you need here. Writing your own filter is not very difficult, but if you have not done it before there are some particular aspects that need a bit of getting used to (such as for instance that the request object is immutable, and thus to modify the request - which you do not need here - you need to wrap it into your own version of it, and modify that one). This being said, it's fun. (*) I mean that it is the container that does the inserting or not of the filter, depending on these url-pattern lines, you do not have to take care of that. Inside of your filter code, you just filter every request you get our hands on,since you know that your code is only called when the request URL matches. And sorry if you knew all that already. It just did not sound that you were too sure. P.S. If you decide to use UrlRewriteFilter, you should be looking at the documentation (http://urlrewritefilter.googlecode.com/svn/trunk/src/doc/manual/4.0/index.html), and at a rule using this in the from part : remote-addr : The IP address of the host making the request, e.g. 123.123.123.12 i.e. request.getRemoteAddr() (you probably want to negate this, and check for not (127.0.0.1 or ::1)) and probably this in the to part : forward (default) : Requests matching the conditions for this rule, and the URL in the from element will be internally forwarded to the URL specified in the to element. Note: In this case the to URL must be in the same context as UrlRewriteFilter. This is the same as doing: RequestDispatcher rq = request.getRequestDispatcher([to value]); rq.forward(request, response); (to forward the miscreants to a no-no page of your choice.) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
How to use the usehttponly feature in application level
Sorry, I don't find any doc to introduce this. There are a lot of docs to show how to implement the feature in conf/context.xml. Context useHttpOnly=true ... /Context Who can tell me how to implement the feature in application level? For example, I have 2 applications in the Tomcat server. One is named HelloWorld, the other is named HiWorld. I hope the HelloWorld should use the usehttponly feature, the other is not. Any advice is appreciated. -- Best Regards Gary
Re: How to use the usehttponly feature in application level
Hi Zhi, You can set following parameters in web.xml of application. session-config cookie-config http-onlytrue/http-only securetrue/secure /cookie-config /session-config Regards, Vidyadhar --Original Message-- From: Zhi Xie To: users@tomcat.apache.org ReplyTo: Tomcat Users List Subject: How to use the usehttponly feature in application level Sent: Dec 4, 2012 10:43 Sorry, I don't find any doc to introduce this. There are a lot of docs to show how to implement the feature in conf/context.xml. Context useHttpOnly=true ... /Context Who can tell me how to implement the feature in application level? For example, I have 2 applications in the Tomcat server. One is named HelloWorld, the other is named HiWorld. I hope the HelloWorld should use the usehttponly feature, the other is not. Any advice is appreciated. -- Best Regards Gary Sent on my BlackBerry® from Vodafone - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Mod_jk - loadbalancer
lb1 and lb2 are two loadbalancer, are not they ? But I want to have only one loadbalancer. This design cannot be possible, only I want to know On Mon, Dec 3, 2012 at 5:20 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Orhan, On 12/3/12 8:10 AM, Orhan Karasakal wrote: If it is possible, then we set. Now we are not using this design :) I think, it is not possible. I disagree: the sane parts of your request are definitely possible. requests from /wepapp1/* - worker2,worker3 requests from /webapp2/* - worker1, worker4, worker5 httpd.conf JkMount /webapp1/* lb1 JkMount /webapp2/* lb2 workers.properties (seriously abridged) worker.lb1.balance_workers=worker2,worker3 worker.lb2.balance_workers=worker1,worker4,worker5 worker.worker1.jvmroute=tomcat1 worker.worker2.jvmroute=tomcat2 worker.worker3.jvmroute=tomcat3 worker.worker4.jvmroute=tomcat4 worker.worker5.jvmroute=tomcat5 If you want to make a request that will definitely go to worker5, then do this: curl http://hostname/webapp2/server-status;jsessionid=.tomcat5 But you obviously cannot do this: curl http://hostname/webapp1/server-status;jsessionid=.tomcat5 ...because tomcat5/worker5 isn't in the lb pool for /webapp1. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlC8wzsACgkQ9CaO5/Lv0PCfLgCcCEkR68W5SuLLb5wdT+JrbW+l aFcAnicJMYY0t7j77H20QIrZhdSIOoXg =P5gU -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org