You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Colin H <ha...@gmail.com> on 2007/07/24 14:07:16 UTC

Something other than localhost on OS X

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@host2.local' on host1 will ssh to host2 authenticating as someuser
(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

Re: Something other than localhost on OS X

Posted by Larry Meadors <lm...@apache.org>.
Why not just add that host name in /etc/hosts?

Larry


On 7/24/07, Colin H <ha...@gmail.com> wrote:
> 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@host2.local' on host1 will ssh to host2 authenticating as someuser
> (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
>

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


Re: Something other than localhost on OS X

Posted by Hassan Schroeder <ha...@gmail.com>.
On 7/25/07, Colin H <ha...@gmail.com> wrote:
> Thanks Hassan - just couldn't get it working - figure there must be some
> reason that 8080 isn't accessible - the firewall is off though in system
> preferences.  I'm sure it is something extremely simple, but i got sick of
> trying to find out what it was, so I followed these instructions (roughly)
> and did what I said I wasn't going to do :)
>
> http://www.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss
>
> port 80 is no problem, so I can access everything as required. Still can't
> get to port 8080, but this config gets me where I want too be.  cheers,

If it's not a DNS problem but some kind of firewall issue, why not just
run Tomcat on port 80??  No need for adding that extra complexity.

FWIW,
-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

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


Re: Something other than localhost on OS X

Posted by Colin H <ha...@gmail.com>.
Thanks Hassan - just couldn't get it working - figure there must be some
reason that 8080 isn't accessible - the firewall is off though in system
preferences.  I'm sure it is something extremely simple, but i got sick of
trying to find out what it was, so I followed these instructions (roughly)
and did what I said I wasn't going to do :)

http://www.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss

port 80 is no problem, so I can access everything as required. Still can't
get to port 8080, but this config gets me where I want too be.  cheers,

Colin

On 7/25/07, Hassan Schroeder <ha...@gmail.com> wrote:
>
> On 7/24/07, Colin H <ha...@gmail.com> wrote:
>
> > On OS X, hosts in the local subnet can be accessed as <hostname>.local
>
> mmm, didn't know that, but...
>
> >    So the scenario is that I have tomcat deployed and working on
> > host2 port 8080, and want to access it from host1.
>
> > <Host name="host2.local"
>
> ..the instance of Tomcat I have running on an OS X box works fine
> without that. I just have the default host as 'localhost', and I access
> it from other systems as 'http://hostname/' -- here's the exact
> entry from server.xml:
>
> <Engine name="Catalina" defaultHost="localhost">
>       <Host name="localhost" appBase="/www" />
> </Engine>
>
> If you can `ping host2` from host1, it should just work.
>
> FWIW,
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Something other than localhost on OS X

Posted by Hassan Schroeder <ha...@gmail.com>.
On 7/24/07, Colin H <ha...@gmail.com> wrote:

> On OS X, hosts in the local subnet can be accessed as <hostname>.local

mmm, didn't know that, but...

>    So the scenario is that I have tomcat deployed and working on
> host2 port 8080, and want to access it from host1.

> <Host name="host2.local"

..the instance of Tomcat I have running on an OS X box works fine
without that. I just have the default host as 'localhost', and I access
it from other systems as 'http://hostname/' -- here's the exact
entry from server.xml:

<Engine name="Catalina" defaultHost="localhost">
      <Host name="localhost" appBase="/www" />
</Engine>

If you can `ping host2` from host1, it should just work.

FWIW,
-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

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