简体   繁体   English

通过专用网络访问服务器

[英]Server access through private network

I am currently working on a server (I made using java) to share informations between computers within the same private network.我目前正在使用服务器(我使用 java 制作)在同一专用网络中的计算机之间共享信息。

My problem is :我的问题是

  • I can access this server through http://localhost or 127.0.0.1 on my "server machine"我可以通过“服务器机器”上的http://localhost或 127.0.0.1 访问此服务器
  • but i cannot access it from another computer using the "server machine" local IP adress.但我无法使用“服务器机器”本地 IP 地址从另一台计算机访问它。

Trying with XAMPP, the port 80 is accessible by everyone but with my java server: no access, i got a "Timeout" exception from the remote client (still on the same private network)尝试使用 XAMPP,所有人都可以访问端口 80,但使用我的 Java 服务器:无法访问,我从远程客户端收到“超时”异常(仍在同一专用网络上)

My question is :我的问题是

  • How is XAMPP (or Apache) able to forward port 80 to let every other computer access the "server machine" ? XAMPP(或 Apache)如何能够转发端口 80 以让所有其他计算机访问“服务器机器”?
  • What do i need to setup on MY server in order to let those computers access MY server ?我需要在我的服务器上设置什么才能让这些计算机访问我的服务器?

You are probably binding your application to localhost (127.0.0.1) only, making it reachable only from your machine.您可能仅将您的应用程序绑定到 localhost (127.0.0.1),使其只能从您的机器访问。

What do i need to setup on MY server in order to let those computers access MY server ?我需要在我的服务器上设置什么才能让这些计算机访问我的服务器?

Try binding the app to other network interfaces, or simply try 0.0.0.0 for test (this will bind to ALL of them).尝试将应用程序绑定到其他网络接口,或者简单地尝试使用 0.0.0.0 进行测试(这将绑定到所有网络接口)。 Note that this is usually not a preferred method, especially if you have a public IP configured on that machine.请注意,这通常不是首选方法,特别是如果您在该机器上配置了公共 IP。

How is XAMPP (or Apache) able to forward port 80 to let every other computer access the "server machine" ? XAMPP(或 Apache)如何能够转发端口 80 以让所有其他计算机访问“服务器机器”?

Check the Apache module mod_proxy for this.为此检查 Apache 模块 mod_proxy。

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

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