Re: Server giving 404 since upgrade to Tomcat7

2017-07-25 Thread Peter Flynn
On 24/07/17 11:57, Mark Thomas wrote:
> On 24/07/17 11:12, Flynn, Peter wrote:

I must apologise first for unintentionally misleading you: the upgrade
was from Tomcat 7.0.54-2 to 7.0.69-11, not from 6 to 7. I inherited this
along with what was clearly bad information.

> Running from a package tends to limit the members of this that are 
> available to help to those that understand the packaging on the
> platform in question.

I'm afraid so. But I hope this is not about packaging, but about
modifying the configuration.

> Tomcat needs allowLinking to be correctly set if that path to a web
> application (or the web application itself) uses symlinks. I don't think
> that has changed between 6.0.x and 7.0.x.

There seem to be two, but I have never used or touched examples.

# find /var/lib/tomcat/webapps -type l -ls
5369297260 lrwxrwxrwx   1 tomcat   tomcat 40 Aug 11  2016
/var/lib/tomcat/webapps/examples/WEB-INF/lib/jstl.jar ->
/usr/share/java/jakarta-taglibs-core.jar
5369297270 lrwxrwxrwx   1 tomcat   tomcat 44 Aug 11  2016
/var/lib/tomcat/webapps/examples/WEB-INF/lib/standard.jar ->
/usr/share/java/jakarta-taglibs-standard.jar

>> # In new-style instances, if CATALINA_BASE isn't specified, it will
>> # be constructed by joining TOMCATS_BASE and NAME.
> 
> Those last two variables are package specific.

What is a 'package' in this context? A Tomcat application?

> The Tomcat logs should at least tell you what - if anything - Tomcat is
> deploying.

If I can make sense of them...

> There is no one 'right' way to install Tomcat. Pick the one that works
> best for you (and be prepared to try an alternative if you hit problems).

:-) I'd rather compile from scratch, but that's just the way I was
brought up.

On 24/07/17 14:50, Coty Sutherland wrote:
[...]
> In my experience, a 404 after an update (with no other application 
> changes) suggests that the application failed deployment. Can you 
> verify that you don't see any exceptions in your log?
I would if I knew what to look for :-) In /var/log/tomcat there are:

 • a catalina.out but it's empty
 • hundreds of host-manager.-mm-yy.log, all empty
 • hundreds of localhost.-mm-yy.log, all empty
 • hundreds of localhost_access_log.-mm-dd.txt, between 10–20MB each
 • dozens of catalina.out-mmdd.gz, 20 or so bytes each
 • dozens of catalina.-mm-dd.log, 30-100KB each
 • one catalina.out, empty

I realise this is probably CentOS's or RedHat's doing :-)

A typical catalina.-mm-dd.log starts with

> Jul 25, 2017 7:55:01 AM org.apache.catalina.core.StandardServer await
> INFO: A valid shutdown command was received via the shutdown port. Stopping 
> the Server ins
> tance.
> Jul 25, 2017 7:55:01 AM org.apache.coyote.AbstractProtocol pause
> INFO: Pausing ProtocolHandler ["http-bio-8080"]
> Jul 25, 2017 7:55:05 AM org.apache.catalina.core.AprLifecycleListener init
> INFO: The APR based Apache Tomcat Native library which allows optimal 
> performance in produ
> ction environments was not found on the java.library.path: 
> /usr/java/packages/lib/amd64:/u
> sr/lib64:/lib64:/lib:/usr/lib
> Jul 25, 2017 7:55:05 AM org.apache.tomcat.util.digester.SetPropertiesRule 
> begin
> WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 
> 'xmlValidation'
> to 'false' did not find a matching property.
> Jul 25, 2017 7:55:05 AM org.apache.tomcat.util.digester.SetPropertiesRule 
> begin
> WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 
> 'xmlNamespaceAwa
> re' to 'false' did not find a matching property.
> Jul 25, 2017 7:55:05 AM org.apache.tomcat.util.digester.SetPropertiesRule 
> begin
> WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 
> 'xmlValidation'
> to 'false' did not find a matching property.
> Jul 25, 2017 7:55:05 AM org.apache.tomcat.util.digester.SetPropertiesRule 
> begin
> WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 
> 'xmlNamespaceAwa
> re' to 'false' did not find a matching property.
> Jul 25, 2017 7:55:05 AM org.apache.tomcat.util.digester.SetPropertiesRule 
> begin
> WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 
> 'xmlValidation'
> to 'false' did not find a matching property.
> Jul 25, 2017 7:55:05 AM org.apache.tomcat.util.digester.SetPropertiesRule 
> begin
> WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 
> 'xmlNamespaceAwa
> re' to 'false' did not find a matching property.
> Jul 25, 2017 7:55:05 AM org.apache.coyote.AbstractProtocol init
> INFO: Initializing ProtocolHandler ["http-bio-8080"]
> Jul 25, 2017 7:55:05 AM org.apache.coyote.AbstractProtocol init
> INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
> Jul 25, 2017 7:55:05 AM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 586 ms
> Jul 25, 2017 7:55:05 AM org.apache.catalina.core.StandardService startInternal
> INFO: Starting service Catalina
and eventually gets round to

