如何使Web服务可以公开访问? [英] How to make webservice accessible publicly?

查看:68
本文介绍了如何使Web服务可以公开访问?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的localhost上目前正在运行Java Web服务.我想使它可以通过Internet访问,以便任何人都可以访问它.

I have java web service presently running on my localhost. I want to make it accessible over internet so that anybody can access it.

我想自我托管我的Web服务.(即,我不想使用任何托管服务提供商)

I want to self host my web service.(i.e I don't want to use any hosting provider)

我想通过我的私有IP地址或公共IP地址(即不需要DNS服务提供商)对其进行访问.

I want to make it accessible by my private IP address or public IP address(i.e I don't need DNS service provider).

我有局域网连接.

请描述每个步骤感谢进阶

Please describe every step Thank's in advanced

推荐答案

要在Internet上标识PC,我们需要静态IP.

To identify PC on the internet we need static IP.

为您的网络获取静态IP或动态DNS

Acquiring a Static IP or dynamic DNS for your Network

如果处理动态IP地址听起来让人头疼,那么还有另一种类型的地址:静态IP.静态IP不会更改.仅当ISP向其客户提供静态IP时,您才可以从ISP请求一个静态IP地址,通常需要额外付费.另一种选择是使用动态DNS服务.DNS代表域名系统,动态DNS为计算机提供永久域名,例如mybusiness.ddns.com,并且即使该计算机发生更改,它也会自动跟踪该计算机的IP地址.因此,当外部Internet上的某人想要联系您的计算机时,他们可以联系mybusiness.ddns.com,动态DNS服务将知道如何与您的计算机联系.这就像有一个私人助理,其职责是随时了解您的情况.

If dealing with dynamic IP addresses sounds like one big headache, there's another type of address: the static IP. A static IP does not change. You can request a static IP address from your ISP, usually for an additional fee, and only if the ISP offers static IPs to its customers. Another option is to use a dynamic DNS service. DNS stands for domain name system, and a dynamic DNS gives a permanent domain name to a computer, such as mybusiness.ddns.com, and automatically keeps track of that computer's IP address, even if it changes. Therefore, when someone on the outside internet wants to contact your computer, they can contact mybusiness.ddns.com, and the dynamic DNS service will know how to contact your computer. It's like having a personal assistant whose job it is to know how to reach you at all times.

  1. 获取您的静态IP地址(可以通过Internet访问).
  2. 支持HTTP协议的安装服务器,例如Apache服务器.
  3. 使用免费的DNS服务器(如果需要)创建一个帐户,例如 https://now-ip.com/
  4. 使用静态IP配置服务器,并确保您的防火墙设置不避免来自Internet的入站流量.
  5. 使用服务器中的端口号部署Web服务.
  6. 尝试从其他Internet PC上ping通.

这篇关于如何使Web服务可以公开访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