简体   繁体   English

如何从内部网络访问Apache服务器?

[英]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.

相关问题 Apache-如何从移动网络访问服务器 - Apache - How to access server from Mobile Network 如何从其他网络访问 docker 容器(apache 服务器)上的网站? - How to access website on docker container(apache server) from other network? 如何从网络上的任何IP访问apache? - How to access apache from any IP on the network? 无法从不同网络访问指向 Apache2 服务器的域 - Cannot Access Domain Pointing To Apache2 Server From Different Network 从本地网络上的另一台计算机访问 apache2 Web 服务器 - Access apache2 web server from another computer on local network 从本地网络中的计算机远程访问安装在VM上的Apache服务器 - Access Apache server installed on a VM remotely from computer in local network 如何限制来自Apache服务器的访问文件? - How to restrict access file from Apache Server? 如何让Apache托管的公共网页访问同一网络上的私有节点服务器? - How to let an Apache hosted public web page access a private node server on the same network? Apache家庭服务器连接到网络内部的域,而不是出局 - Apache home server connects to domain inside network and not out 如何配置Apache本地主机服务器以从其他计算机访问它 - how to configure Apache localhost server to access it from other computer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM