Re: running tomcat on a particular network interface and a particular port

2007-04-17 Thread Erik Melkersson

Are you starting it as non-root?
Only root has the ability to bind to ports 1024.

Regards /Erik Melkersson

Faheem Mitha wrote:


Hi,

I can now get tomcat to run an ssl connector at port 8443 (Debian 
default), but doesn't work if I try to run it at 443.


The log says:

Apr 17, 2007 12:31:19 AM org.apache.catalina.startup.Catalina start
SEVERE: Catalina.start:
LifecycleException:  service.getName(): Catalina;  Protocol handler 
start failed: java.net.BindExc

eption: Permission denied:443
at 
org.apache.catalina.connector.Connector.start(Connector.java:1096)

...
Any idea what I am missing? I don't think the problem is that apache is 
blocking 443, because when I turn off apache, I get the same error. In 
any case, I have configured apache to listen only at the 
florence.dulci.org:443 interface.


Is there an easy way to discover what is listening on a particular port 
on a particular IP address?


Thanks.Faheem.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



mod_jk, timeout values, best practices

2007-04-04 Thread Erik Melkersson

Hi!

I've experimenting with different timeout values, to mod_jk. I have not 
yet been able to make it work the way I want.


I have one apache and two tomcat. I have set up tomcat1 to be the 
primary and tomcat2 the failover.


What I want to achieve is if at least one tomcat is up I want it to work 
but if both are down (either tomcat or ip, crashed or blocked by a 
firewall dropping packets) i want mod_jk to serve an error page as 
quickly as possible, in my opinion it should be immediate. The thing is 
also that there are a few requests that actually do take some seconds 
(10-20 maybe) before they return a page and we do not want these to time 
out.


The first part is no problem: As long as _at least_ one tomcat is 
working and accessible by the mod_jk it works fine. (Even if I turn the 
tomcats on and off and block one by using a firewall during runtime.)


The part I can't get to work is if both tomcats are unavailable by the 
mod_jk. The request is stalled and waiting a lot of or infinite time 
before returning the error page. (In my test case I have blocked both by 
a dropping firewall, which in our case can be a realistic problem.)


Versions:
Apache/1.3.33 (Debian GNU/Linux)
mod_jk/1.2.21
tomcat 5.5.x

My questions:
* Can anyone help me on what timeout values to use i worker.properties?
* Does anyone know about a best practices-page on timeout values on 
mod_jk?
* Is there a description about how the connection handling between the 
mod_jk works and how the timeouts fit in?



... and yes I have read about the timeout properties
http://tomcat.apache.org/connectors-doc/reference/workers.html
about the ajp spec
http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html
and searched for best practices and working examples on the net.

Thanks in advance for any help
Erik Melkersson

*httpd.conf*
Location /test/cms/
  SetEnv JK_WORKER_NAME cms
  SetHandler jakarta-servlet
  ErrorDocument 503 /index-cmsfail.html
/Location


*worker.properties (as it looked during my last test, infinite waiting)*
worker.list=cms,jkstatus

worker.jkstatus.type=status

worker.cms.type=lb
worker.cms.balance_workers=cmsfront1,cmsfront2

worker.cmsfront1.type=ajp13
worker.cmsfront1.host=polopoly9-front1.unit.liu.se
worker.cmsfront1.port=8009
worker.cmsfront1.lbfactor=1
worker.cmsfront1.redirect=cmsfront2
#worker.cmsfront1.socket_timeout=60
#worker.cmsfront1.connect_timeout=2000
worker.cmsfront1.prepost_timeout=1000
#worker.cmsfront1.reply_timeout=3

worker.cmsfront2.type=ajp13
worker.cmsfront2.host=polopoly9-front2.unit.liu.se
worker.cmsfront2.port=8009
worker.cmsfront2.lbfactor=1
worker.cmsfront2.activation=disabled
#worker.cmsfront2.socket_timeout=60
#worker.cmsfront2.connect_timeout=2000
worker.cmsfront2.prepost_timeout=1000
#worker.cmsfront2.reply_timeout=3

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mod_jk/1.2.21, jkstatus does not display runtime state of load balanced threads, only N/A

