Re: symlinks in webapps

2008-09-06 Thread Claudio Tassini
> I don't think that's true - each directory or .war file in the appBase
> directory will cause a separate application deployment, which is what I
> thought you wanted.


As you may have noted, I am not a Tomcat expert so you are probably right.
But my app logs in catalina.out when it reads its config files, and when I
made a symlink in webapps/ to the same webapp it happened just once, while
if I create more contexts blocks in server.xml it loads as many times as are
the "instances". Another evidence is that the app create a connection pool
of 10 connections to an LDAP server, and with the server just started I have
exactly 20 established connections , while I was used to only 10 with the
old "method".

1) Implement a valve or filter that catches references to the alternate URLs
> and redirects or forwards them to the primary.
>
I am going to study how to accomplish this. Will let you know.


>
> 2) Create dummy webapps for the alternate URLs that contain nothing but an
> index.html page that redirects to the primary.
>
This does not sound really "clean" :) I will keep it as last resort...


-- 
Claudio Tassini


Re: symlinks in webapps

2008-09-06 Thread Claudio Tassini
>
>
> The second context xml file, named secondInstance.xml (URL would be
> http://localhost:8080/secondInstance):
>   
>

This don't work. It seems that with tomcat > 5.0 you can't point a context's
docBase to something INSIDE the appBase directory when using context files
in conf/[Engine name]/[Host name]/[context].xml . You must add them to
server.xml, which is discouraged.

-- 
Claudio Tassini


Re: symlinks in webapps

2008-09-06 Thread Claudio Tassini
FYI, If I add several  blocks each
with a different path , in my server.xml, it seems to work . The problem is
that it's discouraged in tomcat's documentation, and anyway it causes my app
to start several times, while with a simple symlink I had the same webapp
referenced as many times as I wished without multiplying the load on the
server (the app starts ldap pools... db pools and so on...).
On Sat, Sep 6, 2008 at 6:34 PM, Claudio Tassini
<[EMAIL PROTECTED]>wrote:

> Don't seem to work. It seems that I can't use a docBase in a context.xml
> that points to something under the appBase directory, as it's simply ignored
> and tomcat assumes that the docbase is in /webapps :
> Sep 6, 2008 6:23:28 PM org.apache.catalina.startup.HostConfig
> deployDescriptor
> WARNING: A docBase /opt/webmail-portal-tomcat/webapps/WebMail inside the
> host appBase has been specified, and will be ignored
> Sep 6, 2008 6:23:28 PM org.apache.catalina.core.StandardContext
> resourcesStart
> SEVERE: Error starting static Resources
> java.lang.IllegalArgumentException: Document base
> /opt/webmail-portal-tomcat/webapps/WebMail2 does not exist or is not a
> readable directory
>
>
> On Fri, Sep 5, 2008 at 9:05 PM, Caldarale, Charles R <
> [EMAIL PROTECTED]> wrote:
>
>> > From: Claudio Tassini [mailto:[EMAIL PROTECTED]
>> > Subject: symlinks in webapps
>> >
>> > The goal is to have the same webapp referenced by
>> > two contexts
>>
>> Rather than use symlinks, try using an additional  element in
>> conf/Catalina/[host]/WebMail2.xml:
>>
>> 
>>
>> (Include whatever else is needed from the META-INF/context.xml file, if
>> there is one.  Do NOT use a path attribute.)
>>
>> Haven't tried this exact situation, but I think it should work... (famous
>> last words).
>>
>>  - Chuck
>>
>>
>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
>> MATERIAL and is thus for use only by the intended recipient. If you received
>> this in error, please contact the sender and delete the e-mail and its
>> attachments from all computers.
>>
>> ---------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> Claudio Tassini
>



-- 
Claudio Tassini


Re: symlinks in webapps

2008-09-06 Thread Claudio Tassini
Don't seem to work. It seems that I can't use a docBase in a context.xml
that points to something under the appBase directory, as it's simply ignored
and tomcat assumes that the docbase is in /webapps :
Sep 6, 2008 6:23:28 PM org.apache.catalina.startup.HostConfig
deployDescriptor
WARNING: A docBase /opt/webmail-portal-tomcat/webapps/WebMail inside the
host appBase has been specified, and will be ignored
Sep 6, 2008 6:23:28 PM org.apache.catalina.core.StandardContext
resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
/opt/webmail-portal-tomcat/webapps/WebMail2 does not exist or is not a
readable directory


On Fri, Sep 5, 2008 at 9:05 PM, Caldarale, Charles R <
[EMAIL PROTECTED]> wrote:

> > From: Claudio Tassini [mailto:[EMAIL PROTECTED]
> > Subject: symlinks in webapps
> >
> > The goal is to have the same webapp referenced by
> > two contexts
>
> Rather than use symlinks, try using an additional  element in
> conf/Catalina/[host]/WebMail2.xml:
>
> 
>
> (Include whatever else is needed from the META-INF/context.xml file, if
> there is one.  Do NOT use a path attribute.)
>
> Haven't tried this exact situation, but I think it should work... (famous
> last words).
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Claudio Tassini


symlinks in webapps

2008-09-05 Thread Claudio Tassini
Hi guys,
I'm trying to make a link to an app inside the webapps directory in tomcat
6.0.18 . The goal is to have the same webapp referenced by two contexts, and
this worked fine in 5.x . In 6.x, if I make a symlink to a webapp in the
webapps directory, the app fails to start:

[EMAIL PROTECTED] webapps]# ln -s WebMail WebMail2
[EMAIL PROTECTED] webapps]# ls -l
total 24
drwxr-xr-x  11 mwtomcat mwtomcat 4096 Sep  3 10:57 docs
drwxr-xr-x   5 mwtomcat mwtomcat 4096 Sep  3 10:57 examples
drwxr-xr-x   5 mwtomcat mwtomcat 4096 Sep  3 10:57 host-manager
drwxr-xr-x   5 mwtomcat mwtomcat 4096 Sep  3 10:57 manager
drwxr-xr-x   3 mwtomcat mwtomcat 4096 Sep  3 10:57 ROOT
drwxr-xr-x   6 mwtomcat mwtomcat 4096 Aug 28 15:32 WebMail
lrwxrwxrwx   1 root root7 Sep  5 10:06 WebMail2 -> WebMail

