4

I have a website that needs to work only on my local network, I am hosting it on Apache, I have already done all the steps to make it accessible from any PC and laptop, but for some reasons if I try to reach it from a mobile phone it either give me ERR_UNREACHABLE or it shows a white screen.

Both the phones and the PC/laptop are connected to the same network, and I just enter http://hostIP:8080 to access the site.

EDIT: So I tested it in my home network and by connecting from the phone to my pc with hotspot and it works fine, I think the problem have to do with the router in my company, but I can't figure out why it works from PC'S and laptop but not from phone (tested only on Android). I'll update the post if I manage to do some progress

EDIT: After a year I doing a similar project and find that the issue was a router settings. My pc was connected via ethernet while my phone was on the same router but on a different network setted as guest, that didnt allowed device discovery. It was working between pc because most of them were connected to a hidden network (not the guest one) that didn't hide device, it was also working between two different guest network, even with device discovery blocked.

5
  • Make sure your router is setup to forward port 8080 to the server/computer that Apache is running on, and try disabling the firewall on that to see if it makes a difference.
    – dan
    Dec 3, 2021 at 0:56
  • I will try that, but do I need port forwarding even if I'm working on local network? I don't know much about networking Dec 3, 2021 at 8:40
  • 1
    If you're using an internal IP address (aka, "private" IP) such as 192.168.1.12 for your server/computer and for your phone (e.g.,192.168.1.14), then using http://192.168.1.12:8080 should work without port forwarding. But if your server & phone have very different IP addresses (like one of them is public), then you'll need to setup port forwarding. I've found that with some routers however, you may need to setup port forwarding regardless - that might be the case with the router at your company. Also more advanced routers sometimes will block incoming packets from unregistered devices...
    – dan
    Dec 3, 2021 at 9:29
  • Reserving a dynamically assigned IP for the MAC Address of your phone, or statically assigning it might help.
    – dan
    Dec 3, 2021 at 9:41
  • Thank you for coming back after a year to share your solution to this issue. Would you mind posting it as an answer and marking it accepted? It helps us keep things tidy around here. Thanks! Apr 7, 2023 at 16:55

2 Answers 2

1

Phones are usually connected to TWO networks: one via cell tower and one via WiFi. If you turn off mobile data on your Android device, it will force it to use WiFi for the local intranet and it would be able to connect to the local server.

2
  • Ostemiller its a good thought, but I don't think this would be it - AFAIK phones prefer a WIFI network over the cellular one when both are available.
    – davidgo
    Dec 3, 2021 at 8:23
  • I've already done that on multyple phone just to be sure the problem wasn't my phone Dec 3, 2021 at 8:24
0

After a year I'm doing a similar project and find that the issue was a router settings. My pc was connected via ethernet while my phone was on the same router but on a different network setted as guest, that didnt allowed device discovery. Most of the time guest network are set like that to protect connected users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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