2007-04-04 Thread Erik Melkersson
I have now been able to make it work on another minimalistic server 
using the same worker.properties. It displays the runtime state. Now I 
only have to find out what differs, that makes the status worker fail 
getting runtime state. (It's a lot that differs so that may take a long 
time :-/ )

Regards Erik Melkersson

Rainer Jung wrote:

Please open a bugzilla issue ...

Erik Melkersson schrieb:

Thanks for the info but unfortunately I don't think that is is case for
me. I surfed to a mapped address and got pages back from the tomcat
trough the workers and still had N/A as state. I've also used it and got
an error message back (both tomcats blocked) but the state was still N/A.

As I haven't changed the maintenance interval it should still be 60 secs.

Regards Erik Melkersson


Rainer Jung wrote:

N/A as a state means, that no requests have been sent to this worker
for some time. So mod_jk is not really able to tell you about the
state of the worker. It can only detect OK, ERROR etc. when it is
sending requests to the workers. No requests, no state.

A worker will be in state N/A directly after starting Apache or if it
was in state OK, but didn't get any requests during a complete
maintenance interval. This is per default 60 seconds.

Regards,

Rainer


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mod_jk/1.2.21, jkstatus does not display runtime state of load balanced threads, only N/A

2007-03-26 Thread Erik Melkersson
Thanks for the info but unfortunately I don't think that is is case for 
me. I surfed to a mapped address and got pages back from the tomcat 
trough the workers and still had N/A as state. I've also used it and got 
an error message back (both tomcats blocked) but the state was still N/A.


As I haven't changed the maintenance interval it should still be 60 secs.

Regards Erik Melkersson


Rainer Jung wrote:
N/A as a state means, that no requests have been sent to this worker for 
some time. So mod_jk is not really able to tell you about the state of 
the worker. It can only detect OK, ERROR etc. when it is sending 
requests to the workers. No requests, no state.


A worker will be in state N/A directly after starting Apache or if it 
was in state OK, but didn't get any requests during a complete 
maintenance interval. This is per default 60 seconds.


Regards,

Rainer


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat mod_proxy_ajp and jk exceptions

2007-03-25 Thread Erik Melkersson

and while we're on the subject, what's the difference b/w proxyPass and
ProxyPassReverse in laymens terms?


I think thats a question for the Apache-web server mailinglist but...

ProxyPass forwards the request from the user to another web server
ProxyPassReverse rewrites the response from the other server before it 
comes to the user. (domain names in redirect-headers etc)


/Erik Melkersson


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using the jk connector to join different tomcat contexts with discrete urls

2007-03-23 Thread Erik Melkersson

Hi!

Actually I never got JkMount to work, so I would say something like:

VirtualHost *:80
ServerName app1.example.com

# you do not want to have a loop
RewriteCond %{REQUEST_FILENAME} !^/app1/
RewriteRule ^/(.*)$ /app1/$1 [PT]

  Location /app1/
SetEnv JK_WORKER_NAME worker_for_app1
SetHandler jakarta-servlet
  /Location
/VirtualHost

/Erik

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mod_jk/1.2.21, jkstatus does not display runtime state of load balanced threads, only N/A

2007-03-22 Thread Erik Melkersson
Does anyone recognize my problem about the runtime state that never is 
displayed or did it work for you out-of-the-box?


Regards Erik Melkersson

Erik Melkersson wrote:

Hi!
I've got an apache (1.3.33) with mod_jk (1.2.21) connecting to two 
tomcats (5.5.17) on other servers using a load balacer. (All running 
debian.) I also have mounted a jkstatus on a directory.


My problem is that the jkstatus is never displaying the runtime state of 
the workers. I always get N/A in the Balancer Members under the 
Stat column.


