Re: Changing defaultHost from localhost to a FQDN

2006-10-29 Thread Alan Burlison

On 27/10/06, Caldarale, Charles R [EMAIL PROTECTED] wrote:


The 5.0 and 5.5 docs are mild upgrades of the 4.1 versions, and some
areas did not get revised as much as they should have.  5.5 especially
seems to be stricter on use of unnecessary attributes when the Context
element is not in server.xml; what I posted has been gleaned from
experience.


Thanks ;-)


For compatibility, you can still place Context elements in server.xml,
but it's strongly discouraged, since it requires a Tomcat restart to
make any changes.

 So how *should* I do what I want, i.e. deploy the app in a directory
 called meshcms under webapps, or am I forced to name it ROOT if I want
 it to be the default application?

The current philosophy is that the default app must be named ROOT.


Ah, that's not entirely clear from the docs.  I can live with that, my
initianl assumption (wrong) was that the name didn't actually matter.


There are three ways to achieve this:

1) Deploy the app in the ROOT subdirectory of the Host's appBase
directory, removing any ROOT.war file if it exists.

2) Deploy the packaged app as ROOT.war in the Host's appBase
directory, removing the ROOT subdirectory if it exists.

3) Deploy the app outside of the Host's appBase directory, and place a
ROOT.xml file in conf/[engine]/[host].  The ROOT.xml file must contain a
Context element with a docBase attribute pointing to the location of
the app.

Note that in the first two cases, you often do not need any Context
element for the app.  If you do require one (e.g., to configure the app
as privileged), place the element and attributes in META-INF/context.xml
inside the app directory structure.  Alternatively, you may place the
Context element in conf/[engine]/[host]/[appname].xml, but without the
docBase attribute.

If you place a Context element with a docBase attribute in
conf/[engine]/[host]/[somefile].xml and put the app under the Host's
appBase directory using a name other than [somefile], you will get the
app deployed twice - once as the .xml file name, once as the
subdirectory or .war file name under appBase.


That's an excellent, clear, summary - I haven't been able to find
anything else that explains the three cases you outline above.
Hopefully it might make its way into the official documentation at
some point ;-)

Many thanks!

--
Alan Burlison
--

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



Re: Changing defaultHost from localhost to a FQDN

2006-10-27 Thread Pid
And try adding Aliasmyhost.com/Alias, instead of changing the host
name.  The latter changes expected dir locations too, which is probably
why your app is broken.

p



