Re: Tomcat, Apache web-server : Simultaneously running both servers and Virtual Hosting.

2015-12-08 Thread Kernel freak
Hi Chris,

I just saw your mail, although I was able to solve this problem yesterday
before leaving. This is what I did. I just waned to know, if this
configuration will also work if I am using https. Thank you.

Here is what I did :

Tomcat's server.xml :


 


 

  

   // Multiple webapps hosted



Added this in jk.conf :



JkWorkersFile   /PATH/to/workers.properties
JkLogFile   /var/log/apache2/mod_jk.log
JkLogLevel  notice
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions   +ForwardURIProxy
JkMountFile /path/to/uriworkermap.properties


workers.properties :


worker.list = worker_app1
worker.worker_app1.type = lb
worker.worker_app1.balance_workers = app1_instance1
worker.worker_app1.sticky_session = true
worker.worker_app1.sticky_session_force = false
worker.worker_app1.method = busyness

worker.app1_instance1.type = ajp13
worker.app1_instance1.host = 127.0.0.1
worker.app1_instance1.port = 8010
worker.app1_instance1.host = localhost
worker.app1_instance1.lbfactor = 1
worker.app1_instance1.socket_timeout = 40
worker.app1_instance1.socket_keepalive = true
worker.app1_instance1.reply_timeout = 3

uriworkermap.properties :


