0

My laptop and phone is connected to home network.

laptop_ip: 192.168.1.8

phone_ip: 192.168.1.2

when I ping 192.168.1.2 from my laptop, it's OK and ping is successful. But when I type 192.168.1.8 in my phone's browser, I cannot load apache2 default page. This address is accessible when I type it in my laptop's browser.

I have both windows and ubuntu and I switched to my Windows and started a http server in my windows and tried to access it from my phone and I was successful. So my modem and router is OK I think. and the problem is with my ubuntu. but what? I DON'T KNOW. PLEASE HELP ME. TNX

| improve this question | | | | |
  • It "my http server" configured to accept connections from "my phone"? It might just listen on my localhost be default. – mikewhatever Aug 23 '19 at 23:28
  • 3
    Pinging is not the same as accessing a web server. If I understand you correctly, you have one machine with dual boot, and installed on each OS an apache server, with windows you can access but with ubuntu not, that's correct? If this is the case, it may be that there's somenthing in your apache configuration that is different in both servers. – schrodigerscatcuriosity Aug 23 '19 at 23:42
  • 2
    On Ubuntu try to temporary disable firewall sudo ufw disable. – Michal Przybylowicz Aug 24 '19 at 3:17
  • @mikewhatever it's listening on 0.0.0.0 – Hameda169 Aug 24 '19 at 6:42
  • @guillermochamorro I tried python3 -m http.server that is listening on 0.0.0.0:8000. But it's not working too on ubuntu. It's Ok on windows. And yes, they are dual boot, not virtual – Hameda169 Aug 24 '19 at 6:45
0

Are you duel booting? Is that how you are testing your windows web server? If you're doing something like a virtual machine (e.g. VirtualBox), answers might be different.

Back on your linux server, type the following command:

sudo netstat -tlnp

This will show you all ports that are either waiting for connections or already connected.

You can use grep to filter to port 80 thusly:

sudo netstat -tlnp | grep 80

If port 80 is indeed open, but you still can't access the web server, see if the web server is receiving traffic at all by running tcpdump:

sudo tcpdump 'port 80'

Leave that window open and then visit your server. If the prompt doesn't move, something is blocking your connection. You may have a firewall or something blocking your connection.

If it does move, provide the output and we can investigate further.

| improve this answer | | | | |
  • My windows and ubuntu is installed dual boot, not virtual – Hameda169 Aug 24 '19 at 20:24
  • What happens when you run the last command and visit the website? – scuba_mike Aug 25 '19 at 13:40
  • This message is what I see 01:05:42.223104 IP 192.168.1.2.52091 > hamed.8000: Flags [S], seq 3110608520, win 65535, options [mss 1460,sackOK,TS val 4958321 ecr 0,nop,wscale 8], length 0 – Hameda169 Aug 25 '19 at 20:37
  • 1
    That was because of a rule in my iptables:( sorry. – Hameda169 Aug 25 '19 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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