Sep 5, 2008 10:07:07 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Sep 5, 2008 10:07:07 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/WebMail] startup failed due to previous errors

I've tried to add the allowLinking property in context.xml (in the default
conf/context.xml and in the META-INF/context.xml of my webapp... just to be
sure), but it don't work. I guess that allowLinking allows to make links
from inside the context to other places in the filesystem, not to link the
context itself to another webapp.
I found this very useful in tests environment. Is there a way to achieve
this in tomcat 6?

-- 
Claudio Tassini


mod_jk sticky sessions don't work

2007-08-02 Thread Claudio Tassini
Hi all!
I'm trying to configure mod_jk to handle balance two apache-tomcat instances
through an Apache "reverse proxy", i read all the documentation, reference
guides and howtos i found but it still doesn't work...

Below are some configuration I'm using. The symptoms are that I connect with
a browser to a jsp page that prints out the tomcat server that is managing
the session, and the relative session ID. Every time I refresh the page, the
server name and the sessionID change.

I'm using apache httpd 2.2.4 build from source, mod_jk 1.2.23 and
apache-tomcat 5.5.23 . Now, this is the httpd.conf (relevant parts only):


JkWorkersFile /usr/local/apache2/conf/workers.properties
JkShmFile /usr/local/apache2/logs/mod_jk.shm
JkLogFile /usr/local/apache2/logs/mod_jk.log
JkLogLeveldebug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories
JkRequestLogFormat "%w %V %T"
NameVirtualHost *:80