/|/* = worker_app1;

Added this to 000-default in sites-enabled

// This is the tomcat domain.

ServerName www.domain_tomcat_webapp.de
ServerAlias domain_tomcat_webapp.de
ProxyRequests on
ProxyPreserveHost On

Order deny,allow
Allow from all


ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/


Order allow,deny
Allow from all





Will this config also work if the the request made is in https? Kindly
let me know. Thanks a lot. :-)







On Mon, Dec 7, 2015 at 8:55 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Akshay,
>
> On 12/7/15 2:53 PM, Christopher Schultz wrote:
> > Akshay,
> >
> > On 12/7/15 5:26 AM, Kernel freak wrote:
> >>  >> protocol="org.apache.coyote.http11.Http11NioProtocol"
> >> compression="force" compressionMinSize="1024"
> >>connectionTimeout="2"  maxPostSize="5242880"
> >>URIEncoding="utf-8"
> >>  compressableMimeType="text/html,text/xml,text/plain,text/css,text/
> >> javascript,application/x-javascript,application/javascript"/>
> >>
> >>
> >>  >> protocol="org.apache.coyote.http11.Http11NioProtocol"
> >> maxPostSize="5242880" SSLEnabled="true" maxThreads="200" compre$
> >>   compressionMinSize="1024" scheme="https" secure="true"
> >> clientAuth="false"  sslProtocol="TLS"
> >>keystoreFile="keystorefile" keystorePass="PASSWORD"
> >> URIEncoding="utf-8"
> >>  compressableMimeType="text/html,text/xml,text/plain,text/css,text/
> >> javascript,application/x-javascript,application/javascript"/>
> >
> > You have configured Tomcat for ports 80 and 443. When you start httpd:
> >
> >> [] Restarting web server: apache2(98)Address already in use:
> >> make_sock: could not bind to address [::]:80
> >> (98)Address already in use: make_sock: could not bind to address
> 0.0.0.0:80
> >> no listening sockets available, shutting down
> >> Unable to open logs
> >> Action 'start' failed.
> >> The Apache error log may have more information.
> >>  failed!
> >
> > ... you get a port conflict. You have to choose: httpd or Tomcat on port
> > 80 (and 443).
> >
> >> I understand that Tomcat is running on 80, but how do I then configure
> >> the servers so they can run simultaneously.
> >
> > It looks like you started configuring for mod_jk, but didn't really
> > finish. What you have to do is proxy *all* applications from http ->
> > Tomcat. Then remove the HTTP  from Tomcat and rely
> > exclusively on the AJP connector(s). (You really only need one single
> > AJP connector, since it will forward TLS information across to Tomcat.)
>
> Have a look at
>
> http://people.apache.org/~schultz/ApacheCon%20NA%202015/Load-balancing%20Tomcat%20with%20mod_jk.pdf
> starting at slide 19.
>
> -chris
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: WebEx meeting invitation: Apache Tomcat: TLS Virtual Hosting

2015-12-08 Thread Mark Thomas
On 08/12/2015 10:19, gustavo.avitab...@unina.it wrote:
> Hi Mark,
>I tried to attend this meeting. I connected with WebEx,
> I could see the slides, but I got no audio. The same
> happened at you first meeting, a few days ago. I looked
> at the first meeting you published in YouTube, with no
> problems: the audio was there.
>Can you suggest how can I attend the live meeting?

The meetings are currently set up so you have to use a telephone to
connect to the audio. You can either dial in or get the system to call
you back.

It looks like something did go wrong with the audio for this morning's
meeting. As I said when I sent the first invitations out, this is new
for us and we expect to have a few issues as we figure out how best to
do this.

For this evening's meeting I am going to try a couple of different things:
1. See if I can enable audio via the same device you are watching the
video so you don;t need a separate phone line.
2. Dial in from a separate line and ensure that my audio feed is working.

Mark


>Thank you
>Gustavo Avitabile
> 
> Quoting Mark Thomas :
> 
>>
>> Hello,
>>
>> Mark Thomas invites you to join this WebEx meeting.
>>
>>
>> Apache Tomcat: TLS Virtual Hosting
>> Tuesday, 8 December 2015
>> 10:00  |  GMT Time (London, GMT)  |  1 hr
>>
>>
>> JOIN WEBEX MEETING
>> https://pivotal.webex.com/pivotal/j.php?MTID=md04c20b9c83695a23992a9a2f9ea1302
>>
>> Meeting number: 640 832 227
>>
>>
>> JOIN BY PHONE
>> Call-in toll-free number: 1-877-8818371  (US)
>> Call-in number: 1-617-3374371  (US)
>> Show global numbers:
>> https://sites.google.com/a/pivotal.io/pivotal-it/pivotal-conferencing
>> Attendee access code: 289 459 03
>>
>>
>>
>> Add this meeting to your calendar:
>> https://pivotal.webex.com/pivotal/j.php?MTID=m9e9c0d24e609886438948d2f4265823d
>>
>>
>>
>> Can't join the meeting? Contact support here:
>> https://pivotal.webex.com/pivotal/mc
>>
>>
>> IMPORTANT NOTICE: Please note that this WebEx service allows audio and
>> other information sent during the session to be recorded, which may be
>> discoverable in a legal matter. By joining this session, you
>> automatically consent to such recordings. If you do not consent to
>> being recorded, discuss your concerns with the host or do not join the
>> session.
>>
> 
> 
> 
> 
> -
> 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



Creating another Tomcat copy in hot stand-by when original goes down.

2015-12-08 Thread Kernel freak
Hello friends,

I am working on a Debian server in which I would like to setup 2 instances
of Apache tomcat which will be load balanced by an Apache HTTP server(Do I
require a http server? ). In-case one copy of Apache tomcat goes down, the
other one will automatically comes online.

While I was creating a configuration for one of our server, I know how to
relay requests based upon URL to Apache Tomcat, these are the 2 things I
don't know.

1) Will this work with https? Reason I ask is, there are many pages which
are served under https and the configuration which I have and shown below
seems to be calling with http instead of https.

2) How to trigger the 2nd copy of tomcat.

Here is what I have till  now in Apache web server :

// Below is the redirection for tomcat webapps.

ServerName www.domain_tomcat.de
ServerAlias domain_tomcat.de
ProxyRequests on
ProxyPreserveHost On

Order deny,allow
Allow from all


// I was thinking instead of routing to maintenance.html, I would start the
other app, but that sounds quite hackish. I thought there might be a better
way.
 ErrorDocument 503 /maintenance.html
 ErrorDocument 404 /maintenance.html
 ErrorDocument 500 /maintenance.html

ProxyPass /maintenance.html !

// As you can see below, I am redirecting with http, which is my first
point, will it automatically redirect to https, as tomcat webapp is using
Spring-security and it has specific paths for which it must use https.
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/


Order allow,deny
Allow from all



My tomcat config is rather simple :





 

I can setup a similar instance of Tomcat in another location if desired.
But how can I handle the switching between them when one goes down. Kindly
let me know. Thank you. :-)


Re: WebEx meeting invitation: Apache Tomcat: TLS Virtual Hosting

2015-12-08 Thread gustavo . avitabile

Hi Mark,
   I tried to attend this meeting. I connected with WebEx,
I could see the slides, but I got no audio. The same
happened at you first meeting, a few days ago. I looked
at the first meeting you published in YouTube, with no
problems: the audio was there.
   Can you suggest how can I attend the live meeting?
   Thank you
   Gustavo Avitabile

Quoting Mark Thomas :



Hello,

Mark Thomas invites you to join this WebEx meeting.


Apache Tomcat: TLS Virtual Hosting
Tuesday, 8 December 2015
10:00  |  GMT Time (London, GMT)  |  1 hr


JOIN WEBEX MEETING
https://pivotal.webex.com/pivotal/j.php?MTID=md04c20b9c83695a23992a9a2f9ea1302
Meeting number: 640 832 227


JOIN BY PHONE
Call-in toll-free number: 1-877-8818371  (US)
Call-in number: 1-617-3374371  (US)
Show global numbers:
https://sites.google.com/a/pivotal.io/pivotal-it/pivotal-conferencing
Attendee access code: 289 459 03



Add this meeting to your calendar:
https://pivotal.webex.com/pivotal/j.php?MTID=m9e9c0d24e609886438948d2f4265823d


Can't join the meeting? Contact support here:
https://pivotal.webex.com/pivotal/mc


IMPORTANT NOTICE: Please note that this WebEx service allows audio  
and other information sent during the session to be recorded, which  
may be discoverable in a legal matter. By joining this session, you  
automatically consent to such recordings. If you do not consent to  
being recorded, discuss your concerns with the host or do not join  
the session.







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



Re: WebEx meeting invitation: Apache Tomcat: TLS Virtual Hosting

2015-12-08 Thread Violeta Georgieva
Hi Mark,

2015-12-08 12:41 GMT+02:00 Mark Thomas :
>
> On 08/12/2015 10:19, gustavo.avitab...@unina.it wrote:
> > Hi Mark,
> >I tried to attend this meeting. I connected with WebEx,
> > I could see the slides, but I got no audio. The same
> > happened at you first meeting, a few days ago. I looked
> > at the first meeting you published in YouTube, with no
> > problems: the audio was there.
> >Can you suggest how can I attend the live meeting?
>
> The meetings are currently set up so you have to use a telephone to
> connect to the audio. You can either dial in or get the system to call
> you back.
>
> It looks like something did go wrong with the audio for this morning's
> meeting. As I said when I sent the first invitations out, this is new
> for us and we expect to have a few issues as we figure out how best to
> do this.
>
> For this evening's meeting I am going to try a couple of different things:
> 1. See if I can enable audio via the same device you are watching the
> video so you don;t need a separate phone line.
> 2. Dial in from a separate line and ensure that my audio feed is working.

I tried with dial in and with call back, but both were not working for me
this morning.

I was able to see the slides but there was no audio.

A colleague of mine also tried without success - no audio this morning.

For this evening's meeting I can join earlier and I also will be able to
tell you whether the audio is OK on my side.

Regards,
Violeta

> Mark
>
>
> >Thank you
> >Gustavo Avitabile
> >
> > Quoting Mark Thomas :
> >
> >>
> >> Hello,
> >>
> >> Mark Thomas invites you to join this WebEx meeting.
> >>
> >>
> >> Apache Tomcat: TLS Virtual Hosting
> >> Tuesday, 8 December 2015
> >> 10:00  |  GMT Time (London, GMT)  |  1 hr
> >>
> >>
> >> JOIN WEBEX MEETING
> >>
https://pivotal.webex.com/pivotal/j.php?MTID=md04c20b9c83695a23992a9a2f9ea1302
> >>
> >> Meeting number: 640 832 227
> >>
> >>
> >> JOIN BY PHONE
> >> Call-in toll-free number: 1-877-8818371  (US)
> >> Call-in number: 1-617-3374371  (US)
> >> Show global numbers:
> >> https://sites.google.com/a/pivotal.io/pivotal-it/pivotal-conferencing
> >> Attendee access code: 289 459 03
> >>
> >>
> >>
> >> Add this meeting to your calendar:
> >>
https://pivotal.webex.com/pivotal/j.php?MTID=m9e9c0d24e609886438948d2f4265823d
> >>
> >>
> >>
> >> Can't join the meeting? Contact support here:
> >> https://pivotal.webex.com/pivotal/mc
> >>
> >>
> >> IMPORTANT NOTICE: Please note that this WebEx service allows audio and
> >> other information sent during the session to be recorded, which may be
> >> discoverable in a legal matter. By joining this session, you
> >> automatically consent to such recordings. If you do not consent to
> >> being recorded, discuss your concerns with the host or do not join the
> >> session.
> >>
> >
> >
> >
> >
> > -
> > 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: WebEx meeting invitation: Apache Tomcat: TLS Virtual Hosting

2015-12-08 Thread Mark Thomas
On 08/12/2015 11:12, Violeta Georgieva wrote:
> Hi Mark,
> 
> 2015-12-08 12:41 GMT+02:00 Mark Thomas :
>>
>> On 08/12/2015 10:19, gustavo.avitab...@unina.it wrote:
>>> Hi Mark,
>>>I tried to attend this meeting. I connected with WebEx,
>>> I could see the slides, but I got no audio. The same
>>> happened at you first meeting, a few days ago. I looked
>>> at the first meeting you published in YouTube, with no
>>> problems: the audio was there.
>>>Can you suggest how can I attend the live meeting?
>>
>> The meetings are currently set up so you have to use a telephone to
>> connect to the audio. You can either dial in or get the system to call
>> you back.
>>
>> It looks like something did go wrong with the audio for this morning's
>> meeting. As I said when I sent the first invitations out, this is new
>> for us and we expect to have a few issues as we figure out how best to
>> do this.
>>
>> For this evening's meeting I am going to try a couple of different things:
>> 1. See if I can enable audio via the same device you are watching the
>> video so you don;t need a separate phone line.
>> 2. Dial in from a separate line and ensure that my audio feed is working.
> 
> I tried with dial in and with call back, but both were not working for me
> this morning.
> 
> I was able to see the slides but there was no audio.
> 
> A colleague of mine also tried without success - no audio this morning.
> 
> For this evening's meeting I can join earlier and I also will be able to
> tell you whether the audio is OK on my side.

Thanks. I'm going to dial in on a separate line to double check.

I'm currently on the phone to support to see why audio via computer is
not available. Bingo. It is a 'feature'.

The short version is the service $work has set up uses a separate
conference call service and you can't use VOIP at the same time. It is
either or. Given that landlines are more reliable and that a call-back
option is available (so it should be zero cost to participants) I'm
going to continue with that route.

I'll update the opening slides to make it clear audio via the PC is not
an option.

Mark

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



Tomcat closes a websocket connection with an error

2015-12-08 Thread Daniel Kretz
Hi Tomcat Team,

 

for a customer we build a HTML5 websocket application with Tomcat 8.0.29.

If we start the application from our network or from our home network all
works fine. But if the customer starts the application from his network,
after a certain time the websocket stops with a error. This can happen after
5 or 20 Minutes.

We have tested it with and without SSL and on two different servers. Only in
the customer network the connection breaks with a error.

We also make a test with an websocket echo example which is included in
Tomcat. the same as with our websocket. After a certain time the websocket
stops with a error. But only if we start the application from the customer
network.

 

When the echo example stops with an error the following message will written
in  server.log

 

08-Dec-2015 10:20:37.757 SEVERE [http-apr-8081-exec-2]
org.apache.tomcat.websocket.pojo.PojoEndpointBase.onError No error handling
configured for [websocket.echo.EchoAnnotation] and the following error
occurred

java.io.IOException: Unexpected error [730,054] reading data from the
APR/native socket [1,639,490,672] with wrapper
[org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@231e01e4:1639490672
].

at
org.apache.coyote.http11.upgrade.AprServletInputStream.doRead(AprServletInpu
tStream.java:133)

at
org.apache.coyote.http11.upgrade.AbstractServletInputStream.read(AbstractSer
vletInputStream.java:124)

at
org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServ
er.java:51)

at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDat
aAvailable(WsHttpUpgradeHandler.java:183)

at
org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(
AbstractServletInputStream.java:198)

at
org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractP
rocessor.java:96)

at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abstrac
tProtocol.java:669)

at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.jav
a:2500)

at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:
2489)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)

at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.ja
va:61)

at java.lang.Thread.run(Unknown Source)

 

If we starts the test on http://www.websocket.org/echo.html in the customer
network, the connection will not stop with an error. 

 

For me it looks like a problem with Tomcat. But what can I do to make it run
properly?

 

Tomcat: 8.0.29 (also with earlier versions)

Windows 7: 64 Bit

Protocol: HTTP/1.1

 

 

Regards,

Daniel



smime.p7s
Description: S/MIME cryptographic signature


Re: Tomcat closes a websocket connection with an error

2015-12-08 Thread Mark Thomas
On 08/12/2015 11:49, Daniel Kretz wrote:
> We have tested it with and without SSL and on two different servers.
> Only in the customer network the connection breaks with a error.



> 08-Dec-2015 10:20:37.757 SEVERE [http-apr-8081-exec-2]
> org.apache.tomcat.websocket.pojo.PojoEndpointBase.onError No error
> handling configured for [websocket.echo.EchoAnnotation] and the
> following error occurred
> 
> java.io.IOException: Unexpected error [730,054] reading data from the
> APR/native socket [1,639,490,672] with wrapper
> [org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@231e01e4:1639490672].

Take that error code and subtract 720,000 to give 10054 which is the OS
error message.

Google that and you get "Connection reset by peer"

i.e., the client dropped the connection. There is nothing Tomcat can do
about that.



> If we starts the test on http://www.websocket.org/echo.html in the
> customer network, the connection will not stop with an error.
> 
> For me it looks like a problem with Tomcat. But what can I do to make it
> run properly?

Interesting. Looks more like a network issue to me. Maybe a firewall
dropping connections after a set period.

Mark


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



Re: Tomcat 7.0.42 crash on Win Server 2008 R2 Std - need help

2015-12-08 Thread Mark Thomas
On 08/12/2015 16:22, Guillaume CROISET wrote:
>  Hi all,
> 
> I need help to go futher with this log (see below).
> 
> I have had frequent unexpected tomcat crashes for 3 months, once or twice a 
> week.
> 
> Until now : 
> I first submitted a request with all logs available to the app's editor 
> support (WebGIS app is a third party development, I just develop jsp's for 
> needs of my users)... They didn't found an answer to this issue. I've been 
> tryin to undestand the hs_err_pid log (with oracle documentation), tried 
> to pick info on many boards/forum (it seems that the issue is known, but I 
> still haven't found a solution and to much information blew me as I'm new to 
> tomcat crashes !). I also tried also to rebuild the app but 4 days after 
> running, it halt again...
> 
> I'm a bit lost and don't really know how to act. Don't know if it's bad 
> config about the heap space, or buggy component.
> 
> Tomcat is version 7.0.42, on VMWare virtualized Windows Server 2008 R2 Std 
> X64, 12 Go RAM.
> I run several WebGis application on it, same config, but only the most 
> advanced one (SSL secured, don't know if it's useful info) has the symptom.
> 
> Many advices would be much appreciated, Thanks
> 
> Guillaume, GIS administrator, France.
> 
> And please, if I don't post in the right place, don't hesitate to tell it to 
> me

Update Tomcat to the latest 7.0.x release along with the latest
tomcat-native release and see if that helps.

Mark


> 
> the log :
> 
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> #  Internal Error (os_windows_x86.cpp:143), pid=5020, tid=4040
> #  guarantee(result == EXCEPTION_CONTINUE_EXECUTION) failed: Unexpected 
> result from topLevelExceptionFilter
> #
> # JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 
> 1.7.0_45-b18)
> # Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode 
> windows-amd64 compressed oops)
> # Core dump written. Default location: 
> C:\Imagis\wvsSigeko\ApplicationServer\apache-tomcat-7\bin\hs_err_pid5020.mdmp
> #
> # If you would like to submit a bug report, please visit:
> #   http://bugreport.sun.com/bugreport/crash.jsp
> # The crash happened outside the Java Virtual Machine in native code.
> # See problematic frame for where to report the bug.
> #
> 
> ---  T H R E A D  ---
> 
> Current thread (0x104d9000):  JavaThread "catalina-exec-9" daemon 
> [_thread_in_native, id=4040, stack(0x00c7,0x00d7)]
> 
> Stack: [0x00c7,0x00d7]
> Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
> j  org.apache.tomcat.jni.SSLSocket.handshake(J)I+0
> j  org.apache.tomcat.util.net.AprEndpoint.setSocketOptions(J)Z+106
> j  org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run()V+34
> j  
> java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+95
> j  java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5
> j  java.lang.Thread.run()V+11
> v  ~StubRoutines::call_stub
> 
> ---  P R O C E S S  ---
> 
> Java Threads: ( => current thread )
>   0x08f0d000 JavaThread "catalina-exec-14" daemon [_thread_in_native, 
> id=8012, stack(0x13ae,0x13be)]
> =>0x104d9000 JavaThread "catalina-exec-9" daemon [_thread_in_native, 
> id=4040, stack(0x00c7,0x00d7)]
>   0x104d8000 JavaThread "catalina-exec-8" daemon [_thread_blocked, 
> id=6176, stack(0x00b7,0x00c7)]
>   0x08f0a000 JavaThread "catalina-exec-6" daemon [_thread_blocked, 
> id=7280, stack(0x135e,0x136e)]
>   0x104d3800 JavaThread "http-apr-443-AsyncTimeout" daemon 
> [_thread_blocked, id=5464, stack(0x12fe,0x130e)]
>   0x104d3000 JavaThread "http-apr-443-Acceptor-0" daemon 
> [_thread_in_native, id=5604, stack(0x12ee,0x12fe)]
>   0x104d2000 JavaThread "http-apr-443-CometPoller-7" daemon 
> [_thread_blocked, id=6808, stack(0x12de,0x12ee)]
>   0x104d1800 JavaThread "http-apr-443-CometPoller-6" daemon 
> [_thread_blocked, id=7412, stack(0x12ce,0x12de)]
>   0x104d0800 JavaThread "http-apr-443-CometPoller-5" daemon 
> [_thread_blocked, id=4592, stack(0x12be,0x12ce)]
>   0x104d JavaThread "http-apr-443-CometPoller-4" daemon 
> [_thread_blocked, id=7560, stack(0x12ae,0x12be)]
>   0x104cf000 JavaThread "http-apr-443-CometPoller-3" daemon 
> [_thread_blocked, id=6068, stack(0x129e,0x12ae)]
>   0x104ce800 JavaThread "http-apr-443-CometPoller-2" daemon 
> [_thread_blocked, id=7240, stack(0x128e,0x129e)]
>   0x104cd800 JavaThread "http-apr-443-CometPoller-1" daemon 
> [_thread_blocked, id=6756, 

Tomcat 7.0.42 crash on Win Server 2008 R2 Std - need help

2015-12-08 Thread Guillaume CROISET
 Hi all,

I need help to go futher with this log (see below).

I have had frequent unexpected tomcat crashes for 3 months, once or twice a 
week.

Until now : 
I first submitted a request with all logs available to the app's editor support 
(WebGIS app is a third party development, I just develop jsp's for needs of my 
users)... They didn't found an answer to this issue. I've been tryin to 
undestand the hs_err_pid log (with oracle documentation), tried to pick 
info on many boards/forum (it seems that the issue is known, but I still 
haven't found a solution and to much information blew me as I'm new to tomcat 
crashes !). I also tried also to rebuild the app but 4 days after running, it 
halt again...

I'm a bit lost and don't really know how to act. Don't know if it's bad config 
about the heap space, or buggy component.

Tomcat is version 7.0.42, on VMWare virtualized Windows Server 2008 R2 Std X64, 
12 Go RAM.
I run several WebGis application on it, same config, but only the most advanced 
one (SSL secured, don't know if it's useful info) has the symptom.

Many advices would be much appreciated, Thanks

Guillaume, GIS administrator, France.

And please, if I don't post in the right place, don't hesitate to tell it to me

the log :

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (os_windows_x86.cpp:143), pid=5020, tid=4040
#  guarantee(result == EXCEPTION_CONTINUE_EXECUTION) failed: Unexpected result 
from topLevelExceptionFilter
#
# JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode 
windows-amd64 compressed oops)
# Core dump written. Default location: 
C:\Imagis\wvsSigeko\ApplicationServer\apache-tomcat-7\bin\hs_err_pid5020.mdmp
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---  T H R E A D  ---

Current thread (0x104d9000):  JavaThread "catalina-exec-9" daemon 
[_thread_in_native, id=4040, stack(0x00c7,0x00d7)]

Stack: [0x00c7,0x00d7]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.apache.tomcat.jni.SSLSocket.handshake(J)I+0
j  org.apache.tomcat.util.net.AprEndpoint.setSocketOptions(J)Z+106
j  org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run()V+34
j  
java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+95
j  java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

---  P R O C E S S  ---

Java Threads: ( => current thread )
  0x08f0d000 JavaThread "catalina-exec-14" daemon [_thread_in_native, 
id=8012, stack(0x13ae,0x13be)]
=>0x104d9000 JavaThread "catalina-exec-9" daemon [_thread_in_native, 
id=4040, stack(0x00c7,0x00d7)]
  0x104d8000 JavaThread "catalina-exec-8" daemon [_thread_blocked, 
id=6176, stack(0x00b7,0x00c7)]
  0x08f0a000 JavaThread "catalina-exec-6" daemon [_thread_blocked, 
id=7280, stack(0x135e,0x136e)]
  0x104d3800 JavaThread "http-apr-443-AsyncTimeout" daemon 
[_thread_blocked, id=5464, stack(0x12fe,0x130e)]
  0x104d3000 JavaThread "http-apr-443-Acceptor-0" daemon 
[_thread_in_native, id=5604, stack(0x12ee,0x12fe)]
  0x104d2000 JavaThread "http-apr-443-CometPoller-7" daemon 
[_thread_blocked, id=6808, stack(0x12de,0x12ee)]
  0x104d1800 JavaThread "http-apr-443-CometPoller-6" daemon 
[_thread_blocked, id=7412, stack(0x12ce,0x12de)]
  0x104d0800 JavaThread "http-apr-443-CometPoller-5" daemon 
[_thread_blocked, id=4592, stack(0x12be,0x12ce)]
  0x104d JavaThread "http-apr-443-CometPoller-4" daemon 
[_thread_blocked, id=7560, stack(0x12ae,0x12be)]
  0x104cf000 JavaThread "http-apr-443-CometPoller-3" daemon 
[_thread_blocked, id=6068, stack(0x129e,0x12ae)]
  0x104ce800 JavaThread "http-apr-443-CometPoller-2" daemon 
[_thread_blocked, id=7240, stack(0x128e,0x129e)]
  0x104cd800 JavaThread "http-apr-443-CometPoller-1" daemon 
[_thread_blocked, id=6756, stack(0x127e,0x128e)]
  0x104cd000 JavaThread "http-apr-443-CometPoller-0" daemon 
[_thread_blocked, id=5000, stack(0x126e,0x127e)]
  0x104cc000 JavaThread "http-apr-443-Poller-7" daemon 
[_thread_blocked, id=6444, stack(0x125e,0x126e)]
  0x104cb800 JavaThread "http-apr-443-Poller-6" 

Re: Creating another Tomcat copy in hot stand-by when original goes down.

2015-12-08 Thread tomcat

On 08.12.2015 14:07, Kernel freak wrote:

Hello friends,

I am working on a Debian server in which I would like to setup 2 instances
of Apache tomcat which will be load balanced by an Apache HTTP server(Do I
require a http server? ). In-case one copy of Apache tomcat goes down, the
other one will automatically comes online.

While I was creating a configuration for one of our server, I know how to
relay requests based upon URL to Apache Tomcat, these are the 2 things I
don't know.

1) Will this work with https? Reason I ask is, there are many pages which
are served under https and the configuration which I have and shown below
seems to be calling with http instead of https.

2) How to trigger the 2nd copy of tomcat.


[snip]

Hi. To answer this "top-down" :

1) to do "load-balance" 2 tomcats, there are many ways, and you do not necessarily have to 
use Apache httpd as a front-end, there are other solutions.

But the Apache httpd solution is probably the easiest to set up, and it's free.

2) picture the following setup :

user browser <-- HTTP or HTTPS --> Apache httpd <-- HTTP/HTTPS/AJP --> tomcat1
+ Connector <-- HTTP/HTTPS/AJP --> tomcat2

tomcat1 and tomcat2 are always active, both.  You do not start one when the 
other fails.
They are normally both active, and they share the load (the httpd Connector does that for 
you).
If one tomcat fails, the Connector under Apache httpd will notice that, and will start 
forwarding the requests only to the still-working tomcat.
When the failed tomcat comes back on-line, the Connector notices again, and starts 
balancing the requests again to both tomcats.

If both tomcats fail, you get an error at the httpd level.

3) for the httpd-level "Connector" between httpd and tomcat, you have 3 choices 
:
   a) mod_proxy + mod_proxy_http
   b) mod_proxy + mod_proxy_ajp
   c) mod_jk
Each one of those can do load-balancing, but their configuration is different.

4) If Apache httpd and the tomcats communicate through a network that is considered as 
secure, then the most efficient configuration would be :


Connection A   Connection B
user browser <-- HTTP or HTTPS --> Apache httpd <-- HTTP/AJP --> tomcat1
+ Connector <-- HTTP/AJP --> tomcat2

The usual way of describing this is "terminating HTTPS at the httpd level".
In other words, do not use HTTPS between httpd and tomcat (connection B), because it would 
unnecessarily force an additional encryption/decryption.
All the additional HTTPS information that may be needed at the tomcat level, to know that 
the original user connection with httpd (connection A) was under HTTPS, will be anyway 
forwarded by the Connector, to Tomcat (as HTTP request headers).

(So tomcat can always know if the original browser to httpd connection A was 
secure or not.)

5)
- The (mod_proxy + mod_proxy_http) Connector, forwards the original (HTTP/HTTPS) client 
requests to Tomcat, using the HTTP protocol (and format).

So at the receiving end, in Tomcat, you need a matching HTTP Connector.

- the (mod_proxy + mod_proxy_ajp) Connector, and the mod_jk Connector, forward the 
original (HTTP/HTTPS) client requests to Tomcat, using a protocol/format that is not HTTP, 
but which essentially carries the same information (it is the AJP protocol/format).

So at the receiving end you need a matching AJP Connector.

- when the request is received by Tomcat using either one of the Tomcat Connectors, it is 
the job of the Tomcat-side Connector to "translate" this request into an internal Tomcat 
"request object", which is always the same.  So from the point of view of your tomcat 
webapps, it does not matter through which Connector the request was received, it always 
looks the same.


- one difference between proxying through HTTP and proxying through AJP, is that the AJP 
protocol does not have a corresponding "AJPS" encrypted version.
In other words, you should probably not use either (mod_proxy + mod_proxy_ajp) or mod_jk, 
if your httpd and tomcats communicate over a non-secure channel (such as over an Internet 
connection). (You could still do that over an SSH tunnel, but that complicates things).


- another difference is that the AJP protocol can carry to tomcat, a user-id that has been 
authenticated at the httpd level.  The HTTP protocol does not do that by itself.
(In short, if you authenticate users at the httpd level, and want Tomcat to use this and 
avoid authenticating the user again, then use the AJP protocol).


Does this give you enough material to figure out the rest of your questions ?




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



Re: Zero downtime deployments

2015-12-08 Thread Kevin Hale Boyes
On 4 December 2015 at 11:19, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Kevin,
>
> On 12/3/15 2:21 PM, Kevin Hale Boyes wrote:
> > Thanks for this link to the presentation.
> > How do you all deal with some of the other dependencies that the web
> > application has?
> >
> > For example, if v2 of my application needs new database columns or
> worse, a
> > change to an existing column how can I have v1 and v2 running at the same
> > time?  We use Oracle as our database though the problem exists for many
> > database servers.
>
> That's not a deployment problem. That's a design problem.
>
> In short, you need to make sure that your web application is both
> forward-compatible and backward-compatible at the same time.
>
> That's rubbish, or course. Here's a more concrete suggestion, and it
> requires a LOT of work, but it's worth it.
>
> First of all, you can't think of a release as a single event any more.
> Instead, there are 4 events.
>


We already do this sort of development when needed.  In particular, when we
have database changes that will take a long time like back populating new
columns or creating new indexes on large tables, we run then in a
pre-release phase against live production.  We time the activities to
finish just before our release window.  Sometimes we also have post-release
database activities as well that follow shortly after our release outage.

I guess I hadn't extended my thoughts far enough and seen the full
potential of the idea so thanks.
One drawback for us when we use this mechanism is related to our release
schedule.  We release on a quarterly basis so having a process that spans
four releases pushes it out for an entire year.  But that's our problem and
we're making headway there too.

Thanks Christopher
Kevin.


Today's Apache Tomcat: TLS Virtual Hosting webinar is now available on YouTube

2015-12-08 Thread Mark Thomas
All,

As promised, today's webinar "Apache Tomcat: TLS Virtual Hosting" is
now available on the Apache Tomcat YouTube channel:

https://www.youtube.com/channel/UCpqpJ0-G1lYfUBQ6_36Au_g

Mark

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



RE: Today's Apache Tomcat: TLS Virtual Hosting webinar is now available on YouTube

2015-12-08 Thread Yu, Yujin
Hi,
Please kindly remove myself in this e-mail group.
Regards,
Yujin


Yujin Yu   |   Schneider Electric   |   Industry Business   |   Korea   |   
Buyer 2
Phone: +82 2 2090 0915  |  Fax: +82 2 2090 0800  |  Mobile: +82 10 6528 5508
Email: yujin...@schneider-electric.com   |   Site: www.schneider-electric.com   
|   Address: 13F Kbiz DMC Tower, 189 Seongam-ro, Mapo-gu, Seoul, Korea, 121-904 
Seoul, Seoul, Korea


-Original Message-
From: Mark Thomas [mailto:ma...@apache.org]
Sent: Wednesday, December 09, 2015 7:40 AM
To: users@tomcat.apache.org
Subject: Today's Apache Tomcat: TLS Virtual Hosting webinar is now available on 
YouTube

All,

As promised, today's webinar "Apache Tomcat: TLS Virtual Hosting" is now 
available on the Apache Tomcat YouTube channel:

https://www.youtube.com/channel/UCpqpJ0-G1lYfUBQ6_36Au_g

Mark

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


__
This email has been scanned by the Symantec Email Security.cloud service.
__

*** Confidentiality Notice: This e-mail, including any associated or attached 
files, is intended solely for the individual or entity to which it is 
addressed. This e-mail is confidential and may well also be legally privileged. 
If you have received it in error, you are on notice of its status. Please 
notify the sender immediately by reply e-mail and then delete this message from 
your system. Please do not copy it or use it for any purposes, or disclose its 
contents to any other person.


Re: Creating another Tomcat copy in hot stand-by when original goes down.

2015-12-08 Thread Christopher Schultz
Akshay,

On 12/8/15 8:07 AM, Kernel freak wrote:
> I am working on a Debian server in which I would like to setup 2 instances
> of Apache tomcat which will be load balanced by an Apache HTTP server(Do I
> require a http server? ). In-case one copy of Apache tomcat goes down, the
> other one will automatically comes online.

You won't require Apache httpd, but you will need some kind of proxying
server. Nginx and haproxy will work. Squid, Varnish, etc. will
presumably all work as well. This community has expertise with Apache
httpd -> Tomcat as well as some others. I personally have only ever used
Apache httpd (and likely haproxy, though I don't actually know what AWS
ELB is using. In either case, I don't configure it directly, so it
doesn't matter).

> While I was creating a configuration for one of our server, I know how to
> relay requests based upon URL to Apache Tomcat, these are the 2 things I
> don't know.
> 
> 1) Will this work with https? Reason I ask is, there are many pages which
> are served under https and the configuration which I have and shown below
> seems to be calling with http instead of https.
> 
> 2) How to trigger the 2nd copy of tomcat.
> 
> Here is what I have till  now in Apache web server :
> 
> // Below is the redirection for tomcat webapps.
> 
> ServerName www.domain_tomcat.de
> ServerAlias domain_tomcat.de
> ProxyRequests on

I don't think you want this *at all*. "ProxyRequests" is for
forward-proxying, like providing a MITM for outgoing HTTP traffic.

> ProxyPreserveHost On
> 
> Order deny,allow
> Allow from all
> 
> 
> // I was thinking instead of routing to maintenance.html, I would start the
> other app, but that sounds quite hackish. I thought there might be a better
> way.
>  ErrorDocument 503 /maintenance.html
>  ErrorDocument 404 /maintenance.html
>  ErrorDocument 500 /maintenance.html
> 
> ProxyPass /maintenance.html !
> 
> // As you can see below, I am redirecting with http, which is my first
> point, will it automatically redirect to https, as tomcat webapp is using
> Spring-security and it has specific paths for which it must use https.
> ProxyPass / http://localhost:8080/
> ProxyPassReverse / http://localhost:8080/

If your VirtualHost supports HTTPS, then you can still use
http://localhost:8080 as your target. You just need to make sure that
you send-over all the appropriate headers to the back-end server, and
enable the various Valves on the Tomcat side to handle the proxying of
this information:

http://tomcat.apache.org/tomcat-8.0-doc/config/valve.html#Proxies_Support

> 
> Order allow,deny
> Allow from all
> 
> 
> 
> My tomcat config is rather simple :
> 
>  protocol="org.apache.coyote.http11.Http11NioProtocol" compression="force"
> compressionMinSize="1024"
>connectionTimeout="2"  maxPostSize="5242880"
>URIEncoding="utf-8"
>  compressableMimeType="text/html,text/xml,text/plain,text/css,text/
> javascript,application/x-javascript,application/javascript"/>
> 
> 
>   protocol="org.apache.coyote.http11.Http11NioProtocol"
> maxPostSize="5242880" SSLEnabled="true" maxThreads="200" compr$
>   compressionMinSize="1024" scheme="https" secure="true"
> clientAuth="false"  sslProtocol="TLS"
>keystoreFile="keystore.jks" keystorePass="PASSWORD"
> URIEncoding="utf-8"
>  compressableMimeType="text/html,text/xml,text/plain,text/css,text/
> javascript,application/x-javascript,application/javascript"/>
> 
> I can setup a similar instance of Tomcat in another location if desired.
> But how can I handle the switching between them when one goes down. Kindly
> let me know. Thank you. :-)

Do you actually want a hot-standby, or do you want to load-balance
amongst the servers that are available? Often, it's better to use both
servers at once and have one of them take all of the load, than to
completely switch from one to another.

-chris

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



Tomcat Thread Dump

2015-12-08 Thread Yogesh Patel
*Tomcat version* : 7.0.53
*OS *: Windows 7

We are using tomcat as standalone application not as service, In task
manager it does not showing PID for Tomcat. How to get PID of that tomcat
in order to take tomcat thread dump.

What are the best practice  to take thread dump and what are the commands
for windows7 system.


-- 
*Thanks & Regards,*

* Yogesh Patel*