我可以通过 IP 和子网运行/访问本地主机服务器吗?

发布于 2024-11-28 22:03:39 字数 449 浏览 1 评论 0原文

我是否可以在我的计算机上运行网络服务器(共享 IP)并使用我的 IP + 子网远程访问它,或者至少以某种不涉及让 IT 人员对当前运行我们的计算机进行更改的方式进行访问虚拟服务器和/或路由我们的子网?

理由: 我正在使用计算机工作,并且正在更改 Google 网站优化工具的插件。我希望 GWO 能够访问本地主机(即我的开发环境),这样我在试探系统时就不必将每个更改部署到生产服务器。 (大量更改;繁琐的部署占用了大部分时间)

我不能只向 GWO 提供我的 IP,因为它指向我们的生产服务器(我们工作中的所有计算机都在同一 IP 上)。如果我可以构造一个仅指向我的计算机的 URI,那么我想我可以让 GWO 查看我的开发环境中的页面并与之交互。

实现这一目标不仅在当前情况下有帮助,而且对我也有很大帮助,因为我可以让我的老板在闲暇时从他自己的机器上查看我在开发中获得的内容,而无需将更改部署到生产中。

Is it possible for me to run a webserver on my computer (shared ip) and access it remotely using my ip + subnet or at least some way that doesn't involve having the IT guys make changes to the machine(s) currently running our virtual servers and/or routing our subnet?

Rationale:
I'm on a computer at work, and I'm making changes to a plugin for Google Website Optimizer. I want GWO to be able to access localhost (i.e. my development environment) so that I don't have to deploy every change to the production server while I'm feeling out the system. (lots of changes; tedious deployment takes up most of the time)

I can't just supply my IP to GWO because that points to our production server (all of our computers at work are on the same IP). If I could construct a URI that points just to my computer, then I suppose I could let GWO view a page on my development environment and interact therewith.

Not only would achieving this purpose be helpful in present circumstances, but it would aid me immensely in that I could let my boss look at what I've got in dev, from his own machine, at his leisure, without deploying changes to production.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

口干舌燥 2024-12-05 22:03:39

我不熟悉 Google 网站优化器,也不熟悉您可能编写的插件的执行方式/位置。因此,我将总结我对您的问题的理解(包括一些猜测),并从那里开始,如果我错了,请纠正我。

  • 您的公司有一个公共 IP 地址。
  • 您的工作站和网络上的所有主机都经过源 NAT 连接到互联网。
  • 您的公共 IP 地址上的端口 80 (http) 经过目标 NAT 到作为虚拟机托管的生产 Web 服务器。
  • 您有一个托管在您的工作站上的开发网络服务器。
  • 您对让“IT 人员”参与路由或系统管理更改持保留态度。
  • 您希望可以通过互联网访问您的开发环境。

首先(假设以上所有内容都是正确的):
使用我的 IP + 子网远程访问它 - 不。不可能。

第二个:
我可以让我的老板看看我的开发内容 - 简单,让他将浏览器指向内部网络上工作站的 IP 地址。

远程访问的可能解决方案:

  1. 与您的“IT 人员”讨论如何让您的开发环境可从外部访问。
  2. 在生产网络服务器上使用基于名称的虚拟主机。需要为开发站点设置 DNS 记录(例如 dev.your-company)并将其指向您公司的 IP 地址。如果使用 SSL,则更难实现。然后你可以:
    • 将不同站点名称的代理请求发送到您的工作站(可以使用 apache 轻松实现).. 或
    • 在生产服务器上托管您的开发环境
  3. 将特定的 URL 路径代理到您的工作站。 (例如 /dev/
  4. 将公共 IP 目标上未使用的端口(例如 8080)通过 NAT 连接到工作站上的端口 80。您的开发环境 URL 可能是 http://www.your-company:8080/

I'm not familiar with the Google Website Optimizer, or how/where a plugin for it that you might write would be executed. So I'm going to summarize what I understand about your problem (including some guesses) and go from there, please correct me if I'm wrong.

  • Your company has one public IP address.
  • Your workstation and all the hosts on your network are source NAT'ed to the internet.
  • Port 80 (http) on your public IP address is destination NAT'ed to your production webserver which is hosted as a virtual machine.
  • You have a development webserver that is hosted on your workstation.
  • You have reservations about involving your "IT guys" to making routing or system admin changes.
  • You want your development environment to be accessible from the internet.

First up (assuming everything above is correct):
access it remotely using my ip + subnet - No. Not possible.

Second up:
I could let my boss look at what I've got in dev - Easy, get him to point his browser at your workstation's IP address on your internal network.

Possible solutions for remotely accessible:

  1. Talk to your "IT guys" about getting your dev environment made externally accessible.
  2. Use name-based virtual hosts on your production webserver. Requires setting up a DNS record for the dev site (e.g. dev.your-company) and pointing it to your company's IP address. If SSL is in use this is harder to achieve. You could then:
    • Proxy requests for a different site name to your workstation (readily achievable with apache).. or
    • Host your development environment on your production server
  3. Proxy a particular URL path to your workstation. (e.g. /dev/)
  4. Get an unused port (e.g. 8080) on your public IP destination NAT'ed to port 80 on your workstation. Your dev environment URL might then be http://www.your-company:8080/
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文