简体   繁体   English

我可以在本地访问该网站,但无法通过互联网访问它打开端口后

[英]I can access the website locally but can't access it through the internet After openning the port

I want to make my phone a Linux web server, by using the userLand application which gives you the ability to use ubuntu distribution on Andriod.我想让我的手机成为 Linux web 服务器,通过使用 userLand 应用程序,它使您能够在 Andriod 上使用 ubuntu 分发。

I already installed Django and ran my server on port 8080 since port 80 is busy (seems logical that android is using it)我已经安装了 Django 并在端口 8080 上运行我的服务器,因为端口 80 很忙(似乎 android 正在使用它是合乎逻辑的)

and everything is good, it works when I try to access the website from another device on the local network.一切都很好,当我尝试从本地网络上的另一台设备访问该网站时,它可以工作。

so I proceeded to the next step which is making the website accessible from all over the internet then I found that you need to make a port forwarding on the router to allow devices from outside the local network to access a device in the localnetwork.所以我继续下一步,使网站可以从整个互联网访问,然后我发现您需要在路由器上进行端口转发,以允许本地网络外部的设备访问本地网络中的设备。

I followed the following steps:我按照以下步骤操作:

  1. made the phone's IP static locally在本地制作手机的 IP static
  2. added the configuration needed for the port forwarding (phone's ip, port 8080, etc... )添加了端口转发所需的配置(手机的ip,端口8080等...)
  3. found the public IP for my phone and used it and with port 8080为我的手机找到公共 IP 并使用它并使用端口 8080

it is still not working: I can access the website locally but can't access it through the internet.它仍然无法正常工作:我可以在本地访问该网站,但无法通过互联网访问它。

I tried another method by using an already working server from the "AWebServer" application on google play我尝试了另一种方法,方法是使用 google play 上“AWebServer”应用程序中已经工作的服务器

but still the same problem.但仍然是同样的问题。

I tried temporarily to disable the firewall on the router but still the same problem我尝试暂时禁用路由器上的防火墙,但仍然是同样的问题

and finally, I tried to open the port on my laptop with OS: Windows 10 instead of the phone OS: Android, and checked with port checker but the port is closed and still the same problem.最后,我尝试使用操作系统打开笔记本电脑上的端口:Windows 10 而不是手机操作系统:Android,并使用端口检查器进行检查,但端口已关闭,仍然是同样的问题。

I have been trying to solve this for a whole day)), I would be very happy if someone helped me.我一整天都在尝试解决这个问题)),如果有人帮助我,我会很高兴。

thanks谢谢

first image第一张图片

second image第二张图片

Your ISP might have put you under a NAT, in that case port forwarding might still not work.您的 ISP 可能已将您置于 NAT 之下,在这种情况下,端口转发可能仍然无法正常工作。

Your best bet is to use some sort of SSH Tunnels.您最好的选择是使用某种 SSH 隧道。

You can try with ngrok .您可以尝试使用ngrok

This will give you a URL to access your application from public internet.这将为您提供 URL 以从公共互联网访问您的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM