2

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

4
  • 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 '21 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 '21 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 '21 at 9:29
  • Reserving a dynamically assigned IP for the MAC Address of your phone, or statically assigning it might help.
    – dan
    Dec 3 '21 at 9:41
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 '21 at 8:23
  • I've already done that on multyple phone just to be sure the problem wasn't my phone Dec 3 '21 at 8:24

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.