【问题标题】:My localhost apache server isn't showing my index.html我的 localhost apache 服务器没有显示我的 index.html
【发布时间】:2011-11-01 16:41:55
【问题描述】:

最近,我的 localhost apache 服务器停止显示我的 index.html。它只是显示“它有效!”现在。我不知道该怎么办。我的 httpd.conf 文件看起来不错,但就是这样:

http://pastebin.com/JQSEMUTy

当我尝试重新启动我的 apache 服务器时,它会给出:

httpd:无法可靠地确定服务器的完全限定域名,使用 Richard-Lus-MacBook-Pro.local 作为 ServerName

提前致谢!

【问题讨论】:

  • 尝试mamp.info 用于 mysql、php 和 apache。顺便说一句,您可以尝试删除第 230 行和第 232 行,看看服务器是否正在获取 index.html 文件

标签: apache localhost


【解决方案1】:

我猜有更新..?

DocumentRoot "/sites"

这是您正在使用的文档根目录吗?如果没有,请修复它。另外,设置您的服务器名称:

ServerName www.example.com:80

【讨论】:

  • 也许你应该添加 DocumentRoot 是一个绝对路径,所以它通常类似于 /var/www/sites
  • 是的,我将文件放入 /sites 文件夹。抱歉,我究竟为我的 ServerName 设置了什么?我通常通过输入 localhost/ 来访问它到目前为止,它给了我错误The requested URL / was not found on this server. 这是我的 httpd.conf 的更新文件pastebin.com/eWCGFR0P 再次感谢!
猜你喜欢
  • 2019-04-20
  • 2020-12-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多