Apache的Windows网络上 - 不能从网络连接到外部IP [英] apache on windows network - can't connect to external ip from in network

查看:119
本文介绍了Apache的Windows网络上 - 不能从网络连接到外部IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建的最初打算是从传统的第三方主机服务的AMP Web应用程序。

当我们完成了,客户决定在内部托管的,在他们的办公室网络中的服务器上。该应用程序只是为了提供给工作人员,但这些人员往往会场外。我在建立自己的网络,它使用至少一个服务器运行Windows Server 2003,我看到客户机不参与是XP。

我设置Apache,MySQL和PHP服务器2003的计算机上,并安装应用程序。该应用程序是建立在codeIgniter框架,所以我的BASE_URL设置为内部IP(192.168 ...),我们从网络中进行测试。一切正常。

接下来,我们问他们的网络的家伙打开80端口的Apache。我的BASE_URL设置为外部IP,以及从我家测试(使用外部IP作为网络地址),并能正常工作。

不过,试图从内部网络访问使用外部IP的应用程序时,他们无法连接。我可以重置BASE_URL到网络的IP,并且可以使用网络IP访问它,但随后外部连接时该应用程序失败(因为BASE_URL,在整个申请中使用,是指向内部IP)。

它想我可以让codeIgniter确定BASE_URL(由离开变量为空字符串),但宁可弄清楚为什么在网络的外部IP失败,并试图纠正。

我们正在使用的服务器是不是专用于AMP堆叠(事实上,它有至少一个其他应用程序广播到必须使用IIS被互联网,以及用于办公扫描仪FTP服务器)所以我想可能有一些矛盾存在。

我还不是很了解Windows网络。快速搜索建议,这可能是由于NAT的,但并没有提供一个解决方法。

他们的网络家伙没有建议,并表示,一切都应该罚款。

是否有可能使用外部IP让用户访问网络内部的Apache服务器,如果是的话,需要做些什么来启用?

TYIA


解决方案

这是不是Apache的关系,也不是CI相关。它通常是不可能从网络内到达外部IP地址。

坦白说,我不知道到底这是为什么。我不知道它与NAT(网络地址转换)是如何工作的,或至少它是如何实现的。

有关的详细介绍的为什么的这是,你应该问的 serverfault 这个问题。如果你只是谁拥有对付它一个程序员,接受通常的NAT外,外只能从内到里面,而不是里面里面。

您已经提到你的问题的解决方案之一 - 不使用 BASE_URL 。你也可以简单地运行一个外部IP地址的服务器(而不是公司的IP,但是比方说,一个数据中心或东西)。

I created an AMP web application that was originally going to be served from a traditional 3rd party host.

As we finished up, the client decided to host it internally, on a server in their office network. The application is only meant to be available to staff members, but those staff members will often be off-site. I had no involvement in setting up their network, which uses at least one server running windows server 2003. The client machines I saw were XP.

I set up Apache, MySQL and PHP on the server 2003 machine, and installed the application. The application is built on the CodeIgniter framework, so I set the base_url to the internal IP (192.168...), and we tested from within the network. Everything worked fine.

Next, we asked their network guy to open port 80 for apache. I set the base_url to the external IP, and tested from my home (using the external IP as the web address), and it works fine.

However, when attempting to access the application using the external IP from within the network, they're unable to connect. I can reset the base_url to the network IP, and they can access it using the network IP, but then it the application fails when connecting externally (since the base_url, used throughout the application, is pointing to the internal IP).

It suppose I could let CodeIgniter determine the base_url (by leaving the variable as an empty string), but would rather figure out why the external IP fails in-network, and try to correct that.

The server we're using is not dedicated to the AMP stack (in fact, it has at least one other application broadcasting to the internet that must have been using IIS, as well as an FTP server used for office scanners), so I suppose there might be some conflicts there.

I know very little about windows networking. A quick search suggested this might be because of NAT, but didn't offer a work-around.

Their network guy has no suggestions, and said that everything should be fine.

Is it possible to have users inside the network access the Apache server using the external IP, and if so, what needs to happen to enable that?

TYIA

解决方案

This isn't Apache related, nor is it CI related. It's often impossible to reach the external IP address from within the network.

Frankly, I don't know exactly why that is. I do know that it's related to how NAT (Network Address Translation) works or at least how it's implemented.

For a detailed overview of why this is, you should ask this question on serverfault. If you're simply a programmer who has to deal with it, accept that NAT usually works only from inside to outside and outside to inside, but not inside to inside.

You already mentioned one of the solutions in your question - don't use base_url. You could also simply run the server on an external IP address (not your company IP, but let's say a datacenter or something).

这篇关于Apache的Windows网络上 - 不能从网络连接到外部IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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