Re: Configuring which Servlet is invoked

2010-10-12 Thread Mark Eggers
Chris,

I'm going to leap into the middle of this discussion. Please feel free to 
discount what I'm going to say since I've just briefly glanced at the Roller 
5.0 
RC2 documentation.

From what I understand, the intent is to have one Roller application running 
as 
the default web application (ROOT) on a Tomcat server, and have it be the 
default application for multiple blogger domains.

From the Wiki page, Roller will handle multiple domains with one application 
by 
referring to a properties file, such as:

# roller-custom.properties weblog.absoluteurl.photophys=http://photophys.com 
weblog.absoluteurl.alex=http://greenimp.me 
weblog.absoluteurl.linus=http://linusjohnson.com

I'm guessing that somewhere in the Roller application these absolute URLs are 
mapped to internal URLs. Maybe this works like an internal mod_rewrite? I don't 
know, since I haven't looked at the code.

Let's assume for a minute that Roller acts as if it has its own URL rewrite 
engine. If that's the case, then all Tomcat has to do is deliver the multiple 
URLs to the same application.

In other words, photophys.com, greenimp.me, and linusjohnson.com should all be 
delivered to the ROOT web application of the default host, and Roller will 
figure out what to do from there.

If that's the case, then what I think you need are aliases along with the 
default host definition. So using the above example, the following Host 
element can be constructed:

  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
Aliasphotophys.com/Alias
Aliasgreenimp.me/Alias
Aliaslinusjohnson.com/Alias
  /Host

You'll have to set up all aliases to resolve to the same IP address that is 
your 
host. For
testing, this can be done in the hosts file. In Linux it's /etc/hosts as long 
as 
your nsswitch.conf includes files for host resolution. In Windows/XP (don't 
know 
about other versions), it's in Windows\system32\drivers\etc.

Hopefully Roller will do the correct thing internally.

