【问题标题】:Space in DocumentRoot folder nameDocumentRoot 文件夹名称中的空格
【发布时间】:2014-01-04 01:07:29
【问题描述】:

我在ubuntu上安装了apache2, 我将DocumentRoot 值更改为我的工作文件夹。 我的文件夹路径是/home/user/My\ Works/sites,所以我将DocumentRoot 更改为:

DocumentRoot /home/user/My\ Works/sites

但是当我重新加载 apache 时,我得到了这个错误:

/etc/apache2/sites-enabled/mysite.conf 第 4 行的语法错误: DocumentRoot 有一个参数,文档树的根目录 操作“configtest”失败。 Apache 错误日志可能有更多 信息。 ...失败!

如果我的文件夹名称中有空格怎么办?

【问题讨论】:

    标签: linux apache ubuntu


    【解决方案1】:

    简单地引用路径:

    DocumentRoot "/home/user/My Works/sites"
    

    【讨论】:

      【解决方案2】:

      我遇到了同样的错误,但我的解决方案是在我在 httpd-vhost.conf 中添加的站点周围添加引号。我添加的站点的 URL 中有一个空格,因此路径要求它用引号引起来。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-10-23
        • 1970-01-01
        • 1970-01-01
        • 2018-09-06
        • 1970-01-01
        • 2010-10-10
        • 1970-01-01
        相关资源
        最近更新 更多