I've started it with working tomcats, tomcats blocked by a firewalls and 
pointing towards localhost (that doesn't have any tomcats at all) but 
all i get is N/A.


...

worker.properties
*
worker.list=cms,jkstatus

worker.jkstatus.type=status

worker.cms.type=lb
worker.cms.balance_workers=cmsfront2,cmsfront3

worker.cmsfront2.type=ajp13
worker.cmsfront2.host=nnn.nnn.nnn.nnn
worker.cmsfront2.port=8009
worker.cmsfront2.lbfactor=1
worker.cmsfront2.redirect=cmsfront3

worker.cmsfront3.type=ajp13
worker.cmsfront3.host=nnn.nnn.nnn.nnn
worker.cmsfront3.port=8009
worker.cmsfront3.lbfactor=1
worker.cmsfront3.activation=disabled


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using the jk connector to join different tomcat contexts with discrete urls

2007-03-22 Thread Erik Melkersson

Hi!
I wanted to do something similar. (but without the two virtual hosts).

I did like this:

# The directory the user sees
RewriteRule ^/test/aaa/(.*) /tomcat-dir/$1 [PT]
RewriteRule ^/test/bbb/(.*) /tomcat-dir/stuff/$1 [PT]

# The directory tomcat serves the stuff on:
Location /tomcat-dir/
  SetEnv JK_WORKER_NAME workername
  SetHandler jakarta-servlet
/Location



David Harrison wrote:

I wish to map different Apache urls across to specific Tomcat contexts,
for example:
http://app1.example.com/ to TOMCAT/app1.
http://app2.example.com/ to TOMCAT/app2


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How do I get the http://localhost/jkstatus page to display/installed

2007-03-22 Thread Erik Melkersson

A quick example is found at the last chapter of:
http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
(but they use jkmanager as mount point)
/Erik Melkersson


I have installed apache 2.2.4 with mod_jk.so and 2 instances of tomcat

5.5.17 in a cluster.  As I read examples I see that I should be able to
access http://localhost/jkstatus/.  I have set up the mod_jk.so in the
httpd.conf file and set up the worker.properties file.  When I enter the
url for http://localhost/jkstatus/ http://%3capache%3e/jkstatus  I get
a not found error.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



mod_jk/1.2.21, jkstatus does not display runtime state of load balanced threads, only N/A

2007-03-21 Thread Erik Melkersson

Hi!
I've got an apache (1.3.33) with mod_jk (1.2.21) connecting to two 
tomcats (5.5.17) on other servers using a load balacer. (All running 
debian.) I also have mounted a jkstatus on a directory.


My problem is that the jkstatus is never displaying the runtime state of 
the workers. I always get N/A in the Balancer Members under the 
Stat column.


I've started it with working tomcats, tomcats blocked by a firewalls and 
pointing towards localhost (that doesn't have any tomcats at all) but 
all i get is N/A.


I've read all I could find on http://tomcat.apache.org/connectors-doc/ 
but without result and no good hits using google. (jkstatus I find, but 
info on the state is worse).


Am I missing something obvious somewhere?

I'll paste my settings below in case someone can help me.

Btw: Thanks to the people who wrote and added stuff to:
http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
Really nice page, setting it up initially worked very well following the 
instructions there.


Regards Erik Melkersson



httpd.conf:
**
LoadModule jk_module /usr/lib/apache/1.3/mod_jk.so
JkWorkersFile conf/workers.properties
JkShmFile logs/httpd/mod_jk.shm
JkLogFile logs/mod_jk.log
JkLogLevelinfo
JkLogStampFormat [%a %b %d %H:%M:%S %Y] 

Location /test/jkmanager/
JkMount jkstatus
Order deny,allow
Deny from all
Allow from [nnn.nnn.nnn.nnn]
/Location
Location /test/cms/
  SetEnv JK_WORKER_NAME cms
  SetHandler jakarta-servlet
  ErrorDocument 503 /index-cmsfail.html
/Location

worker.properties
*
worker.list=servlethotel,cms,jkstatus

worker.jkstatus.type=status

worker.servlethotel.type=ajp13
worker.servlethotel.host=nnn.nnn.nnn.nnn
worker.servlethotel.port=8009
worker.servlethotel.socket_timeout=10

worker.cms.type=lb
worker.cms.balance_workers=cmsfront2,cmsfront3

worker.cmsfront2.type=ajp13
worker.cmsfront2.host=nnn.nnn.nnn.nnn
worker.cmsfront2.port=8009
worker.cmsfront2.lbfactor=1
worker.cmsfront2.redirect=cmsfront3

worker.cmsfront3.type=ajp13
worker.cmsfront3.host=nnn.nnn.nnn.nnn
worker.cmsfront3.port=8009
worker.cmsfront3.lbfactor=1
worker.cmsfront3.activation=disabled

# Note: the servlethotel-worker is pointing to another tomcat and
# should not be involved but it is in my file so I let it be there
# for completeness sake


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]