[英]How to access Apache server from inside network?
Hi, I've created an Apache server and it's accessible through its domain name outside of my home network. 嗨,我已经创建了一个Apache服务器,可以通过我的家庭网络之外的域名访问它。 I can also access it by going to the localhost on the PC that serves the site.
我也可以通过访问为站点提供服务的PC上的localhost来访问它。 My problem is that I can't access the site from any other devices connected to my network.
我的问题是我无法从连接到网络的任何其他设备访问该站点。 I've tried both domain and localhost, and neither of them work.
我已经尝试了域和本地主机,但它们都不起作用。 Is it possible to make the site accessible to devices within the network that its hosted on?
是否可以使该站点可供其所在网络中的设备访问?
Your problem is probably caused by NAT: you have a public domain for your apache webserver, which points to your public IP. 您的问题可能是由NAT引起的:您的apache网络服务器有一个公共域,它指向您的公共IP。 From inside your network, your apache's server cannot be reached through your public IP because of network address translation.
在网络内部,由于网络地址转换,无法通过公共IP访问apache的服务器。 But you apache webserver will also have a private IP address in the form of 192.168.1.X (or something similar).
但是您的apache网络服务器也将具有192.168.1.X(或类似形式)形式的私有IP地址。 So, from a PC in your private network, just point to the private IP address of your apache's web server and it will work.
因此,从您专用网络中的PC,只需指向apache的Web服务器的专用IP地址即可。
For completeness, I must also mention the fact that this solution relies on the settings you made in your httpd.conf file in apache: if the virtual host is mapped to *:80 (or *:port) everything will be fine 为了完整起见,我还必须提到一个事实,即该解决方案依赖于您在apache中的httpd.conf文件中所做的设置:如果虚拟主机映射到*:80(或*:port),一切都会好起来的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.