无法通过本地主机上的Apache访问虚拟主机

我开始拉出我的头发。

使用Redhat / Apache,我们有三台虚拟主机设置为服务三个基于Drupal的域,另一台虚拟主机设置为通过一台机器通过乘客服务于Redmine。

这个设置对于所有的stream量来说都很好,所有的networking地址都可以parsing全部四个域名。 由于networking基础设施,有问题的盒子使用代理来查看外部世界。

我试图从本地机器上的脚本访问Redmine API,并且响应是错误的:

While trying to retrieve the URL: http://projects/users.xml The following error was encountered: Unable to determine IP address from host name for projects The dnsserver returned: Name Error: The domain name does not exist. This means that: The cache was not able to resolve the hostname presented in the URL. Check if the address is correct. 

从外部机器访问API提供了预期的响应,所以API是可访问的 – 这使我相信这只是Apache或/和PHP解决虚拟主机域的问题。

我做了一个有根据的猜测,这可能是一个代理问题,所使用的代理是不知道本地networking的DNS,但我不知道如何将代理closures的Apache检查,因为我没有设置这个服务器一般不熟悉代理要求。

如果我可以确认这是否是一个代理问题,我如何为特定的域名制定一个例外规定? 我假设我需要使用NO_PROXY环境variables,但是我不知道如何为Apache用户执行此操作,更重要的是,为Apache用户转储ENVvariables时不显示HTTP_PROXY值所有,所以我假设Apache在其他地方使用代理configuration。

我错过了什么明显的?

编辑:根据要求,nslookup的域名返回:

 $ nslookup projects Server: 10.11.6.31 Address: 10.11.6.31#53 Name: projects.INNSERVE.LOCAL Address: 10.11.6.48 

编辑2:根据要求,wget的结果URL的问题:

 $ wget projects/users.xml --2012-12-22 19:12:51-- http://projects/users.xml Resolving projects... 10.11.6.48 Connecting to projects|10.11.6.48|:80... connected. HTTP request sent, awaiting response... 401 Authorization Required Authorization failed. 

我会尝试以下之一:

 domain example.com search example.com 

到/etc/resolv.conf

或添加

 11.22.33.44 projects.example.com projects 

到/ etc / hosts

任何这些都可能解决DNS问题。

出于绝望,我们设法通过重新定义Apache Web服务器主机文件来解决这个问题。 以前,我们使用Webmin来设置这些(大部分情况下,我手动创build了项目主机条目,以便通过乘客服务于Redmine安装)。

问题如下:

项目被定义为具有端口号的虚拟主机:

 <VirtualHost our.ip.address:80> DocumentRoot /opt/redmine-2.1.2/public ServerName projects ... 

虽然所有其他虚拟主机都是在没有明确标注端口号的情况下定义的:

 <VirtualHost our.ip.address> DocumentRoot /var/www ServerName address.domain.local ServerAlias address 

除了Apacheparsing它自己的虚拟主机之外,这在任何方面都工作得很好。

更改剩余的虚拟主机以包含端口号似乎已经纠正了这个问题(由于各种原因,这里不重要,因为我们使用多个端口号,因此端口号很重要)。