> 

Config file weirdness for additional applications

2009-10-30 Thread Peter Flynn
I am serving Cocoon as my default app under Tomcat5 on RHEL5 using a 
virtual host implemented in the Apache httpd.conf. This is now working 
fine (thanks to the explanations of others on this list!)


I now have to add another app, OpenClinica, in its own virtual host, so 
the DNS entry was made, and the httpd.conf section set up, and a Host 
element added to /etc/tomcat5/server.xml (where RHEL puts it). The 
OpenClinica.war file was deployed, and a new directory appeared in 
/etc/tomcat5/Catalina called openclinica.ucc.ie containing a file called 
OpenClinica.xml


The OpenClinica docs said the file would be at 
/usr/local/tomcat/conf/Catalina/localhost/OpenClinica.xml but in the 
light of where RHEL dictates stuff should go, and the fact that we are 
using a virtual host, this seems to be right. The file was edited to 
reflect the database username and password.


Then I found that Tomcat had also created another identical file in 
/etc/tomcat5/Catalina/publish.ucc.ie (our virtual host for the default 
Cocoon app). I don't understand why it did this, and it's unclear why it 
would want to, and it's also uncertain which one it will read. No such 
equivalent file was ever created when deploying Cocoon as the default app.


Does anyone have a suggestion as to what we are doing wrong? The 
OpenClinica app fails to authenticate to Postgresql, but that's a 
separate matter I have raised on their own list. It's the duplicate 
creation of the config file in two places at deployment time by Tomcat 
that puzzles me.


///Peter

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



Re: Config file weirdness for additional applications

2009-10-30 Thread Peter Flynn

Caldarale, Charles R wrote:

From: Peter Flynn [mailto:pfl...@ucc.ie]
Subject: Config file weirdness for additional applications

Then I found that Tomcat had also created another identical file in
/etc/tomcat5/Catalina/publish.ucc.ie (our virtual host for the default
Cocoon app).


Post your server.xml file.  I suspect the two Host entries have the same 
appBase setting, which is normally undesirable.


Indeed they do. But both ROOT and OpenClinica are subdirectories of 
webapps.


Host name=publish.ucc.ie appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
...
Host name=openclinica.ucc.ie appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

A copy of the full file is at http://minerva2.ucc.ie/software/server.xml

///Peter

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



Re: Config file weirdness for additional applications

2009-10-30 Thread Peter Flynn

Caldarale, Charles R wrote:

From: Peter Flynn [mailto:pfl...@ucc.ie]
Subject: Re: Config file weirdness for additional applications

Indeed they do. But both ROOT and OpenClinica are subdirectories of
webapps.


Which is why you're getting all webapps deployed under both Hosts.
Use different appBase directories for each Host if you don't want
that.


Interesting. Where should such new appBase directories be? Should they 
be siblings of webapps? eg /var/lib/tomcat5/abc, /var/lib/tomcat5/def, etc?


///Peter

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



Re: Config file weirdness for additional applications

2009-10-30 Thread Peter Flynn

Caldarale, Charles R wrote:


Interesting. Where should such new appBase directories be?


That's entirely up to you (and your sysadmin). 


So they don't have to be in and around the tomcat directories. OK, many 
thanks. I must have missed this in the docs: the plural status of the 
directory name webapps makes it sound as if you can have all your apps 
in there -- it's not apparent that that only applies when they are 
served from the same hostname.



3rd-party repackaged versions of Tomcat scatter files all over the
place, so there's no standard (unlike a true Tomcat download from
tomcat.apache.org).


The only thing the RH version seems to do is put the configs in /etc amd 
change the install location to /var/lib/tomcat5. An unfortunate 
constraint of having to work on a machine maintained by a central 
facility. At least the internal structure is untampered-with.


///Peter

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



Re: Multiple applications

2009-07-30 Thread Peter Flynn

André Warnier wrote:

Peter Flynn wrote:

Hassan Schroeder wrote:

On Tue, Jun 23, 2009 at 7:37 AM, Peter Flynn pfl...@ucc.ie wrote:

I've been using Tomcat5 with Apache2 under RH5 to run Cocoon, but I
now need to add Lucene and eXist. Is it possible to run multiple
applications like this on the same machine using the same Tomcat
server?



Hi.
I believe that I may be about at the same level as yourself for such 
things - which is far below the level of the gurus you have been talking 
to so far - and therefore that my explanations that follow, whilst being 
maybe less accurate, may be more accessible.


This is excellent and very helpful, thank you very much.
I will digest this when I next get a slot.

Yes, I also dislike running the RHEL repackaging, but in this case the 
system is maintained by the engineers on the basis that I do *not* add 
non-RHEL versions of things that are available in RHEL packages. Silly, 
but unavoidable. RHEL is hopelessly out of date in so many areas, and 
they have this compulsion to meddle which is very annoying. But in the 
case of Tomcat I have located all the bits and pieces, so it's not a 
major problem.


///Peter

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



Re: Multiple applications

2009-07-29 Thread Peter Flynn

Hassan Schroeder wrote:

On Tue, Jun 23, 2009 at 7:37 AM, Peter Flynn pfl...@ucc.ie wrote:

I've been using Tomcat5 with Apache2 under RH5 to run Cocoon, but I
now need to add Lucene and eXist. Is it possible to run multiple
applications like this on the same machine using the same Tomcat
server?


Yes.


I only get a short time per month to look at this stuff so my apologies 
for not getting back sooner.



At the moment, all Cocoon pages get an extra cocoon/ token
inserted in their URI, eg http://myhost.server.domain/cocoon/stuff.
I did look at just replacing ROOT in webapps but that seems a
little heavy-handed,


Renaming a directory (or war file) is heavy-handed???


I would have thought so -- with an outsider's eyes. One doesn't normally 
want to mess with the default directory layout of installed software, 
only add to it and edit configs. I don't know what the default ROOT 
actually does.



and it would seem to defeat any chance of adding Lucene and eXist.


No it wouldn't.


Excellent, thanks.


Look at the examples that come with the standard distro. It should be
apparent that (and how) multiple webapps are supported.


...and Caldarale, Charles R wrote:
 Clearly you can - look how many independent webapps are deployed in
 the standard Tomcat download.

Unfortunately that is opaque to me. This is /var/lib/tomcat5 (under RHEL4):

  drwxr-x---  5 root   tomcat 4096 Feb 27  2008 balancer
  drwxr-xr-x  9 tomcat tomcat 4096 Apr 21 12:00 cocoon
  drwxrwxr-x 21 root   tomcat 4096 Apr  7  2008 jsp-examples
  drwxrwxr-x  4 root   tomcat 4096 Apr  7  2008 ROOT
  drwxrwxr-x  4 root   tomcat 4096 Apr  7  2008 servlets-examples
  drwxrwxr-x 12 root   tomcat 4096 Apr  7  2008 tomcat-docs
  drwxrwxr-x  3 root   tomcat 4096 Apr  7  2008 webdav

