title: Cannot access Tomcat Server localhost via IP address on mobile phone
body: <p>I want to be able to test my webpage on a mobile phone. I was using an Apache 2.2 server to host my web page locally. In this case, I connected my development machine and my phone to the same WiFi. I then accessed my localhost on my phone via the machine's external IP address.</p>
  
  <p>Now, I need a servlet so I am switching my application to run on a Tomcat v7 server.  I am now unable to access my localhost via external IP address on my phone. I have tested the IP address on my development machine browser to make sure it is correct. I am trying to access port 80 on both the Apache 2.2 server and the Tomcat server. </p>
  
  <p>I have checked my firewall settings, but I am assuming since port 80 works when I run my Apache 2.2 server, it should also work when I run the Tomcat server? </p>
  
  <p>This is my Tomcat Connector String:</p>
  
  <pre><code>&lt;Connector port="80" protocol="HTTP/1.1"
             connectionTimeout="20000"
             redirectPort="8443" /&gt;
  </code></pre>
  
  <p><strong>Solutions I've tried:</strong> I restarted my Tomcat server after each of the following and I still cannot access my localhost</p>
  
  <p>1) add the following to my connector string as posted here: <a href="https://stackoverflow.com/a/8850066/4639035">https://stackoverflow.com/a/8850066/4639035</a></p>
  
  <pre><code>useIPVHosts="true"
  </code></pre>
  
  <p>2) add a inbound rule in my firewall settings (although I think port 80 has already been allowed since it works when I use my Apache 2.2 server, but I could be wrong): 
  <a href="http://www.mobitechie.com/android-2/how-to-access-localhost-on-android-over-wifi/" rel="nofollow noreferrer">http://www.mobitechie.com/android-2/how-to-access-localhost-on-android-over-wifi/</a></p>
  
  <p>Any suggestions? Thanks!</p>