如何将我的本地主机暴露给万维网?(转发端口?) [英] How to expose my localhost to the WWW? (port forwarding?)
问题描述
我在我的本地主机上运行 Apache/php,并且希望能够从 Internet 上公开访问它.
I am running Apache/php on my localhost and would like to be able to make this publicly accessible from the internet.
我认为这是通过端口转发实现的?有人能指出我正确的方向吗?
I think this is achieved by port forwarding? Can someone point me in the right direction?
推荐答案
这取决于你的连接.
如果您的计算机有公共 IP 地址,则它已经在 Internet 上.然后,您只需要在本地防火墙和家庭/公司防火墙上允许连接到端口 80.
If your machine has a public IP address, it's on the Internet already. Then all you need is to allow connections to port 80, both on the local firewall and the home/corporate firewall.
如果您的机器位于机顶盒后面,或位于公司网络中,则很可能您没有在 Internet 上.在某些情况下,路由器在本地(不可路由)之间进行 NAT(网络地址转换)网络和互联网.在这种特殊情况下,您需要在机顶盒或路由器上设置端口转发.
If your machine is behind a set-top-box, or inside a corporate network, chances are that you're not on the Internet. In some instances, a router does NAT (Network Address Translation) between a local (non-routable) network and the Internet. In this particular case, you need to set up port forwarding on the set-top-box or router.
这篇关于如何将我的本地主机暴露给万维网?(转发端口?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!