Apart from cocoon, which I added, I am not aware of what balancer is or 
what I might want it for. I can see examples, and tomcat-docs, and I 
know what webdav is (although I don't use it). But these look to me like 
utilities that come with Tomcat, rather than apps. No matter, if apps 
they are, that's fine.


Caldarale, Charles R wrote:

Replacing ROOT with your desired default webapp for the domain is not
heavy-handed, it's expected.


Aha.


You can obviously only have one default webapp per Host; other
webapps for the Host have to be explicitly named.


Yes, but where does this explicit naming take place? server.xml? web.xml?

I currently have a Host element type in server.xml naming the host 
(which is a cname; this is all front-ended by Apache with a VH):


Host name=publish.ucc.ie appBase=webapps
  unpackWARs=true autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false
!-- default application is Cocoon --
  Context path= docBase=/var/www/xml/
   debug=9 crossContext=true/
!-- anything with a slash is also the default --
  Context path=/ docBase=/var/www/xml/
   debug=9 crossContext=true/
...

This is currently all working and http://publish.ucc.ie is correctly 
bringing up my Cocoon pages.


[me]

Is there another way to get rid of the cocoon/, because the
Cocoon pages will be the interface the user sees (but somehow
preserve an equivalent lucene/ and eXist/ because they won't be
seen much)?


Rename your Cocoon webapp to ROOT (remove the old ROOT first), and

 install your Lucene and eXist applications under whatever names you
 choose under the Host appBase directory.

Leave Lucene and eXist aside for the moment. I renamed ROOT to OLDROOT 
and renamed the cocoon directory to ROOT. Restarted tomcat and apache. 
But when I tried http://publish.ucc.ie I got a Tomcat 404


   The requested resource (/cocoon) is not available.

Somewhere it's not looking in the right place. What other changes are 
needed to make it pick up the app that is in the ROOT directory?


(I've renamed them all back the way they were for the moment.)


You likely only have one Host, and if you haven't changed the

 default appBase setting, it's the webapps directory.

Exactly.

 Your structure should look like this:


${CATALINA_BASE} 

   webapps
 ROOT (containing your Cocoon webapp)
 lucene (containing your Lucene webapp)
 exist (containing your eXist webapp)

Yes, although lucene and exist aren't there yet, and there is the other 
default stuff in webapps as shown in the listing above.)



The names are case-sensitive, so choose them carefully; they can be

 anything you choose, other than ROOT.

I'm still trying to get it to serve cocoon when I move the default ROOT 
out of the way and rename the cocoon directory to ROOT, but there is 
obviously some other key piece of information I am missing here.


David Smith wrote:
You can name your cocoon webapp ROOT and then add lucene and eXist 
webapps. If lucene or eXist webapps exist, the request will go to 
them. It'll only hit ROOT if those webapps aren't there or running. 
This falls under the requirement of servlet containers to make the 
longest match at each stage

Multiple applications

2009-06-23 Thread Peter Flynn
I've been using Tomcat5 with Apache2 under RH5 to run Cocoon, but I now 
need to add Lucene and eXist. Is it possible to run multiple 
applications like this on the same machine using the same Tomcat server?


Someone mentioned something about another Tomcat instance but I don't 
know if this is required, and I can't find any documentation about it.


At the moment, all Cocoon pages get an extra cocoon/ token inserted in 
their URI, eg http://myhost.server.domain/cocoon/stuff. I did look at 
just replacing ROOT in webapps but that seems a little heavy-handed, and 
it would seem to defeat any chance of adding Lucene and eXist.


Is there another way to get rid of the cocoon/, because the Cocoon 
pages will be the interface the user sees (but somehow preserve an 
equivalent lucene/ and eXist/ because they won't be seen much)?


///Peter

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



Running more than one application

2009-02-16 Thread Peter Flynn
I have been running Cocoon 2.1.11 successfully on its own for some time 
in Tomcat 5.5.23 under RHEL5 with Apache httpd 2.2.3 but I now need to 
add Lucene and some other apps.


The cocoon.war was unwrapped in webapps, and the only installation mods 
I made were to add the virtual host block to Apache's httpd.conf


VirtualHost *:80
DocumentRoot /var/www/xml
ProxyPreserveHost On
ProxyPass / ajp://localhost:8009/cocoon/
ProxyPassReverse / ajp://localhost:8009/cocoon/
ServerName my.server.name
/VirtualHost

and modified the sample Host element to match in server.xml

Host name=my.server.name appBase=webapps
  unpackWARs=true autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false
  Context path= docBase=/var/www/xml/
   debug=9 crossContext=true/
  Context path=/ docBase=/var/www/xml/
   debug=9 crossContext=true/
...

(This may be suboptimal /var/www/xml/ is where my XML/XSLT files are, 
but it's unclear to me if this is actually needed at this level of the 
config.)


This worked fine to test what I am doing in Cocoon, although the server 
sticks in an unwanted /cocoon/ into the URI.  Now I need to add Lucene 
and several other apps (via .war files) but I am having difficulty 
understanding how to configure Tomcat to use multiple apps.


As far as I understand it:

a) I need to make Cocoon the default app, because that's what the bulk 
of the work will run through (but I'm happy to be told this is wrong). 
Comments in the mailing lists indicate that this will also get rid of 
the intrusive /cocoon in the URIs.


b) I then add the other apps in servlet-mappings in web.xml

I deleted the ROOT directory in webapps; renamed the cocoon directory to 
ROOT; removed the /cocoon from the httpd.conf; and added this to web.xml 
(and restarted tomcat5 and httpd)


servlet-mapping
  servlet-nameCocoon/servlet-name
  url-pattern/*/url-pattern
/servlet-mapping

But accessing any URI using the virtual hostname then brought up the 
Tomcat 404 error requested resource (/what/ever) is not available.


I have obviously misunderstood something vital here, but the docs don't 
seem to address this particular configuration, and my knowledge of Java 
isn't sufficient to dig into the innards of Tomcat.


///Peter

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