> How exactly does it fail ?
Sorry, it failed with error message stating that it cannot connect to the
myweb.com:80;

> nslookup disregards the local "hosts" file
> What's with the other nodes' local "hosts" file ?
These lines gave me a brain jolt.
It's my mistake, as i mapped myweb.com to 127.0.0.1 locally on my laptop,
which is why it doesnt use dns to get the public ip.

Now that i commented the local mapping in my etc/hosts, everything works
great !
Thank you so much for your help !

Warm regards from Jakarta,
Albert Kam



On Wed, Sep 18, 2013 at 4:50 PM, André Warnier <a...@ice-sa.com> wrote:

> Albert Kam wrote:
>
>> I have a case where accessing the webapp within the server box is fine,
>> but accessing the webapp from outside the server box using the domain name
>> is problematic, but not so using the public ip address, which is
>> accessible.
>>
>> The content of the webapp is just a single index.html, so no JSPs, no
>> classes are involved.
>>
>> - On my web server, which is set for the public domain myweb.com,
>>   curl http://myweb.com works
>>   curl http://<public-ip-address> also works
>>   note : i registered the domain from the domain robot
>>
>> - On external nodes (not on the web server), i tried to access
>>   curl http://myweb.com fails
>>
>
> How exactly does it fail ?  Doesn't curl have some "verbose" option to
> give you the exact failure reason ?
>
>
>    But : curl http://<public-ip-address> works
>>
>> - Both on the web server and external nodes,
>>   nslookup myweb.com works, and returns the public ip address correctly
>>
>
> Just for info : nslookup disregards the local "hosts" file..
>
>
>
>> - I have even disabled ipv6 in my /etc/hosts and domain mapping
>>   So my current host file is very simple :
>>   127.0.0.1 localhost
>>
>
> Yes, but this concerns only your local host, which was already working
> fine, as per your indications above.
> What's with the other nodes' local "hosts" file ?
>
> On the Tomcat host, can you run the following command and paste the output
> here ?
>
> ifconfig -a
>
>
>
>
>
>
>
>> - Here my output of version.sh
>> Using CATALINA_BASE:   /usr/share/tomcat7
>> Using CATALINA_HOME:   /usr/share/tomcat7
>> Using CATALINA_TMPDIR: /usr/share/tomcat7/temp
>> Using JRE_HOME:        /usr/lib/jvm/java-7-oracle
>> Using CLASSPATH:
>> /usr/share/tomcat7/bin/**bootstrap.jar:/usr/share/**
>> tomcat7/bin/tomcat-juli.jar
>> Server version: Apache Tomcat/7.0.28
>> Server built:   Dec 8 2012 06:51:43
>> Server number:  7.0.28.0
>> OS Name:        Linux
>> OS Version:     3.2.0-4-amd64
>> Architecture:   amd64
>> JVM Version:    1.7.0_25-b15
>> JVM Vendor:     Oracle Corporation
>>
>> - Here's my server.xml
>> <?xml version='1.0' encoding='utf-8'?>
>>
>> <Server port="8005" shutdown="SHUTDOWN">
>>   <Listener className="org.apache.**catalina.core.JasperListener" />
>>   <Listener
>> className="org.apache.**catalina.core.**JreMemoryLeakPreventionListene**r"
>> />
>>   <Listener
>> className="org.apache.**catalina.mbeans.**GlobalResourcesLifecycleListen*
>> *er" />
>>   <Listener
>> className="org.apache.**catalina.core.**ThreadLocalLeakPreventionListe**ner"
>> />
>>
>>   <Service name="Catalina">
>>     <Connector port="80" protocol="HTTP/1.1"
>>                connectionTimeout="20000"
>>                URIEncoding="UTF-8"
>>                redirectPort="8443" address="<my-public-ip-**address>" />
>>
>>     <Engine name="Catalina" defaultHost="myweb.com">
>> <Host name="myweb.com"  appBase="webapps"
>> unpackWARs="true" autoDeploy="true">
>> <Alias>myweb.com</Alias>
>> <Valve className="org.apache.**catalina.valves.**AccessLogValve"
>> directory="logs"
>>    prefix="localhost_access_log." suffix=".txt"
>>    pattern="%h %l %u %t &quot;%r&quot; %s %b" />
>> </Host>
>>     </Engine>
>>   </Service>
>> </Server>
>>
>> - Here's my ifconfig :
>> root@Debian-70-wheezy-64-**minimal:/home/moonblade# ifconfig
>> eth0      Link encap:Ethernet  HWaddr d4:3d:7e:d8:ba:27
>>           inet addr:<public-ip-address>  Bcast:<public-ip-address>
>>  Mask:255.255.255.224
>>           inet6 addr: <public-ip-address-v6>/64 Scope:Link
>>           inet6 addr: <another-public-ip-address-v6>**/64 Scope:Global
>>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>           RX packets:290094 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:169056 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:241176295 (230.0 MiB)  TX bytes:27580533 (26.3 MiB)
>>           Interrupt:43 Base address:0x6000
>>
>> lo        Link encap:Local Loopback
>>           inet addr:127.0.0.1  Mask:255.0.0.0
>>           inet6 addr: ::1/128 Scope:Host
>>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>>           RX packets:192 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:192 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:0
>>           RX bytes:26625 (26.0 KiB)  TX bytes:26625 (26.0 KiB)
>>
>> - no firewall, as the iptables are still empty :
>> root@Debian-70-wheezy-64-**minimal:/home/moonblade# iptables -L -n
>> Chain INPUT (policy ACCEPT)
>> target     prot opt source               destination
>>
>> Chain FORWARD (policy ACCEPT)
>> target     prot opt source               destination
>>
>> Chain OUTPUT (policy ACCEPT)
>> target     prot opt source               destination
>>
>> - my system
>> Linux Debian-70-wheezy-64-minimal 3.2.0-4-amd64 #1 SMP Debian
>> 3.2.46-1+deb7u1 x86_64 GNU/Linux
>>
>> Am i missing something in my server.xml ?
>>
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@tomcat.**apache.org<users-unsubscr...@tomcat.apache.org>
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)

Reply via email to