为什么Apache说DocumentRoot不存在,即使它存在?
我正在第一次配置Apache虚拟主机。我使用教程将apache配置为使用虚拟主机。当我重新启动apache时,它会说我的一个“虚拟”链接的文档根不存在——即使该文件存在于我的系统中。阿帕奇为什么这么说?我怎样才能修好它为什么Apache说DocumentRoot不存在,即使它存在?,apache,Apache,我正在第一次配置Apache虚拟主机。我使用教程将apache配置为使用虚拟主机。当我重新启动apache时,它会说我的一个“虚拟”链接的文档根不存在——即使该文件存在于我的系统中。阿帕奇为什么这么说?我怎样才能修好它 prompt$ sudo apachectl -k restart Password: Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist Warning: DocumentRoot [/
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>
提示$sudo apachectl-k重新启动
密码:
警告:DocumentRoot[/usr/docs/dummy host.example.com]不存在
警告:DocumentRoot[/usr/docs/dummy-host2.example.com]不存在
httpd:无法可靠地确定服务器的完全限定域名,请使用Abrams-MacBook-Air-3.local作为ServerName
提示$cat/usr/docs/dummy-host.example.com
它可以工作
这会将您的文件重命名为适当的index.html文件,创建您实际需要的子目录,然后按照您实际需要将新文件归档到主机目录下。dummy-host.example.com是目录还是文件?它应该是一个目录,您的cat语句使它看起来像一个html文件。@DVG我把它作为一个文件。我不知道它应该是一个目录。
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