Caldarale, Charles R wrote:
 From: Alan Burlison [mailto:[EMAIL PROTECTED] 
 Subject: Changing defaultHost from localhost to a FQDN

 as soon as I change the Engine defaultHost and Host name fields from
 localhost to myhost.com, everything stops working.
 
 I just tried the same change, and it all works fine - assuming you have
 made an entry for myhost.com in your hosts file, restarted Tomcat, and
 cleared your browser's cache.
 
 Connector port=80 /
 
 I realize the protocol attribute is supposed to default to HTTP/1.1,
 but just for grins, you might try setting it.
 
  - 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 start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


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



Re: Changing defaultHost from localhost to a FQDN

2006-10-27 Thread Alan Burlison

On 27/10/06, Pid [EMAIL PROTECTED] wrote:

And try adding Aliasmyhost.com/Alias, instead of changing the host
name.  The latter changes expected dir locations too, which is probably
why your app is broken.


I suspect you are right - I renamed the directories under Catalina
from localhost to the FQDN when I made the change, but it still
doesn't work.  And if I try invoking a JSP by its full path, I get a
classNotFoundException.

The really annoying thing is the Tomcat documentation shows FQDN names
being used, yet it doesn't actually work unless you use 'localhost' -
if you need to make other changes when you change the host name, they
should really be called out in the docs.

--
Alan Burlison
--

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



Re: Changing defaultHost from localhost to a FQDN

2006-10-27 Thread Martin Gainty
Alan-

If your host entry is pointing to the same IP as the host= in server.xml then 
that will work e.g. localhost is same as myhost.com
If your host entry points to a different IP then change the host specification 
in server.xml to the new host name in your situation myhost.com
Be sure to put the correct port number as in http://host:Port

Martin--
P.S.
Alan are you by chance related to Don?

This e-mail communication and any attachments may contain confidential and 
privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you 
are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, 
distribution or copying of it or its 
conte
- Original Message - 
From: Caldarale, Charles R [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, October 27, 2006 1:57 AM
Subject: RE: Changing defaultHost from localhost to a FQDN


 From: Alan Burlison [mailto:[EMAIL PROTECTED] 
 Subject: Changing defaultHost from localhost to a FQDN
 
 as soon as I change the Engine defaultHost and Host name fields from
 localhost to myhost.com, everything stops working.

I just tried the same change, and it all works fine - assuming you have
made an entry for myhost.com in your hosts file, restarted Tomcat, and
cleared your browser's cache.

 Connector port=80 /

I realize the protocol attribute is supposed to default to HTTP/1.1,
but just for grins, you might try setting it.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Changing defaultHost from localhost to a FQDN

2006-10-27 Thread Caldarale, Charles R
 From: Alan Burlison [mailto:[EMAIL PROTECTED] 
 Subject: Re: Changing defaultHost from localhost to a FQDN
 
 The really annoying thing is the Tomcat documentation shows FQDN names
 being used, yet it doesn't actually work unless you use 'localhost' -
 if you need to make other changes when you change the host name, they
 should really be called out in the docs.

Not true, it's working for me right now, using myhost.com instead of
localhost - no aliasing involved.  It's not necessary to change
directory names under conf/Catalina or work; these are created
automatically as needed.  I am using 6.0, I'll try it with 5.5 when I
get a chance.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Changing defaultHost from localhost to a FQDN

2006-10-27 Thread Caldarale, Charles R
 From: Alan Burlison [mailto:[EMAIL PROTECTED] 
 Subject: Re: Changing defaultHost from localhost to a FQDN
 
 The odd thing is that it does appear to be serving *html* from under
 the web application directory, just not JSPs.  If I put an index.html
 under webapps/ROOT I see the content.

I've just tried it again with both 5.5.20 and 6.0.0, changing
localhost to myhost.com in two places in server.xml (Host and
Engine) and in the Windows hosts file.  Everything works, including
JSPs and servlets.

For 5.5.20, my server.xml is the default one with the two changes noted
above.  You might want to go back to a fresh download, change only those
two items, and try it again.  It's possible you've accidentally taken
out something critical for JSP compilations.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Changing defaultHost from localhost to a FQDN

2006-10-27 Thread Alan Burlison

If your host entry is pointing to the same IP as the host= in server.xml then 
that will work e.g. localhost is same as myhost.com
If your host entry points to a different IP then change the host specification 
in server.xml to the new host name in your situation myhost.com
Be sure to put the correct port number as in http://host:Port


I have.  It doesn't work.


Alan are you by chance related to Don?


Not as far as I know...

--
Alan Burlison
--

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



Re: Changing defaultHost from localhost to a FQDN

2006-10-27 Thread Alan Burlison

I've just tried it again with both 5.5.20 and 6.0.0, changing
localhost to myhost.com in two places in server.xml (Host and
Engine) and in the Windows hosts file.  Everything works, including
JSPs and servlets.

For 5.5.20, my server.xml is the default one with the two changes noted
above.  You might want to go back to a fresh download, change only those
two items, and try it again.  It's possible you've accidentally taken
out something critical for JSP compilations.


I have it working - well, kinda.  If I deploy the application as ROOT,
and with ROOT as the docBase it works fine.  If I move it to meshcms
(the WAR file name) and modify docRoot to match, it doesn't.  It
serves the JSP but all the links in the page (e.g. to the stylesheets)
are wrong.

Looks like there is something wrong with the webapp.

--
Alan Burlison
--

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



RE: Changing defaultHost from localhost to a FQDN

2006-10-27 Thread Caldarale, Charles R
 From: Alan Burlison [mailto:[EMAIL PROTECTED] 
 Subject: Re: Changing defaultHost from localhost to a FQDN
 
 I have it working - well, kinda.  If I deploy the application as ROOT,
 and with ROOT as the docBase it works fine.  If I move it to meshcms
 (the WAR file name) and modify docRoot to match, it doesn't.

The above is confusing to me.  Where is the app deployed?  Where is the
Context element for this app located?  What are the attributes
specified for this Context?

With Tomcat 5 and above, Context elements should not go in server.xml,
the path attribute must not be used, and docBase can be used only when
the Context element is in conf/[engine]/[host]/[appname].xml AND the
app is not deployed in the Host's appBase directory.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Changing defaultHost from localhost to a FQDN

2006-10-27 Thread Alan Burlison

The above is confusing to me.  Where is the app deployed?


webapps/ROOT (works) or webapps/meshcms (doesn't)


 Where is the Context element for this app located?


conf/server.xml


 What are the attributes  specified for this Context?


Context path= docBase=ROOT reloadable=false /


With Tomcat 5 and above, Context elements should not go in server.xml,
the path attribute must not be used, and docBase can be used only when
the Context element is in conf/[engine]/[host]/[appname].xml AND the
app is not deployed in the Host's appBase directory.


Ah, and I'm using 5.5.  I've checked the 5.5 docs and I can't find
*any* of those restrictions mentioned, other than a recommendation
that Context elements aren't placed in server.xml, but I got the
impression that this was advisory, not mandatory.

So how *should* I do what I want, i.e. deploy the app in a directory
called meshcms under webapps, or am I forced to name it ROOT if I want
it to be the default application?

Thanks,

--
Alan Burlison
--

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



RE: Changing defaultHost from localhost to a FQDN

2006-10-27 Thread Caldarale, Charles R
 From: Alan Burlison [mailto:[EMAIL PROTECTED] 
 Subject: Re: Changing defaultHost from localhost to a FQDN
 
 Ah, and I'm using 5.5.  I've checked the 5.5 docs and I can't find
 *any* of those restrictions mentioned, other than a recommendation
 that Context elements aren't placed in server.xml, but I got the
 impression that this was advisory, not mandatory.

The 5.0 and 5.5 docs are mild upgrades of the 4.1 versions, and some
areas did not get revised as much as they should have.  5.5 especially
seems to be stricter on use of unnecessary attributes when the Context
element is not in server.xml; what I posted has been gleaned from
experience.

For compatibility, you can still place Context elements in server.xml,
but it's strongly discouraged, since it requires a Tomcat restart to
make any changes.

 So how *should* I do what I want, i.e. deploy the app in a directory
 called meshcms under webapps, or am I forced to name it ROOT if I want
 it to be the default application?

The current philosophy is that the default app must be named ROOT.
There are three ways to achieve this:

1) Deploy the app in the ROOT subdirectory of the Host's appBase
directory, removing any ROOT.war file if it exists.

2) Deploy the packaged app as ROOT.war in the Host's appBase
directory, removing the ROOT subdirectory if it exists.

3) Deploy the app outside of the Host's appBase directory, and place a
ROOT.xml file in conf/[engine]/[host].  The ROOT.xml file must contain a
Context element with a docBase attribute pointing to the location of
the app.

Note that in the first two cases, you often do not need any Context
element for the app.  If you do require one (e.g., to configure the app
as privileged), place the element and attributes in META-INF/context.xml
inside the app directory structure.  Alternatively, you may place the
Context element in conf/[engine]/[host]/[appname].xml, but without the
docBase attribute.

If you place a Context element with a docBase attribute in
conf/[engine]/[host]/[somefile].xml and put the app under the Host's
appBase directory using a name other than [somefile], you will get the
app deployed twice - once as the .xml file name, once as the
subdirectory or .war file name under appBase.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Changing defaultHost from localhost to a FQDN

2006-10-26 Thread Alan Burlison

I'm sure this must be a FAQ, but I can't find the answer anywhere.  I
have a simple standalone tomcat install that works just fine, but as
soon as I change the Engine defaultHost and Host name fields from
localhost to myhost.com, everything stops working.  As well as
changing the entries in server.xml I also renamed the localhost
directory in the Catalina directory to myhost.com, but although the
server starts OK and I get no errors in the log files, any attempt to
access the application gets a 404 - including the standard tomcat
manager app.  I notice there are localhost lines in logging.properties
- do I need to change them as well?  I find the logging.properties
documentation to be pretty much impenetrable, to be frank.

Here's my server.xml.  In case anyone wonders, the port=80 isn't the
problem, the tomcat user has been given permissions to access that
port, and it worked fine on port 80 before I changed the hostname from
localhost.  Any and all suggestions (including RTFMs)  gratefully
received - I'm at my wits end with this!

--
Server port=8005 shutdown=SHUTDOWN
 !-- Used by Manager webapp --
 GlobalNamingResources
   Resource name=UserDatabase auth=Container
 type=org.apache.catalina.UserDatabase
 description=User database that can be updated and saved
 factory=org.apache.catalina.users.MemoryUserDatabaseFactory
 pathname=conf/tomcat-users.xml /
 /GlobalNamingResources
 Service name=Catalina
   Connector port=80 /
   Engine name=Catalina defaultHost=myhost.com
 Realm className=org.apache.catalina.realm.UserDatabaseRealm
resourceName=UserDatabase /
 Host name=myhost.com appBase=webapps /
   /Engine
 /Service
/Server
--

--
Alan Burlison
--

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



RE: Changing defaultHost from localhost to a FQDN

2006-10-26 Thread Caldarale, Charles R
 From: Alan Burlison [mailto:[EMAIL PROTECTED] 
 Subject: Changing defaultHost from localhost to a FQDN
 
 as soon as I change the Engine defaultHost and Host name fields from
 localhost to myhost.com, everything stops working.

I just tried the same change, and it all works fine - assuming you have
made an entry for myhost.com in your hosts file, restarted Tomcat, and
cleared your browser's cache.

 Connector port=80 /

I realize the protocol attribute is supposed to default to HTTP/1.1,
but just for grins, you might try setting it.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]