1

Hi all I'm trying to access a database that is hosted in a laptop "database_server" from my android device which is both connected to the same network.

The project is running at www.database_server:8000/

I've entered the ip: 192.168.1.1 (of my laptop connection) to my phone browser and I was able to see the root folder of my project. However when I attempted to run it at 192.168.1.1:8000/ , I was not able to access anything and the web browser returned "Webpage not available".

So the issue now is that I can access the root folder using my android device but I cannot access port 8000 of my laptop. Is there anyway I can solve it ? Thanks !

Bart Silverstrim
  • 31,092
  • 9
  • 65
  • 87
jamen
  • 13
  • 4

2 Answers2

3

Have you verified that you can actually connect to port 8000 from the localhost? On the machine it's hosted on, can you open the web page on http://:8000?

If that works, then you verified that the service is actually running and it's not an issue with the Android device or the connection between the two. You can use a port scanner or netstat to verify on that machine (localhost) that the port is being monitored by a process.

Once you have verified that, check from another device with a port scanner that the port is accessible remotely. That would tell you if the port is inaccessible due to a firewall or some kind of access control that is not allowing remote connections.

Once you've narrowed down where the connection issue is actually coming from you can troubleshoot how to fix it.

Bart Silverstrim
  • 31,092
  • 9
  • 65
  • 87
  • Hi Bart, on my mac (which the project is developed in) , i can access using http://localhost:8000/. I've did a netstat -an and the results returned a | tcp4 , 0 , 0 , 127.0.0.1.8000 , *.* , LISTEN | . I was thinking I should be able to access the project in mac using another device just by using the ip of the mac (within the same network as the device) at 192.168.1.1:8000 but it does not return a result (even though 192.168.1.1 works - which has indicated i've connected to the mac right) ? – jamen Jul 09 '11 at 13:39
  • If the IP of the notebook is 192.168.1.1, then yes. Double check you have that IP (I don't know what web page it's serving). Next use another device (computer, or your Android if it has that application) and do a port scan against that IP address to see if port 8000 is open. The other possibility is that you're *only* binding your application to localhost, which is 127.0.0.1 port 8000 in this case. – Bart Silverstrim Jul 09 '11 at 13:42
  • You'll need to make sure your application/web server is bound to your network connection at address 192.168.1.1, not just localhost, which is a network term for the loopback 127.0.0.1 (itself, and only itself.) – Bart Silverstrim Jul 09 '11 at 13:43
  • After that, if the app/server is bound to the correct IP address, you would need to see if there's something restricting access to only certain ports/addresses. – Bart Silverstrim Jul 09 '11 at 13:44
  • Hi Bart thanks for your tips ! I did a portscan using my device and it doesn't show port 8000 as open , how may i open the port 8000 then ? Further more , how can i check and configure the application to bind to more than localhost and to more ip addresses ? – jamen Jul 09 '11 at 13:55
  • That depends on what's serving the process. Is it an application dedicated to just that purpose? Then it would need to know how to bind to the port on that address. If it's dependent on a web server like Apache, there's a setting in the config file that tells it to bind to any or all available network interfaces. Netstat should tell you if the process(es) on port 8000 are bound to 127.0.0.1 only or if it's also listening to your ethernet interface. – Bart Silverstrim Jul 09 '11 at 13:57
  • Yup the application is dedicated to just the purpose of being accessed by other devices , acting as a webservice. THanks Bart , haha I'm still trying to figure out how to connect them ... spent one whole day at least I'm getting a better picture of everything through your tips ! – jamen Jul 09 '11 at 14:06
  • Glad you have a good starting place on how to get it working now! – Bart Silverstrim Jul 09 '11 at 14:31
1

You might check to ensure port 8000 is not being blocked by any firewall configurations at the server/laptop.

user48838
  • 7,393
  • 2
  • 17
  • 14
  • Hello ! Yea because I'm trying to access the localhost in a macbookpro which I've checked it doesnt have firewall activated. Any other way it may work or is missing ? – jamen Jul 09 '11 at 13:02