为什么Apache说DocumentRoot不存在,即使它确实存在?

时间:2013-12-09 16:56:03

标签: apache

我正在第一次配置Apache虚拟主机。我使用this教程将apache配置为使用虚拟主机。当我重新启动apache时,它表示我的一个“虚拟”链接的文档根目录不存在 - 即使该文件存在于我的系统上。阿帕奇为什么这么说?我该如何解决?

prompt$ sudo apachectl -k restart
Password:
Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist
Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] does not exist
httpd: Could not reliably determine the server's fully qualified domain name, using Abrams-MacBook-Air-3.local for ServerName
prompt$ cat /usr/docs/dummy-host.example.com 
<p> it works </p> 

1 个答案:

答案 0 :(得分:2)

mv /usr/docs/dummy-host.example.com /usr/docs/index.html
mkdir /usr/docs/dummy-host.example.com
mv /usr/docs/index.html /usr/docs/dummy-host.example.com/index.html

这会将您的文件重命名为正确的index.html文件,创建您真正想要的子目录,然后像您实际想要的那样将新文件存档在主机目录下。

相关问题