ServerName  portal.domain.it
JkMount /status status
JkMount /*  test


The workers.properties:

worker.list=test
worker.portal1.port=8009
worker.portal1.host=inca-portal1
worker.portal1.type=ajp13
worker.portal1.lbfactor=1
worker.portal2.port=8009
worker.portal2.host=inca-portal2
worker.portal2.type=ajp13
worker.portal2.lbfactor=1
worker.test.type=lb
worker.test.balance_workers=portal1,portal2
worker.test.sticky_session=True


And, finally, I changed the tomcat server.xml file:




Finally, this is a piece of the log saying that he founds a certain session
ID, and then he sends the request to the other server which then obviously
sets a new JSESSIONID... :
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
map_uri_to_worker::jk_uri_worker_map.c (589): Attempting to map URI
'/jsp-examples/sesstest.jsp' from 2 maps
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
map_uri_to_worker::jk_uri_worker_map.c (601): Attempting to map context URI
'/status=status' source 'JkMount'
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
map_uri_to_worker::jk_uri_worker_map.c (601): Attempting to map context URI
'/*=test' source 'JkMount'
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
map_uri_to_worker::jk_uri_worker_map.c (616): Found a wildchar match
'/*=test'
[Thu Aug 02 16:52:09 2007] [1970:8] [debug] jk_handler::mod_jk.c (2111):
Into handler jakarta-servlet worker=test r->proxyreq=0
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
wc_get_worker_for_name::jk_worker.c (114): found a worker test
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
maintain_workers::jk_lb_worker.c (543): decay with 2^38
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
wc_get_name_for_type::jk_worker.c (290): Found worker type 'lb'
[Thu Aug 02 16:52:09 2007] [1970:8] [debug] init_ws_service::mod_jk.c
(607): Service protocol=HTTP/1.1 method=GET host=(null) addr=192.168.10.2name=
portal.inca.it port=80 auth=(null) user=(null) laddr=192.168.10.201 raddr=
192.168.10.2
[Thu Aug 02 16:52:09 2007] [1970:8] [debug] service::jk_lb_worker.c
(915): service sticky_session=1 id='64EEDE6D4E3C9EF3A2048741CDA5C189'
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
get_most_suitable_worker::jk_lb_worker.c (767): searching worker for partial
sessionid 64EEDE6D4E3C9EF3A2048741CDA5C189
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
get_most_suitable_worker::jk_lb_worker.c (819): found best worker portal2
(portal2) using method 'Request'
[Thu Aug 02 16:52:09 2007] [1970:8] [debug] service::jk_lb_worker.c
(935): service worker=portal2 route=portal2
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
ajp_get_endpoint::jk_ajp_common.c (2343): acquired connection pool slot=0
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
ajp_marshal_into_msgb::jk_ajp_common.c (548): ajp marshaling done
[Thu Aug 02 16:52:09 2007] [1970:8] [debug] ajp_service::jk_ajp_common.c
(1796): processing portal2 with 2 retries
[Thu Aug 02 16:52:09 2007] [1970:8] [debug] ws_write::mod_jk.c (452):
written 274 out of 274
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
ajp_connection_tcp_get_message::jk_ajp_common.c (1043): received from ajp13
pos=0 len=2 max=8192
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
ajp_connection_tcp_get_message::jk_ajp_common.c (1043): 05 01 00 00
00 00 00 00 00 00 00 00 00 00 00 00  - 
[Thu Aug 02 16:52:09 2007] [1970:8] [debug]
ajp_process_callback::jk_ajp_common.c (1506): AJP13 protocol: Reuse is OK
[Thu Aug 02 16:52:09 2007] [1970:8] [debug] ajp_done::jk_ajp_common.c
(2286): recycling connection pool slot=0 for worker portal2
[Thu Aug 02 16:52:09 2007] test portal.inca.it 0.005241
[Thu Aug 02 16:52:09 2007] [1970:8] [debug] jk_handler::mod_jk.c (2238):
Service finished with status=200 for worker=test


Any help would be REALLY appreciated!


Fi

-- 
Claudio Tassini