Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am having difficulty connecting wirelessly to my Linux computer with my Android mobile device. I have disabled the internal firewall of my computer and opened up access to it with port 80 on my router firewall setting. Sometimes, I am able to access my computer, sometimes, I am not able to access it. Usually, restarting the wireless connection on my mobile device would enable me to access my computer. But this time, I tried numerous times without success although I can still access the internet wirelessly through both devices. What could be causing such a problem?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

If you're trying to access port 80, I assume you are meant to have a web server running off your Linux box and are trying to access it through the Android device's Web Browser.

First things first, check that something is indeed listening in on your port 80. A simple test for that is to open a browser on your linux machine and go to http://localhost:80. At this point, the browser will either successfully connect to your local server or state that it was unable to do so (message differs from browser to browser but they will go from "Oops! Google Chrome could not connect to localhost" for Chrome to "Unable to connect" for Firefox).


If you are able to connect via browser, then there might be an issue related with your Android's connectivity to the machine itself. To quickly test that out, try installing Traceroute on your Android device (only requires full network access permission which is mandatory for its goal) and perform a traceroute through it to your Linux Box's IP (start the app, put the IP on the text box and press Trace). If, assuming from your original post, you are sitting in the same network as your machine, the android device successfully connects to your linux box if you have an entry listing the IP you provided it with and several average times in a fashion similar to the image found here

If, however, only star signs are displayed (*), then the Android device most likely cannot reach the linux machine. I would advise you:

  • Recheck the network definitions on your Android device. It might be possible that you are connected to a different network and are not aware of it.
  • Restart your router. I've had scenarios where part of the symptoms you've described occurred and, in the end, it came down to degrading performance from the router after long periods of being on.

If, on the other hand, you are unable to connect through your linux box's browser to your local server, then most likely the server is not running.
In this case, things are a bit more tricky as I don't know exactly what the server you are trying to run is. If you can clarify whether it is a regular web server like Apache or something else, it would be of further help.
However, regardless of the software being executed, you can quickly check if the port itself is open to connections. To do that:

  1. Open a terminal window (this action depends on the linux distro you have installed so check the appropriate user manual for that case or just run the google query "How to open a terminal window on " on your browser)
  2. Type in the following command:

    netstat -an | grep 80 | grep -i LISTEN

  3. Look for an entry that match one of the following:

    *.80 *.* 0 0 0 LISTEN
    your ip address here.80 *.* 0 0 0 LISTEN

If no entries show up that match that, then whatever software should be running is not up.
Most likely, whatever service is expected to be running is executed at OS boot time (easy fix is to restart your linux PC) but it is possible that, if worked before (even if only from time to time) and now does not, some kind of update or configuration change was performed that made it unstable to run. Did you have some system update before this started to occurr?

share|improve this answer
    
Thanks for the comprehensive answer. Yes, I am running an apache web server. Restarting the router did the trick, but is the last thing I would want to do as some DNS settings would be erased. The brand new 2-wire router has been in continuous use for only a few months, so I wasn't expecting this to happen. Is there any way I can mitigate the problem besides resting the router or retiring it? –  Question Overflow Dec 31 '12 at 17:02
    
Scenarios involving the routers themselves are always tricky. It may be a config issue (there are some issues related to the router model and configuration sets themselves) or a firmware upgrade could present a fix. To confirm that the router is the real issue, I would monitor Apache's access logs (details on how to configure Apache to use them here) using tail -0f <access.log> and try to connect from the Android dev to the linux box. If, during a fail, you see no entry in the access log, then the router is indeed the main suspect. –  Toryu Jan 1 '13 at 17:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.