Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Something other than localhost on OS X

Colin H

2007-07-24

Replies:

Hi,

  I am trying to do something that I figure should be pretty simple -
accessing my tomcat container from something other than localhost. So far
as I can tell, I should be adding a <Host/> entry to server.xml with the
host I want to access tomcat as. On OS X, hosts in the local subnet can be
accessed as <hostname>.local - so, for example, typing 'ssh
someuser@(protected)
(this is working - i.e. host2.local can be resolved form host1). If you
type 'hostname' on host1, it returns 'host1.local'

 So the scenario is that I have tomcat deployed and working on host2 port
8080, and want to access it from host1. I don't want to muck around with
apache and mod_jk etc. Been there many times before, always find it
annoying. In any case, I shouldn't need to, as far as I can tell, as tomcat
should be able to do the job. I am adding the following to the
server.xmlfile, after the <Host name="localhost" .... /> entry -

<Host name="host2.local" autoDeploy="false" deployOnStartup="false"
deployXML="false" configClass="
org.jboss.web.tomcat.security.config.JBossContextConfig">
  <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
transactionManagerObjectName="jboss:service=TransactionManager" />
</Host>

and would like the following URL

'http://host2.local:8080/<context>' to work from host1. '
http://localhost:8080/<context>' already works from a browser on host2.

I realise I am using the tomcat embedded within JBoss, but it should be the
same - I have the following specific questions

1. Is this the right approach in general (ignoring specific of JBooss or
whatever)?
2. Is there something tricky about the OS X host naming mechanisms that
could be causing me some problems?
3. Any other ideas why this might not be working?

Thanks,

Colin
©2008 junlu.com - Jax Systems, LLC, U.S.A.