apache 在此服务器上找不到请求的 URL /
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/699473/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The requested URL / was not found on this server
提问by
I have 2 Apache instances on the same server, one on port 80, one on another port. The first one works fine. When I go to mydomain.com:otherport I get the error message named in the title. The directory does exist, and has the same user and group that the web server is running as.
我在同一台服务器上有 2 个 Apache 实例,一个在端口 80 上,一个在另一个端口上。第一个工作正常。当我转到 mydomain.com:otherport 时,我收到标题中指定的错误消息。该目录确实存在,并且具有与运行 Web 服务器相同的用户和组。
回答by
Finally figured it out. When I added the DirectoryIndex directive, I was adding it to the main httpd.conf virtual host which I had just created, while the second server was still running off the second instance. Now I feel stupid!
终于想通了。当我添加 DirectoryIndex 指令时,我将它添加到我刚刚创建的主 httpd.conf 虚拟主机,而第二个服务器仍在运行第二个实例。现在觉得自己很傻!
For anyone else that is reading, if you are getting this error and can't figure out why, you need to add a DirectoryIndex directive.
对于正在阅读的其他任何人,如果您收到此错误并且无法弄清楚原因,则需要添加 DirectoryIndex 指令。
回答by MarkusQ
You probably need to set up the http.conf for the second instance. Why are you doing it as two instances in the first place?
您可能需要为第二个实例设置 http.conf。为什么你首先将它作为两个实例来做?
Two thoughts:
两个想法:
- Gradually change the non-working configuration till it matches the working one (make a backup first of course) and see what change fixes it
- Look at the error_log; if necessary, raise the logging level until you see something informative.
- 逐渐更改非工作配置,直到它与工作配置相匹配(当然先进行备份)并查看哪些更改修复了它
- 查看error_log;如有必要,请提高日志记录级别,直到您看到信息丰富的内容。

