Magento只响应公共网络。本地网络提供404

时间:2014-06-27 12:10:26

标签: php apache magento curl dns

当我从网络服务器外部运行curl www.example.com时,一切正常。但是当我从内部服务器shell执行此操作时,我会收到404(该域未在本地解析)。

此问题也影响了API。

我该如何解决这个问题?此服务器是最新版本的Ubuntu 12.04Apache 2.2PHP 5.3.10Vitualmin

修改:我的测试及其完整输出:

curl http://www.example.com/index.php/api/v2_soap?wsdl=1

输出:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<html><head>

<title>404 Not Found</title>

</head><body>

<h1>Not Found</h1>

<p>The requested URL /index.php/api/v2_soap was not found on this server.</p>

</body></html>

2 个答案:

答案 0 :(得分:0)

我猜你也不能在shell中ping那个域?

如果这是一个DNS问题并且域名没有正确解析为localhost,解决此问题的最简单方法是添加一行如

127.0.0.1       www.example.com

/etc/hosts中的本地主机文件。

答案 1 :(得分:0)

问题不在Magento上。

我已在我的本地计算机中添加了/etc/hosts的条目,因为我已经忘记了这一点,因此我怀疑所涉及的域是否正确传播了DNS

所以,真正的问题是:DNS并没有真正传播

last comment of s1lv3r我意识到我做过的废话。

最后,我在我的hosts文件中删除了这个条目(最初用于测试新服务器)并结束了域的DNS配置。