Fronting this with Apache httpd should not be too difficult if the above works. 
Basically, you'll use name-based virtual hosts with mod_jk (or mod_proxy_ajp) 
to 
map / and /* back to the same Tomcat server. Again, hopefully Roller will 
figure 
things out with the Alias elements.

If I'm completely off base, please forgive the rambling. Again, I've not played 
with Roller (and this appears to be a release candidate), not looked at the 
source code, nor done more than skim one web page and the PDF docs.

. . . just my two cents.

/mde/

- Original Message 
From: Christopher Dodunski chrisfromsquir...@christopher.net.nz
To: users@tomcat.apache.org
Sent: Mon, October 11, 2010 9:20:48 PM
Subject: Re: Configuring which Servlet is invoked

Catalina logs contain some entries that may shine some light on the matter...

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
/home/roller/application/optomus does not exist or is not a readable
directory
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/optomus]
has not been started

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
/home/roller/application/christopher does not exist or is not a readable
directory
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/christopher]

has not been started

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
/home/roller/application/host-manager does not exist or is not a readable
directory
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/host-manager]

has not been started

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
/home/roller/application/manager does not exist or is not a readable
directory
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/manager]
has not been started

Is it a Tomcat requirement that additional hosts (appBase) must each
contain manager and host-manager?  This appBase currently contains
ROOT (Roller) only.

The first two errors above make no sense to me.

Chris.


-
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: Configuring which Servlet is invoked

2010-10-12 Thread Pid
On 12/10/2010 02:54, Christopher Dodunski wrote:
   Host name=http://blog.christopher.net.nz;
 appBase=/home/roller/application
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false /
 
 /Engine

Remove the http://; bit from the name attribute.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Configuring which Servlet is invoked

2010-10-12 Thread Christopher Dodunski
Hi, you're looking at an old version of Host.  The latest (just above)
contains blog.optomus.com and contains several Alias elements.

Chris.


 On 12/10/2010 02:54, Christopher Dodunski wrote:
   Host name=http://blog.christopher.net.nz;
 appBase=/home/roller/application
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false /

 /Engine

 Remove the http://; bit from the name attribute.


 p




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



Re: Configuring which Servlet is invoked

2010-10-12 Thread Pid
On 12/10/2010 05:20, Christopher Dodunski wrote:
 Catalina logs contain some entries that may shine some light on the matter...
 
 SEVERE: Error starting static Resources
 java.lang.IllegalArgumentException: Document base
 /home/roller/application/optomus does not exist or is not a readable
 directory
 INFO: Container
 org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/optomus]
 has not been started
 
 SEVERE: Error starting static Resources
 java.lang.IllegalArgumentException: Document base
 /home/roller/application/christopher does not exist or is not a readable
 directory
 INFO: Container
 org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/christopher]
 has not been started
 
 SEVERE: Error starting static Resources
 java.lang.IllegalArgumentException: Document base
 /home/roller/application/host-manager does not exist or is not a readable
 directory
 INFO: Container
 org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/host-manager]
 has not been started
 
 SEVERE: Error starting static Resources
 java.lang.IllegalArgumentException: Document base
 /home/roller/application/manager does not exist or is not a readable
 directory
 INFO: Container
 org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/manager]
 has not been started
 
 Is it a Tomcat requirement that additional hosts (appBase) must each
 contain manager and host-manager?  This appBase currently contains
 ROOT (Roller) only.
 
 The first two errors above make no sense to me.

Stop Tomcat.
Check the tomcat/conf/hostname/ directories and remove any context
definition files which shouldn't be in that Host.
Start Tomcat.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


RE: Configuring which Servlet is invoked

2010-10-12 Thread Caldarale, Charles R
 From: Mark Eggers [mailto:its_toas...@yahoo.com] 
 Subject: Re: Configuring which Servlet is invoked

 If that's the case, then what I think you need are aliases 
 along with the default host definition.

Alias elements are *never* needed with the defaultHost; adding them may serve 
a documentation purpose, but not a functional one.  Remember, all requests for 
domains that do not match a Host or Alias name are delivered to the 
defaultHost, so specifying any Alias elements for that one is a waste of time 
(and memory).

 You'll have to set up all aliases to resolve to the same IP 
 address that is your host.

Not quite accurate; by default, Tomcat listens on all IP addresses assigned to 
the box, so the domains can resolve to *any* IP address assigned to the server.

 For testing, this can be done in the hosts file.

Only if the client is running on the same system as Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: Configuring which Servlet is invoked

2010-10-12 Thread André Warnier

Caldarale, Charles R wrote:



For testing, this can be done in the hosts file.


Only if the client is running on the same system as Tomcat.


Not true.
But it must be done in the hosts file of the client, not the server.

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



Re: Configuring which Servlet is invoked

2010-10-12 Thread Mark Eggers
Yep, you're right on the Alias of course. This is what happens when I try to 
follow a thread at 3 am.

Yes, for testing only. Obviously host files will have no impact for other hosts.

Sorry for the comments.

/mde/


- Original Message 
From: Caldarale, Charles R chuck.caldar...@unisys.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Tue, October 12, 2010 7:43:35 AM
Subject: RE: Configuring which Servlet is invoked

 From: Mark Eggers [mailto:its_toas...@yahoo.com] 
 Subject: Re: Configuring which Servlet is invoked

 If that's the case, then what I think you need are aliases 
 along with the default host definition.

Alias elements are *never* needed with the defaultHost; adding them may serve 
a documentation purpose, but not a functional one.  Remember, all requests for 
domains that do not match a Host or Alias name are delivered to the 
defaultHost, so specifying any Alias elements for that one is a waste of time 
(and memory).

 You'll have to set up all aliases to resolve to the same IP 
 address that is your host.

Not quite accurate; by default, Tomcat listens on all IP addresses assigned to 
the box, so the domains can resolve to *any* IP address assigned to the server.

 For testing, this can be done in the hosts file.

Only if the client is running on the same system as Tomcat.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To 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: Configuring which Servlet is invoked

2010-10-11 Thread Pid
On 11/10/2010 08:53, Christopher Dodunski wrote:
 Hello,
 
 I have a slight problem, and am having difficulty determining which part
 of the Tomcat documentation applies in my case.
 
 Apache HTTP Server version (as proxy): 2.2.9 (Debian)
 Tomcat version: 6.0.29
 
 **My Problem**
 Apache Roller weblogger is running on Tomcat with ROOT context, and is
 hosting several blog pages, each with a unique domain (Roller supports
 this).  Here are two:
 
 http://blog.bread.co.nz
 http://blog.christopher.net.nz
 
 By way of mod_proxy, requests to the above are forwarded on to Tomcat, AJP
 port 8009.  Moreover, mod_rewrite modifies the URLs thus:
 
 http://blog.bread.co.nz/bread/
 http://blog.christopher.net.nz/christopher/
 
 Roller uses the last part of the URL to determine which particular blog to
 serve up.  In the first example, bread.  However, the second isn't
 working as intended.
 
 Because I also happen to have an unrelated web application running at
 webapps/christopher (bearing in mind that Roller is found at
 webapps/ROOT), requests to the second URL above are being forwarded on to
 webapps/christopher.  So the response comes from a Servlet found here, and
 not from Roller.
 
 I imagine adding a directive to server.xml will have the situation sorted.
  Obviously, webapps/christopher should respond to requests made to
 http://my_main_domain:8080/christopher.  But webapps/ROOT should respond
 to requests made to http://blog.christopher.net.nz/christopher.
 
 I'd appreciate some help in getting this sorted.  In the meanwhile, I've
 had to switch webapps/christopher off.

Deploy this app on it's own domain, leave the rest on the default domain.

 http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html


p



0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Configuring which Servlet is invoked

2010-10-11 Thread Christopher Dodunski
Hi,

Thanks, but I'm not quite clear on how to direct Tomcat to call the ROOT
application for a given domain.  I added the bottom Host element to
server.xml, but it doesn't appear to work correctly.

Engine name=Catalina defaultHost=localhost
  Host name=localhost  appBase=webapps unpackWARs=true
autoDeploy=true xmlValidation=false xmlNamespaceAware=false
  /Host
  Host name=blog.christopher.net.nz appBase=webapps/ROOT /
/Engine

Previously, the URL http://blog.christopher.net.nz/christopher called up
webapps/christopher, when it should instead have been handled by Apache
Roller running with ROOT context.  Now that I have added the above
directive, Tomcat reports The requested resource () is not available.

The URL http://blog.bread.co.nz/bread is handled by Roller, as intended,
because there is no competing application at webapps/bread.

Regards,

Chris.


 On 11/10/2010 08:53, Christopher Dodunski wrote:
 Hello,

 I have a slight problem, and am having difficulty determining which part
 of the Tomcat documentation applies in my case.

 Apache HTTP Server version (as proxy): 2.2.9 (Debian)
 Tomcat version: 6.0.29

 **My Problem**
 Apache Roller weblogger is running on Tomcat with ROOT context, and is
 hosting several blog pages, each with a unique domain (Roller supports
 this).  Here are two:

 http://blog.bread.co.nz
 http://blog.christopher.net.nz

 By way of mod_proxy, requests to the above are forwarded on to Tomcat,
 AJP
 port 8009.  Moreover, mod_rewrite modifies the URLs thus:

 http://blog.bread.co.nz/bread/
 http://blog.christopher.net.nz/christopher/

 Roller uses the last part of the URL to determine which particular blog
 to
 serve up.  In the first example, bread.  However, the second isn't
 working as intended.

 Because I also happen to have an unrelated web application running at
 webapps/christopher (bearing in mind that Roller is found at
 webapps/ROOT), requests to the second URL above are being forwarded on
 to
 webapps/christopher.  So the response comes from a Servlet found here,
 and
 not from Roller.

 I imagine adding a directive to server.xml will have the situation
 sorted.
  Obviously, webapps/christopher should respond to requests made to
 http://my_main_domain:8080/christopher.  But webapps/ROOT should respond
 to requests made to http://blog.christopher.net.nz/christopher.

 I'd appreciate some help in getting this sorted.  In the meanwhile, I've
 had to switch webapps/christopher off.

 Deploy this app on it's own domain, leave the rest on the default domain.

  http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html


 p


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



Re: Configuring which Servlet is invoked

2010-10-11 Thread André Warnier

Christopher Dodunski wrote:

Hi,

Thanks, but I'm not quite clear on how to direct Tomcat to call the ROOT
application for a given domain.  I added the bottom Host element to
server.xml, but it doesn't appear to work correctly.


See here :
http://wiki.apache.org/tomcat/HowTo

#39


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



Re: Configuring which Servlet is invoked

2010-10-11 Thread André Warnier

Christopher Dodunski wrote:

Hi,

Thanks, but I'm not quite clear on how to direct Tomcat to call the ROOT
application for a given domain.  I added the bottom Host element to
server.xml, but it doesn't appear to work correctly.

Engine name=Catalina defaultHost=localhost
  Host name=localhost  appBase=webapps unpackWARs=true
autoDeploy=true xmlValidation=false xmlNamespaceAware=false
  /Host
  Host name=blog.christopher.net.nz appBase=webapps/ROOT /
/Engine

Previously, the URL http://blog.christopher.net.nz/christopher called up
webapps/christopher, when it should instead have been handled by Apache
Roller running with ROOT context.  Now that I have added the above
directive, Tomcat reports The requested resource () is not available.

The URL http://blog.bread.co.nz/bread is handled by Roller, as intended,
because there is no competing application at webapps/bread.

It is difficult to respond clearly to your questions, because they seem to be based on the 
wrong premises, and/or they are confusing as to what you are really trying to achieve.

We also have no idea what the ROLLER application is, and how itself needs to be 
set up.

But here are some basic principles :

1) this line :
 Engine name=Catalina defaultHost=localhost
indicates which one of your Host below, is the default host.
The default Host is the one which will handle any request which arrives at this server, 
and for which the hostname does not match one of the other Host tags.

In you case thus, this
Host name=localhost..
is the default Host.

2) each separate Host should have a separate appBase, not overlapping the 
others.
So, having one Host with appBase=webapps, and another Host with appBase=webapps/ 
is a nono, you should not do that.
Create another directory, for example (tomcat_dir)/webapps-blog, and use that one to put 
the applications related to your host blog.christopher.net.nz, like

Host name=blog.christopher.net.nz appBase=webapps-blog /
(You can also define this directory totally outside the hierarchy of the main Tomcat, like 
at /var/websites/blog.christopher.net.nz, and then use

Host name=blog.christopher.net.nz 
appBase=/var/websites/blog.christopher.net.nz /

3) within each applications base (appBase), each application will correspond to a 
directory, with the same name as the application.
So for example, under (tomcat_dir)/webapps/, you can have one application called app1 
and another called app2, for a structure like this

  tomcat_dir/webapps/
app1/
app2/

4) To call any of these applications, you will use a URL like :
   http://host-name/app1
   http://host-name/app2
   etc..

5) the special name ROOT is reserved for the default application within a 
Host.
   That is the application which users would get if they simply entered
   http://host-name/

So, to modify the structure given above so that there would be, in addition to app1 anbd 
app2, a default application, you would have :


  a) a file structure like this :
  tomcat_dir/webapps/
ROOT/
app1/
app2/
and users could ask for :

   http://host-name/  (to get the default application)
   http://host-name/app1  (to get the app1 application)
   http://host-name/app2  (to get the app2 application)

Does this clarify things ?


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



Re: Configuring which Servlet is invoked

2010-10-11 Thread Christopher Dodunski
Hi,

Thank you André for your clear explanation below.  I am aware already of
how the directory structure relates to URL formation and, thanks to you
and others, now understand the significance of Host elements within an
Engine.  And I see how the default host is configured.

It doesn't, though, quite answer my particular issue.  Apache Roller is a
weblog server, that handles multiple domains - e.g. blog.host1.com,
blog.host2, etc.  But, at the present time, to correctly form URLs within
the HTML it serves up, Roller must run as the default Tomcat application. 
Therefore, it is installed at /usr/local/tomcat/webapps/ROOT.

Here is what is happening:

1) HTTP request comes into my webserver with the URL:
http://blog.christopher.net.nz
2) Apache HTTP server receives this on port #80
3) mod_rewrite appends /christopher to the end of the URL of the request
header (Roller recognises this as the handle, so it serves up the
correct blog page)
4) mod_proxy forwards request on to Tomcat's AJP port #8009
5) Tomcat receives this but, with the current configuration, invokes the
application at webapps/christopher.  Instead, I would like it to invoke
the default (Roller) application at webapps/ROOT.

Interestingly, if I browse to another domain hosted by Roller -
http://blog.bread.co.nz(/bread) - as I don't happen to have an application
at webapps/bread, Tomcat handles this fine.  The default application
(Roller) serves up the weblog for handle=bread.

Thanks  regards,

Chris.


 Christopher Dodunski wrote:
 Hi,

 Thanks, but I'm not quite clear on how to direct Tomcat to call the ROOT
 application for a given domain.  I added the bottom Host element to
 server.xml, but it doesn't appear to work correctly.

 Engine name=Catalina defaultHost=localhost
   Host name=localhost  appBase=webapps unpackWARs=true
 autoDeploy=true xmlValidation=false xmlNamespaceAware=false
   /Host
   Host name=blog.christopher.net.nz appBase=webapps/ROOT /
 /Engine

 Previously, the URL http://blog.christopher.net.nz/christopher called up
 webapps/christopher, when it should instead have been handled by Apache
 Roller running with ROOT context.  Now that I have added the above
 directive, Tomcat reports The requested resource () is not available.

 The URL http://blog.bread.co.nz/bread is handled by Roller, as intended,
 because there is no competing application at webapps/bread.

 It is difficult to respond clearly to your questions, because they seem to
 be based on the
 wrong premises, and/or they are confusing as to what you are really trying
 to achieve.
 We also have no idea what the ROLLER application is, and how itself needs
 to be set up.

 But here are some basic principles :

 1) this line :
   Engine name=Catalina defaultHost=localhost
 indicates which one of your Host below, is the default host.
 The default Host is the one which will handle any request which arrives at
 this server,
 and for which the hostname does not match one of the other Host tags.
 In you case thus, this
 Host name=localhost..
 is the default Host.

 2) each separate Host should have a separate appBase, not overlapping
 the others.
 So, having one Host with appBase=webapps, and another Host with
 appBase=webapps/
 is a nono, you should not do that.
 Create another directory, for example (tomcat_dir)/webapps-blog, and use
 that one to put
 the applications related to your host blog.christopher.net.nz, like
 Host name=blog.christopher.net.nz appBase=webapps-blog /
 (You can also define this directory totally outside the hierarchy of the
 main Tomcat, like
 at /var/websites/blog.christopher.net.nz, and then use
 Host name=blog.christopher.net.nz
 appBase=/var/websites/blog.christopher.net.nz /

 3) within each applications base (appBase), each application will
 correspond to a
 directory, with the same name as the application.
 So for example, under (tomcat_dir)/webapps/, you can have one application
 called app1
 and another called app2, for a structure like this
tomcat_dir/webapps/
  app1/
  app2/

 4) To call any of these applications, you will use a URL like :
 http://host-name/app1
 http://host-name/app2
 etc..

 5) the special name ROOT is reserved for the default application
 within a Host.
 That is the application which users would get if they simply entered
 http://host-name/

 So, to modify the structure given above so that there would be, in
 addition to app1 anbd
 app2, a default application, you would have :

a) a file structure like this :
tomcat_dir/webapps/
  ROOT/
  app1/
  app2/
 and users could ask for :

 http://host-name/  (to get the default application)
 http://host-name/app1  (to get the app1 application)
 http://host-name/app2  (to get the app2 application)

 Does this clarify things ?


-
To unsubscribe, e-mail: 

Re: Configuring which Servlet is invoked

2010-10-11 Thread Christopher Dodunski
Hi André,

So, based on your explanation below, Tomcat can actually have more than
one default application?  It can have one for each and every Host?  This
is most interesting.  I had assumed that the default application had to be
installed at webapps/ROOT (or anywhere else the default host's appBase
happened to be).

Chris.


 Christopher Dodunski wrote:
 Hi,

 Thanks, but I'm not quite clear on how to direct Tomcat to call the ROOT
 application for a given domain.  I added the bottom Host element to
 server.xml, but it doesn't appear to work correctly.

 Engine name=Catalina defaultHost=localhost
   Host name=localhost  appBase=webapps unpackWARs=true
 autoDeploy=true xmlValidation=false xmlNamespaceAware=false
   /Host
   Host name=blog.christopher.net.nz appBase=webapps/ROOT /
 /Engine

 Previously, the URL http://blog.christopher.net.nz/christopher called up
 webapps/christopher, when it should instead have been handled by Apache
 Roller running with ROOT context.  Now that I have added the above
 directive, Tomcat reports The requested resource () is not available.

 The URL http://blog.bread.co.nz/bread is handled by Roller, as intended,
 because there is no competing application at webapps/bread.

 It is difficult to respond clearly to your questions, because they seem to
 be based on the
 wrong premises, and/or they are confusing as to what you are really trying
 to achieve.
 We also have no idea what the ROLLER application is, and how itself needs
 to be set up.

 But here are some basic principles :

 1) this line :
   Engine name=Catalina defaultHost=localhost
 indicates which one of your Host below, is the default host.
 The default Host is the one which will handle any request which arrives at
 this server,
 and for which the hostname does not match one of the other Host tags.
 In you case thus, this
 Host name=localhost..
 is the default Host.

 2) each separate Host should have a separate appBase, not overlapping
 the others.
 So, having one Host with appBase=webapps, and another Host with
 appBase=webapps/
 is a nono, you should not do that.
 Create another directory, for example (tomcat_dir)/webapps-blog, and use
 that one to put
 the applications related to your host blog.christopher.net.nz, like
 Host name=blog.christopher.net.nz appBase=webapps-blog /
 (You can also define this directory totally outside the hierarchy of the
 main Tomcat, like
 at /var/websites/blog.christopher.net.nz, and then use
 Host name=blog.christopher.net.nz
 appBase=/var/websites/blog.christopher.net.nz /

 3) within each applications base (appBase), each application will
 correspond to a
 directory, with the same name as the application.
 So for example, under (tomcat_dir)/webapps/, you can have one application
 called app1
 and another called app2, for a structure like this
tomcat_dir/webapps/
  app1/
  app2/

 4) To call any of these applications, you will use a URL like :
 http://host-name/app1
 http://host-name/app2
 etc..

 5) the special name ROOT is reserved for the default application
 within a Host.
 That is the application which users would get if they simply entered
 http://host-name/

 So, to modify the structure given above so that there would be, in
 addition to app1 anbd
 app2, a default application, you would have :

a) a file structure like this :
tomcat_dir/webapps/
  ROOT/
  app1/
  app2/
 and users could ask for :

 http://host-name/  (to get the default application)
 http://host-name/app1  (to get the app1 application)
 http://host-name/app2  (to get the app2 application)

 Does this clarify things ?






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



RE: Configuring which Servlet is invoked

2010-10-11 Thread Caldarale, Charles R
 From: Christopher Dodunski [mailto:chrisfromsquir...@christopher.net.nz] 
 Subject: Re: Configuring which Servlet is invoked

 So, based on your explanation below, Tomcat can actually have 
 more than one default application?

Yes - there is always one per Host.

You need to make the blog Host the defaultHost, and have your christopher app 
handled by a separate Host for blog.christopher.net.nz, with a different 
appBase setting.  You could remove the fiddling done by httpd, and just rename 
the christopher app to ROOT for the second Host.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



RE: Configuring which Servlet is invoked

2010-10-11 Thread Christopher Dodunski
Hi,

Okay, I have now set up two Host elements inside server.xml with
appBases in two entirely different places...

Engine name=Catalina defaultHost=localhost

  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
  /Host

  Host name=http://blog.christopher.net.nz;
appBase=/home/roller/application
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false /

/Engine

Have restarted Tomcat, but Tomcat isn't unpacking
/home/roller/application/ROOT.war as expected.  The catalina.out log
doesn't seem to give a reason.  Have I missed an important step?

Thanks,

Chris.


 From: Christopher Dodunski [mailto:chrisfromsquir...@christopher.net.nz]
 Subject: Re: Configuring which Servlet is invoked

 So, based on your explanation below, Tomcat can actually have
 more than one default application?

Yes - there is always one per Host.

You need to make the blog Host the defaultHost, and have your
christopher app \
handled by a separate Host for blog.christopher.net.nz, with a different
appBase \
setting.  You could remove the fiddling done by httpd, and just rename the \
christopher app to ROOT for the second Host.

 - Chuck


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



RE: Configuring which Servlet is invoked

2010-10-11 Thread Caldarale, Charles R
 From: Christopher Dodunski [mailto:chrisfromsquir...@christopher.net.nz] 
 Subject: RE: Configuring which Servlet is invoked

 I have now set up two Host elements inside server.xml with
 appBases in two entirely different places...

 Engine name=Catalina defaultHost=localhost
   Host name=localhost  appBase=webapps
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false
   /Host

The first Host above should be the one running the blogging app; is that 
correct?

   Host name=http://blog.christopher.net.nz;
 appBase=/home/roller/application
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false /

Are the appBase settings switched?  I would have thought the roller directory 
would be associated with the blogging webapp, based on your previous 
descriptions.

 Have restarted Tomcat, but Tomcat isn't unpacking
 /home/roller/application/ROOT.war as expected.

Does Tomcat have read and write access to that directory?

 The catalina.out log doesn't seem to give a reason.

Possibly the wrong log file to look at.  What do the others have in them?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



RE: Configuring which Servlet is invoked

2010-10-11 Thread Christopher Dodunski
Hi Chuck,

The unpacking matter is now sorted - Tomcat didn't have write access.

Regarding which is default host, I already have several applications
hosted on Tomcat, and these are called by Apache HTTP (proxy) server like
so:

ProxyPass /tomcat ajp://127.0.0.1:8009/christopher/
ProxyPassReverse /tomcat ajp://127.0.0.1:8009/christopher/

My preference would be to leave localhost/127.0.0.1 as the default host. 
All applications (except Roller) are installed at
/usr/local/tomcat/webapps.

Roller hosts multiple domains, and so I can't see how this can be the
default host.  I thought the best option might be to set up a Host for
each domain Roller serves, all with appBase=/home/roller/application. 
Is this the best solution in your opinion?

Thanks,

Chris.


 From: Christopher Dodunski [mailto:chrisfromsquir...@...]
 Subject: RE: Configuring which Servlet is invoked

 I have now set up two Host elements inside server.xml with
 appBases in two entirely different places...

 Engine name=Catalina defaultHost=localhost
   Host name=localhost  appBase=webapps
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false
   /Host

The first Host above should be the one running the blogging app; is that
correct?

   Host name=http://blog.christopher.net.nz;
 appBase=/home/roller/application
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false /

Are the appBase settings switched?  I would have thought the roller
directory would be associated with the blogging webapp, based on your
previous descriptions.

 Have restarted Tomcat, but Tomcat isn't unpacking
 /home/roller/application/ROOT.war as expected.

Does Tomcat have read and write access to that directory?

 The catalina.out log doesn't seem to give a reason.

Possibly the wrong log file to look at.  What do the others have in them?

 - Chuck


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



RE: Configuring which Servlet is invoked

2010-10-11 Thread Caldarale, Charles R
 From: Christopher Dodunski [mailto:chrisfromsquir...@christopher.net.nz] 
 Subject: RE: Configuring which Servlet is invoked

 Roller hosts multiple domains, and so I can't see how this 
 can be the default host.

That is exactly the situation where you want it to be the defaultHost, so you 
don't have to configure a Host per domain.  However, that does restrict you 
to one default webapp servicing all of the domains.  Either that webapp or a 
filter can route each request to the proper domain-related webapps, if needed.

 I thought the best option might be to set up a Host
 for each domain Roller serves, all with
 appBase=/home/roller/application. 

Not good.  You should have a separate appBase for each Host.  If you don't, 
incorrect deployment may occur based on the timing of each Host seeing the 
webapps underneath the shared appBase.  If you run with expanded directories 
rather than .war files, it may work, but it's not recommended.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



RE: Configuring which Servlet is invoked

2010-10-11 Thread Christopher Dodunski
What I probably omitted to say is that localhost is likely to be
associated with many more domains than the Roller application alone.  So
marrying the default host to Roller isn't likely to save me work. 
Instead, I have added Alias elements to the Roller host for each blog
domain.

And so far so good!  Roller serves up the bread blog with
http://blog.bread.co.nz, and Tomcat no longer invokes webapps/christopher
(a localhost app) with http://blog.christopher.net.nz.  However, it
doesn't appear to invoke Roller either.  Instead Tomcat reports The
requested resource () is not available.  Why is host below invoking
Roller for some of the Alias elements, but not all?  Puzzling!

  Host name=blog.optomus.com appBase=/home/roller/application
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
Aliasblog.bread.co.nz/Alias
Aliasblog.capereinga.co.nz/Alias
Aliasblog.doubtlessbay.co/Alias
Aliasblog.christopher.net.nz/Alias
Aliasblog.isaac.net.nz/Alias
  /Host

Chris.


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



Re: Configuring which Servlet is invoked

2010-10-11 Thread Christopher Dodunski
Catalina logs contain some entries that may shine some light on the matter...

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
/home/roller/application/optomus does not exist or is not a readable
directory
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/optomus]
has not been started

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
/home/roller/application/christopher does not exist or is not a readable
directory
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/christopher]
has not been started

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
/home/roller/application/host-manager does not exist or is not a readable
directory
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/host-manager]
has not been started

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
/home/roller/application/manager does not exist or is not a readable
directory
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/manager]
has not been started

Is it a Tomcat requirement that additional hosts (appBase) must each
contain manager and host-manager?  This appBase currently contains
ROOT (Roller) only.

The first two errors above make no sense to me.

Chris.


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