tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Albert Kam <moonblade.w...@gmail.com>
Subject Cannot access webapp outside the server box using a public domain name
Date Wed, 18 Sep 2013 07:00:08 GMT
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
  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

- 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

- 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.JreMemoryLeakPreventionListener" />
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener
className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <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 ?


-- 
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)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message