RE: Tomcat stop and start using bash script

2018-06-28 Thread Jäkel , Guido
Hi also,

  to archive a full graceful shutdown, it's also save to just send a SIGTERM to 
the JVM running the Tomcat. This will result in invoking exactly the same 
mechanisms as the official top-level methods described by André without the 
need to start an extra VM. The PID should be available by the operating systems 
standard mechanisms as the Application Controll Framework (initd, system), by 
Java tools like jps or by system tools like ps, pidof, ... . To invoke a forced 
shutdown, one may send SIGKILL to the JVM process. 

  The advantage of both is to have a very small footprint and follow the KISS 
pragma, which may especially important in a "out-of-resources" scenario when 
the Tomcat high level interfaces (HTTP/AJP/JMX connector) become disfunctional 
as a side effect.

BTW: If the Application/Tomcat/JVM is "in trouble", one may invoke the JVM 
thread dump facility by sending a SIGQUIT to the JVM, also. Again, this may be 
a "last resort" if you can't command the Tomcat/JVM in a other way.


Greetings

Guido

>-Original Message-
>From: André Warnier (tomcat) [mailto:a...@ice-sa.com]
>Sent: Thursday, June 28, 2018 10:58 PM
>To: users@tomcat.apache.org
>Subject: Re: Tomcat stop and start using bash script
>
>Hi.
>
>I have not followe3d this thread since the beginning, but
>
>The standard tomcat distribution comes with a series of shell scripts in the 
>"bin"
>directory, which do just that : start or stop tomcat. They are conveniently 
>called
>"startup.sh" and "shutdown.sh". You could get inspiration from those.
>
>Since you are talking about bash, it is to be presumed that you are on a Linux 
>system.
>If this Linux system has a package management system, it is very likely that 
>there is a
>tomcat package available. Such tomcat packages come with startup and stop 
>scripts for
>tomcat, which make it easy to start/stop tomcat via a shell command.
>
>Furthermore, look at the on-line documentation. In
>http://tomcat.apache.org/tomcat-9.0-doc/config/server.html#Common_Attributes, 
>you will
>find the "shutdown" attribute and its explanation. It basically means that if 
>you open a
>TCP/IP socket to the given port (which you can do with bash), and send the 
>indicated
>string on that connection, tomcat will initiate a shutdown.
>
>And that's in fact what the standard shutdown.sh does, though using a 
>roundabout way : it
>starts another java jvm instance which runs another temporary instance of 
>tomcat, which
>just does one thing : send this shutdown string to the appropriate (main 
>instance of
>tomcat's) shutdown port (and then it shuts itself down).
>
>So it looks like there are a lot of ways to achieve what you want, and you 
>only need to
>pick the right one for you.


Re: tomcat with laptop + windows sleep

2018-06-28 Thread Alex O'Ree
I also see a lot of jdbc/my name is not bound in this context. Unable to
find jdbc

On Thu, May 24, 2018, 5:30 PM Alex O'Ree  wrote:

> Yes it is a tomcat managed data source with postgres. The cpu usage is my
> app trying to get a managed data source. Perhaps the jdbc driver is the
> issue. ..
>
> On Wed, May 23, 2018, 11:28 AM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA256
>>
>> Alex,
>>
>> On 5/22/18 7:39 PM, Alex O'Ree wrote:
>> > I've noticed a behavioral difference from tomcat 7 to 8.5. In v7, I
>> > used to be able to put a computer to "sleep" with tomcat running.
>> > On resume, everything would be just fine. On tomcat 8.5, i'm
>> > noticing that all database connections are basically dropped and do
>> > not appear to to restart/resume when the computer resumes. Actually
>> > the whole computer runs super slow until i kill the tomcat process.
>> > I'm not entirely sure what's going on here. Has anyone else noticed
>> > this kind of behavior?
>>
>> Are you using a tomcat-configured DataSource in your application? If
>> so, what does the configuration look like?
>>
>> I wouldn't expect any problems with sleep. I'm using Tomcat 8.5.29 on
>> MacOS and I haven't noticed any problems when my laptop goes to sleep.
>> I'm using Oracle Java 1.8.0_131 in this particular case.
>>
>> When it's running slowly, can you tell which process is taking up all
>> the CPU (or disk)? Try using the Process Explorer to single-out a
>> process. If it's Tomcat (java.exe), take a thread dump to see what
>> Tomcat is doing.
>>
>> - -chris
>> -BEGIN PGP SIGNATURE-
>> Comment: GPGTools - http://gpgtools.org
>> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>>
>> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlsFiIkACgkQHPApP6U8
>> pFi70g/8D9R8EkjpCeNziAUeQmWwxHwui+jbOd1rGjG7EID21mmmJJgw5IO1O8ok
>> F7GUWC8KloqFJ59m+Ib/3NCL5QkiuE/X++AyvDxgwuI1eqlxi86Gu7Jxw6wsfUj2
>> K1Ovp+jUeNEhuxPfx7zBiHXQPa1kN+B7ExxOyVEeybRalF27hlums2zF6IlC4VKm
>> LP2CFqMeEXMbLBEI6wXJrznxlcINwkQzYlX7EAbXzD4tOookS9wYhBeXi+3Yjugp
>> JbMUzIxOVKDzi2W8WYVRPhnhxSjVe5CVsQ32ghlwPEwzbMAgVcoQ7cwZ9r9l1Pg1
>> Z8GMiAk4Ui9m+TlKbW5N1r2RgSKLdhk4yUETgr+ykkyaMhc8Wt46vM1bdGjIgX6W
>> CCj/BHcM5IdLb56m1L0wiG82dftYlBNfu3hAlnoJls1GiVtRg5Ph5Dit+t2xH3Kh
>> GpS9r9HhzqbA3tjv4NSR6oRj5UXc/mu1qj93CFoGPf6ZwC5QiHWOMbeegLJxOXVK
>> yuIK1gl3ehTQhgcB+B2wK+0Id3gtcwOmzdzM3by2aSH+glfpwH3vRlYPLVUpAUf9
>> 7oNuMVwhGHFRKL+PF5o0hVldI/jFF2TqLdiQilTe4pfsRGKslgRJce0TIZT5ZSm5
>> jsQ2nCm1En7b+HW2hOeh2JjRkwwLqa5XIu7pjB2TVY1vhIJkdXs=
>> =aQz0
>> -END PGP SIGNATURE-
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>


Re: tomcat with laptop + windows sleep

2018-06-28 Thread Alex O'Ree
Looking at my stack traces it seems pretty clear. Tomcat can't
lookup/establish a connection to the database because the postgres jdbc
driver failed because of a socket exception, "the network is unreachable".
I'm not sure why this behavior is different from tomcat 7 to 8.5 but it's
becoming a bit of an issue.
SQLException, cannot create PoolableConnectionFactory (The connection
attempt failed) from
org.apache.toimcat.dbcp.dbcp2.BasicDataSource

I do recall there being something different related to database pooling
with tomcat 7 vs 8. Perhaps the delta is there?

On Sun, Jun 3, 2018 at 11:13 AM, Alex O'Ree  wrote:

> I did not copy any tomcat specific jars. I have validation queries
> implemented programmatically.
>
> On Sun, Jun 3, 2018 at 8:44 AM, Felix Schumacher  internetallee.de> wrote:
>
>>
>>
>> Am 02.06.2018 um 20:51 schrieb Alex O'Ree:
>>
>>> I think I've narrowed it down to an issue specific with terracotta quartz
>>> based jobs. I've wired it into using tomcat's jdbc connection pooling.
>>> I'm
>>> also using a super
>>> old version of it so that could be part of the problem. Interestingly
>>> this
>>> didn't happen with tomcat7 but it's more than probably some other change
>>> on
>>> my
>>> end caused this rather strange situation.  Anyhow, it's probably not
>>> tomcat.
>>>
>>
>> You copied the jdbc pool jars from tomcat 7 into tomcat 8.5? Why?
>>
>>
>>> Context.xml is something like this
>>>
>>>
>>> >> type="javax.sql.DataSource"
>>> maxActive="50" maxIdle="30" maxWait="1"
>>> username="user" password="a password"
>>> driverClassName="org.postgresql.Driver"
>>> factory="my.custom.EncryptedConnectionFactory"
>>> url="jdbc:postgresql://localhost:5432/my_database"
>>> />
>>>
>>
>> You could enable validation queries, so that the pool will check the
>> connections validity before handing it out to your application.
>>
>> Regards,
>>  Felix
>>
>>
>>> The encrypted connection factory extends the default one and supports a
>>> basic ciphered password
>>>
>>>
>>>
>>>
>>> On Sat, Jun 2, 2018, 1:34 PM Felix Schumacher >> internetallee.de> wrote:
>>>
>>>
 Am 24. Mai 2018 23:30:10 MESZ schrieb Alex O'Ree :

> Yes it is a tomcat managed data source with postgres. The cpu usage is
> my
> app trying to get a managed data source. Perhaps the jdbc driver is the
> issue. ..
>
 Care to post your configuration? Maybe there are some changes missing
 when
 you updated to the newer version.

 Regards,
   Felix

 On Wed, May 23, 2018, 11:28 AM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA256
>>
>> Alex,
>>
>> On 5/22/18 7:39 PM, Alex O'Ree wrote:
>>
>>> I've noticed a behavioral difference from tomcat 7 to 8.5. In v7, I
>>> used to be able to put a computer to "sleep" with tomcat running.
>>> On resume, everything would be just fine. On tomcat 8.5, i'm
>>> noticing that all database connections are basically dropped and do
>>> not appear to to restart/resume when the computer resumes. Actually
>>> the whole computer runs super slow until i kill the tomcat process.
>>> I'm not entirely sure what's going on here. Has anyone else noticed
>>> this kind of behavior?
>>>
>> Are you using a tomcat-configured DataSource in your application? If
>> so, what does the configuration look like?
>>
>> I wouldn't expect any problems with sleep. I'm using Tomcat 8.5.29 on
>> MacOS and I haven't noticed any problems when my laptop goes to
>>
> sleep.
>
>> I'm using Oracle Java 1.8.0_131 in this particular case.
>>
>> When it's running slowly, can you tell which process is taking up all
>> the CPU (or disk)? Try using the Process Explorer to single-out a
>> process. If it's Tomcat (java.exe), take a thread dump to see what
>> Tomcat is doing.
>>
>> - -chris
>> -BEGIN PGP SIGNATURE-
>> Comment: GPGTools - http://gpgtools.org
>> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>>
>> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlsFiIkACgkQHPApP6U8
>> pFi70g/8D9R8EkjpCeNziAUeQmWwxHwui+jbOd1rGjG7EID21mmmJJgw5IO1O8ok
>> F7GUWC8KloqFJ59m+Ib/3NCL5QkiuE/X++AyvDxgwuI1eqlxi86Gu7Jxw6wsfUj2
>> K1Ovp+jUeNEhuxPfx7zBiHXQPa1kN+B7ExxOyVEeybRalF27hlums2zF6IlC4VKm
>> LP2CFqMeEXMbLBEI6wXJrznxlcINwkQzYlX7EAbXzD4tOookS9wYhBeXi+3Yjugp
>> JbMUzIxOVKDzi2W8WYVRPhnhxSjVe5CVsQ32ghlwPEwzbMAgVcoQ7cwZ9r9l1Pg1
>> Z8GMiAk4Ui9m+TlKbW5N1r2RgSKLdhk4yUETgr+ykkyaMhc8Wt46vM1bdGjIgX6W
>> CCj/BHcM5IdLb56m1L0wiG82dftYlBNfu3hAlnoJls1GiVtRg5Ph5Dit+t2xH3Kh
>> GpS9r9HhzqbA3tjv4NSR6oRj5UXc/mu1qj93CFoGPf6ZwC5QiHWOMbeegLJxOXVK
>> yuIK1gl3ehTQhgcB+B2wK+0Id3gtcwOmzdzM3by2aSH+glfpwH3vRlYPLVUpAUf9
>> 7oNuMVwhGHFRKL+PF5o0hVldI/jFF2TqLdiQilTe4pfsRGKslgRJce0TIZT5ZSm5
>> jsQ2nCm1En7b+HW2hOeh2JjRkwwLqa5XIu7pjB2TVY1vhIJkdXs=
>> =aQz0
>>>

Re: Tomcat stop and start using bash script

2018-06-28 Thread tomcat

Hi.

I have not followe3d this thread since the beginning, but

The standard tomcat distribution comes with a series of shell scripts in the "bin" 
directory, which do just that : start or stop tomcat. They are conveniently called 
"startup.sh" and "shutdown.sh". You could get inspiration from those.


Since you are talking about bash, it is to be presumed that you are on a Linux 
system.
If this Linux system has a package management system, it is very likely that there is a 
tomcat package available. Such tomcat packages come with startup and stop scripts for 
tomcat, which make it easy to start/stop tomcat via a shell command.


Furthermore, look at the on-line documentation. In 
http://tomcat.apache.org/tomcat-9.0-doc/config/server.html#Common_Attributes, you will 
find the "shutdown" attribute and its explanation. It basically means that if you open a 
TCP/IP socket to the given port (which you can do with bash), and send the indicated 
string on that connection, tomcat will initiate a shutdown.


And that's in fact what the standard shutdown.sh does, though using a roundabout way : it 
starts another java jvm instance which runs another temporary instance of tomcat, which 
just does one thing : send this shutdown string to the appropriate (main instance of 
tomcat's) shutdown port (and then it shuts itself down).


So it looks like there are a lot of ways to achieve what you want, and you only need to 
pick the right one for you.



On 28.06.2018 20:13, Luis Rodríguez Fernández wrote:

Hello Danesh

Perhaps you could look for any of your tomcat connector ports, ask for the
process that is listening and kill it:

$ ppid=`lsof -i:8080 -Fp | grep p`
$ pid=`echo ${ppid#p*}`
$ kill $pid

Probably you can find something more elegant but the idea could be this
one...

Hope it helps,

Luis


2018-06-27 17:02 GMT+02:00 Leon Rosenberg :


use -force option
bin/shutdown.sh -force

regards
Leon

On Wed, Jun 27, 2018 at 5:51 PM dhanesh1212121212 
wrote:


Hi All,

Trying to stop and start tomcat in production using bash script for war
deployment.

If tomcat not stopped properly then how we can kill the correct process

and

make sure it's stopped correctly.

Regards,
Dhanesh M.










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



Re: Tomcat stop and start using bash script

2018-06-28 Thread Luis Rodríguez Fernández
Hello Danesh

Perhaps you could look for any of your tomcat connector ports, ask for the
process that is listening and kill it:

$ ppid=`lsof -i:8080 -Fp | grep p`
$ pid=`echo ${ppid#p*}`
$ kill $pid

Probably you can find something more elegant but the idea could be this
one...

Hope it helps,

Luis


2018-06-27 17:02 GMT+02:00 Leon Rosenberg :

> use -force option
> bin/shutdown.sh -force
>
> regards
> Leon
>
> On Wed, Jun 27, 2018 at 5:51 PM dhanesh1212121212 
> wrote:
>
> > Hi All,
> >
> > Trying to stop and start tomcat in production using bash script for war
> > deployment.
> >
> > If tomcat not stopped properly then how we can kill the correct process
> and
> > make sure it's stopped correctly.
> >
> > Regards,
> > Dhanesh M.
> >
>



-- 

"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

- Samuel Beckett


Tomcat8 hardening issues

2018-06-28 Thread Naga Ramesh
Guys,

 

I have done the hardening on Tomcat 8 version (PF below mentioned
configuration changes), but in application level some of the functionalities
are not working properly and observed some errors in the backend (PF below
mentioned errors), please re-check and  provide me the proper solution ASAP.

 

Enabled the below changes on web.xml file (tomcat8/conf).

 

Web.xml:

 



httpHeaderSecurity

 
org.apache.catalina.filters.HttpHeaderSecurityFilter



  hstsMaxAgeSeconds

  31536000





  hstsMaxAgeSeconds

  31536000



 

true



 

 



httpHeaderSecurity

/*

REQUEST



 

Server.xml: (added the secure tag on connector)

 


Updating tomcat Windows 2012r2

2018-06-28 Thread Jim Weill
I'm on 8.5.6, and just downloaded 8.5.32 yesterday.  On my test machine 
I stopped the service, copied in the core files, copied over my 
server.xml, web.xml, and the hosted application and it seems to work 
just fine, and thinks it's running 8.5.32 when I look at the logs.  Is 
this correct for updating tomcat?  I feel like I'm missing something.


jim


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



Re: JASPIC question on AuthConfigFactory#registerConfigProvider() and appContext parameter

2018-06-28 Thread Mark Thomas
On 28 June 2018 16:21:32 BST, Michael Remijan  
wrote:
>I'm using Tomcat 8.5.4.  I've got a JASPIC question
>When I call AuthConfigFactory#registerConfigProvider() if I pass null
>for the 3rd parameter (the appContext) there is no registration.  The
>registrationID returned by calling registerConfigProvider() is null. 
>And in testing I can verify the AuthModule code isn't running.  I get
>different behavior with GlassFish and Payara.  If I do the same with
>GlassFish or Payara, a null value for the 3rd parameter registers the
>AuthModule for ALL applications.  I believe this is consistent with the
>JASPIC 1.1 spec which says:
>
>appContext- A String value that may be used by a runtime to request a
>configuration object from
> 
>this provider. A null value may be passed as an argument for this
>parameter, in which case the provider
> 
>is registered for all configuration ids (at the indicated layers).
>
>So my question is, with Tomcat, what value can I pass for the 3rd
>parameter of the registerConfigProvider() method call (the appContext
>parameter) which will register the AuthModule for ALL applications? 
>Or, is this not supported yet by Tomcat?
>Thanks!

Try again with the latest 8.5.x release. There have been a lot of fixes since 
8.5.4.

Mark

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



JASPIC question on AuthConfigFactory#registerConfigProvider() and appContext parameter

2018-06-28 Thread Michael Remijan
I'm using Tomcat 8.5.4.  I've got a JASPIC question
When I call AuthConfigFactory#registerConfigProvider() if I pass null for the 
3rd parameter (the appContext) there is no registration.  The registrationID 
returned by calling registerConfigProvider() is null.  And in testing I can 
verify the AuthModule code isn't running.  I get different behavior with 
GlassFish and Payara.  If I do the same with GlassFish or Payara, a null value 
for the 3rd parameter registers the AuthModule for ALL applications.  I believe 
this is consistent with the JASPIC 1.1 spec which says:

appContext- A String value that may be used by a runtime to request a 
configuration object from
 
this provider. A null value may be passed as an argument for this parameter, in 
which case the provider
 
is registered for all configuration ids (at the indicated layers).

So my question is, with Tomcat, what value can I pass for the 3rd parameter of 
the registerConfigProvider() method call (the appContext parameter) which will 
register the AuthModule for ALL applications?  Or, is this not supported yet by 
Tomcat?
Thanks!



RE: problem in starting tomcat

2018-06-28 Thread Jäkel , Guido
>> When I am trying to start my server I got following error as:
>> A fatal error has been detected by the Java Runtime Environment:
>> #
>> #  SIGSEGV (0xb) at pc=0x7fd4f206e28a, pid=2412, tid=2412
>> #
>> # JRE version:  (11.0+18) (build )
>> # Java VM: Java HotSpot(TM) 64-Bit Server VM (11-ea+18, mixed mode, aot, 
>> sharing, tiered, compressed oops, g1 gc, linux-amd64)
>> # Problematic frame:
>> # C  [libc.so.6+0x8128a]  strlen+0x2a
>
>This is saying that the segfault occurred in libc code, specifically the
>strlen function.  This suggests that either the JVM is using the libc
>library incorrectly, or that the libc library on your system is bad.


From your hs_er_pid.txt I read:

---  S Y S T E M  ---

OS:Red Hat Enterprise Linux Server release 7.5 (Maipo)
uname:Linux 3.10.0-693.el7.x86_64 #1 SMP Thu Jul 6 19:56:57 EDT 2017 
x86_64
libc:glibc 2.19 NPTL 2.19

[...]

vm_info: Java HotSpot(TM) 64-Bit Server VM (11-ea+18) for linux-amd64 
JRE (11-ea+18), built on Jun 13 2018 20:25:53 by "mach5one" with gcc 7.3.0


So you're providing a somewhat older  glibc 2.19  (released 20140208) but the 
JVM you're using was built recently (20180513). Did you compile this JVM? Was 
it compiled against a fittig version of glibc? I would strongly suggest to use 
a JRE/JDK package provided by your Linux Distribution.


Greetings

Guido


Re: problem in starting tomcat

2018-06-28 Thread Shawn Heisey
On 6/25/2018 9:20 PM, Prateek wrote:
> My configuration:
> OS:REDHAT 7.5 (64 bit)
> Tomcat: 8.5.31
> Jdk- jdk-11(Early-Access)

+1 to everything else you've been told on this thread.

More stuff inline below.

> When I am trying to start my server I got following error as:
> A fatal error has been detected by the Java Runtime Environment:
> #
> #  SIGSEGV (0xb) at pc=0x7fd4f206e28a, pid=2412, tid=2412
> #
> # JRE version:  (11.0+18) (build )
> # Java VM: Java HotSpot(TM) 64-Bit Server VM (11-ea+18, mixed mode, aot, 
> sharing, tiered, compressed oops, g1 gc, linux-amd64)
> # Problematic frame:
> # C  [libc.so.6+0x8128a]  strlen+0x2a

This is saying that the segfault occurred in libc code, specifically the
strlen function.  This suggests that either the JVM is using the libc
library incorrectly, or that the libc library on your system is bad.

> # An error report file with more information is saved as:
> # /localdisk/corefiles/hs_err_pid2412.log

Can you provide the JVM error file above (or the one from the most
recent crash)?

> Saved corefile core.2412

If I had any idea how to interpret coredumps, I would ask for that file,
but I don't.  Maybe Oracle can do something useful with it.

I did find a JDK bug showing a crash in libc, but that bug should be
fixed in Java 9 and later.

https://bugs.openjdk.java.net/browse/JDK-8186817

If the behavior is exactly the same with Java 10, then I would think it
means the system itself has a problem.  My first thought would be that
the kernel or system libraries like libc are broken, but it could also
be faulty hardware.  Can you get this working if you put Java 8 on THIS
system and use that?

Thanks,
Shawn


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



Re: Apache http via tomcat WAR or Directory URL syntax (tomcat server.xml) for WAR application not working

2018-06-28 Thread tomcat

Hi.

On 28.06.2018 11:55, Sandels Mark (RTH) OUH wrote:
[.. snip ..]



I am using the Apache http service as a proxy. I have configured the Apache 
httpd.conf file to listen to client requests on port 8000.



Well no, according to the confiuration below, you are not at all using Apache httpd as a 
proxy.

E.g.

...

#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_express_module modules/mod_proxy_express.so
#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so
#LoadModule proxy_html_module modules/mod_proxy_html.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_http2_module modules/mod_proxy_http2.so
#LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
#LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so
#LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so

...

All the Apache httpd modules which /would/ allow some kind of proxying are commented out, 
thus not even loaded.

As a minimum for acting as a proxy, the following 2 should be uncommented :

> #LoadModule proxy_module modules/mod_proxy.so
> #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so




#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
#DocumentRoot "c:/Apache24/htdocs"
#
DocumentRoot "C:\Program Files (x86)\apache-tomcat-9.0.6\webapps"




What you are doing here, and which may make it /look/ like you are proxying, is 
:
You are telling (and allowing) the Apache httpd front-end, to serve itself directly 
whatever is in the tomcat webapps directory (without involving tomcat at all).
In other words, when a client requests a tomcat page (html, jsp, whatever) Apache httpd 
goes /around/ tomcat, and returns this file directly to the browser, without any Java 
processing at all. Tomcat does not even see that this is happening.
(And also, any kind of security that may be built into your tomcat application, is totally 
bypassed.)
You can probably see this if you examine the tomcat logfiles : I bet that you will not see 
any kind of access to the tomcat pages or webapps.

And see the warning in red here :
http://tomcat.apache.org/connectors-doc/reference/apache.html




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



RE: Apache http via tomcat WAR or Directory URL syntax (tomcat server.xml) for WAR application not working

2018-06-28 Thread Sandels Mark (RTH) OUH
Hi Tom

In answer to your questions ...

<>

The web-page that I was expecting appears - that is the WAR application 
web-page for OracleStatus.

<>

I am using the Apache http service as a proxy. I have configured the Apache 
httpd.conf file to listen to client requests on port 8000.

How do I configure tomcat to go directory to the index.jsp page?

Apache http.conf file.
#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see 
# http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
# server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" 
# will be interpreted as '/logs/access_log'.
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which httpd.exe is located
# will be used by default.  It is recommended that you always supply
# an explicit drive letter in absolute paths to avoid confusion.

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path.  If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used.  If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
ServerRoot "c:/Apache24"

#
# Mutex: Allows you to set the mutex mechanism and mutex file directory
# for individual mutexes, or change the global defaults
#
# Uncomment and change the directory if mutexes are file-based and the default
# mutex file directory is not on a local disk or is not appropriate for some
# other reason.
#
# Mutex default:logs

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the 
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 8000

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule auth_form_module modules/mod_auth_form.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_core_module modules/mod_authn_core.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authn_socache_module modules/mod_authn_socache.so
#LoadModule authnz_fcgi_module modules/mod_authnz_fcgi.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule authz_core_module modules/mod_authz_core.so
#LoadModule authz_dbd_module modules/mod_authz_dbd.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule brotli_module modules/mod_brotli.so
#LoadModule buffer_module modules/mod_buffer.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule cache_disk_module modules/mod_cache_disk.so
#LoadModule cache_socache_module modules/mod_cache_socache.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule charset_lite_module modules/mod_charset_lit

Re: Apache http via tomcat WAR or Directory URL syntax (tomcat server.xml) for WAR application not working

2018-06-28 Thread Mark Thomas
On 28/06/18 09:58, Sandels Mark (RTH) OUH wrote:
> Hi Mark
> 
> 
> 
> Following your instructions, I get the following web-page in my browser. It 
> is not running the WAR application.
> 
> 
> Index of /oraclestatus
> 
>   *   Parent Directory
>   *   META-INF/
>   *   WEB-INF/
>   *   green_up.gif
>   *   index.jsp
>   *   red_down.gif

What happens when you click index.jsp. Do you see the source code for
that JSP? (I'm expecting the answer to be yes.)

Are you connecting directly to Tomcat or are you using a reverse proxy?
If yes, show us the proxy configuration.

If no, explain why your browser is connecting to port 8000 when Tomcat
is listening on port 8080 (based on the server.xml you showed us yesterday).

Mark

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



RE: Apache http via tomcat WAR or Directory URL syntax (tomcat server.xml) for WAR application not working

2018-06-28 Thread Sandels Mark (RTH) OUH
Hi Mark



Following your instructions, I get the following web-page in my browser. It is 
not running the WAR application.


Index of /oraclestatus

  *   Parent Directory
  *   META-INF/
  *   WEB-INF/
  *   green_up.gif
  *   index.jsp
  *   red_down.gif



Kind regards

Mark









Mark Sandels |Senior Systems Analyst/Programmer|IM & T Services – Integration 
Services Team |Manor House Annexe Room G22, Oxford University Hospitals NHS 
Trust , Headley Way, Headington, Oxford OX3 9RR |Phone:  01865 (5) 72103 | 
Email: mark.sand...@ouh.nhs.uk NHS colleagues can visit the OUH IM&T Services 
intranet site at http://ouhimt.oxnet.nhs.uk



-Original Message-
From: Mark Thomas [mailto:ma...@apache.org]
Sent: 27 June 2018 15:52
To: Tomcat Users List
Subject: Re: Apache http via tomcat WAR or Directory URL syntax (tomcat 
server.xml) for WAR application not working



On 27/06/18 15:44, Sandels Mark (RTH) OUH wrote:

> Thanks Chris

>

> Point taken. I have looked at the correct version of the Tomcat documentation 
> - the text is the same for the relevant section but thanks for pointing out 
> that I should check this.

>

> https://tomcat.apache.org/tomcat-9.0-doc/html-manager-howto.html#Deploy_a_Directory_or_WAR_by_URL

>

> Here is the other information you asked for:

>

> 1. Provide the name and location of your WAR file on the disk

>

> C:\Program Files (x86)\apache-tomcat-9.0.6\webapps\OracleStatus.war



Stop Tomcat.



If they exist, move C:\Program Files

(x86)\apache-tomcat-9.0.6\webapps\ROOT.war and C:\Program Files

(x86)\apache-tomcat-9.0.6\webapps\ROOT to a C:\Program Files

(x86)\apache-tomcat-9.0.6\webapps-backup (or any suitable back-up location).



Rename C:\Program Files

(x86)\apache-tomcat-9.0.6\webapps\OracleStatus.war to C:\Program Files

(x86)\apache-tomcat-9.0.6\webapps\ROOT##OracleStatus.war







> server.xml contents







>  WAR or Directory URL="file:C:\Program Files 
> (x86)\apache-tomcat-9.0.6\webapps\OracleStatus.war" />

> 



I feared as much.



Remove this entire  element from you server.xml



Start Tomcat.



Done (assuming your app works and doesn't require additional resources).





To repeat. You are mixing up configuration of a  element

(which shouldn't be in server.xml) with using the Manager web

application to deploy a new webapp.



You were reading this:

https://tomcat.apache.org/tomcat-9.0-doc/html-manager-howto.html#Deploy_a_Directory_or_WAR_by_URL



You should have been reading this:

http://tomcat.apache.org/tomcat-9.0-doc/config/host.html#Automatic_Application_Deployment



Mark



-

To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org

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




FW: Apache http via tomcat WAR or Directory URL syntax (tomcat server.xml) for WAR application not working

2018-06-28 Thread Sandels Mark (RTH) OUH
Hi Mark



Following your instructions, I get the following in my browser. It is not 
running the WAR application.



Kind regards

Mark





[cid:image001.png@01D40EB5.F2046230]



Mark Sandels |Senior Systems Analyst/Programmer|IM & T Services – Integration 
Services Team |Manor House Annexe Room G22, Oxford University Hospitals NHS 
Trust , Headley Way, Headington, Oxford OX3 9RR |Phone:  01865 (5) 72103 | 
Email: mark.sand...@ouh.nhs.uk NHS colleagues can visit the OUH IM&T Services 
intranet site at http://ouhimt.oxnet.nhs.uk



-Original Message-
From: Mark Thomas [mailto:ma...@apache.org]
Sent: 27 June 2018 15:52
To: Tomcat Users List
Subject: Re: Apache http via tomcat WAR or Directory URL syntax (tomcat 
server.xml) for WAR application not working



On 27/06/18 15:44, Sandels Mark (RTH) OUH wrote:

> Thanks Chris

>

> Point taken. I have looked at the correct version of the Tomcat documentation 
> - the text is the same for the relevant section but thanks for pointing out 
> that I should check this.

>

> https://tomcat.apache.org/tomcat-9.0-doc/html-manager-howto.html#Deploy_a_Directory_or_WAR_by_URL

>

> Here is the other information you asked for:

>

> 1. Provide the name and location of your WAR file on the disk

>

> C:\Program Files (x86)\apache-tomcat-9.0.6\webapps\OracleStatus.war



Stop Tomcat.



If they exist, move C:\Program Files

(x86)\apache-tomcat-9.0.6\webapps\ROOT.war and C:\Program Files

(x86)\apache-tomcat-9.0.6\webapps\ROOT to a C:\Program Files

(x86)\apache-tomcat-9.0.6\webapps-backup (or any suitable back-up location).



Rename C:\Program Files

(x86)\apache-tomcat-9.0.6\webapps\OracleStatus.war to C:\Program Files

(x86)\apache-tomcat-9.0.6\webapps\ROOT##OracleStatus.war







> server.xml contents







>  WAR or Directory URL="file:C:\Program Files 
> (x86)\apache-tomcat-9.0.6\webapps\OracleStatus.war" />

> 



I feared as much.



Remove this entire  element from you server.xml



Start Tomcat.



Done (assuming your app works and doesn't require additional resources).





To repeat. You are mixing up configuration of a  element

(which shouldn't be in server.xml) with using the Manager web

application to deploy a new webapp.



You were reading this:

https://tomcat.apache.org/tomcat-9.0-doc/html-manager-howto.html#Deploy_a_Directory_or_WAR_by_URL



You should have been reading this:

http://tomcat.apache.org/tomcat-9.0-doc/config/host.html#Automatic_Application_Deployment



Mark



-

To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org

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