0

I run a web project locally within Netbeans. So the tomcat server starts up and it can be accessed normally by typing localhost:8080 into some browser. Everything fine so far. But what I need is to access it from outside, say from a android mobile (which I connected by wifi hotspot -obviously resides in the same wireless network). So when he types the following :8080 I should reach the locally running webserver (within Netbeans). But that doesn't work!

Some more details

Windows 7 OS NetBeans 8.03 Webserver :Tomcat server When launching the Tomcat server from within Netbeans I can access it with: http://localhost:8080

I cannot access it however from my local PC(where the webserver is running within Netbeans) with: http://192.168.0.5:8080 where the IP is my IP address in the network.

The output on browser shows the following error

HTTP STATUS 404 - [location specified in URL] TYPE : status report MESSAGE: [location specified in URL] DESCRIPTION : the requested resource is not available

I have all Firewalls disabled!

user3702247
  • 61
  • 1
  • 9
  • Which address are you using on your mobile device? `localhost` always represents the device from which you are making the request. It corresponds to the `127.0.0.1` loopback address, thus it can never be used for external communication. – d3dave Jun 03 '14 at 15:05
  • your url should look like www.127.0.0.1/index.php and not www.localhost.com/ – Illegal Argument Jun 03 '14 at 15:11
  • i just referred 'http://stackoverflow.com/questions/4779963/how-can-i-access-my-localhost-from-my-android-device' – user3702247 Jun 03 '14 at 15:18

1 Answers1

0

It looks as though your web server is set up to use virtual hosts to decide what to serve and has a different configuration for your networked ip address and localhost. Check for "host" tags in your tomcat configuration files and make sure they all use the same appBase setting.

Jules
  • 14,841
  • 9
  • 83
  • 130