【问题标题】:AH00112: Warning: DocumentRoot [] does not exist but it doesAH00112:警告:DocumentRoot [] 不存在,但确实存在
【发布时间】:2014-05-07 08:25:41
【问题描述】:

我需要一些帮助来弄清楚为什么 apache 告诉我我的文档根目录不存在。

我的文档根是/home/user/Documents/Git/site/index.html...它在那里!

我的虚拟主机看起来像

<VirtualHost *:80>
    ServerName site.com
    DocumentRoot /home/user/Documents/Git/site/index.html
    ErrorLog /home/user/Documents/Git/site/error.log
    <Directory /home/user/Documents/Git/site>
        Require all granted
    </Directory>
</VirtualHost>

Git 及其子文件夹和文件以及我的主机127.0.1.1 site.com 中的权限为 775@

我做错了什么?

谢谢

【问题讨论】:

    标签: apache2 ubuntu-13.10


    【解决方案1】:

    您的文档根目录不能是文件,它必须是目录。

    【讨论】:

      【解决方案2】:

      是的,文档根目录不能是 index.html 等文件。 创建一个像 /var/www 这样的根目录。不像 /var/www/index.html

      【讨论】:

        【解决方案3】:

        使用以下命令知道 apache 配置文件在哪里:然后更新文档根目录:

        # apache2ctl -S   [On Debian/Ubuntu]
        # apachectl -S    [On CentOS/RHEL]
        OR
        # httpd -S
        

        如下图所示:

        AH00112: Warning: DocumentRoot [/usr/local/opt/httpd24/Users/YOURNAME/SOMESITE] does not exist
        AH00112: Warning: DocumentRoot [/usr/local/opt/httpd24/c:/dev/blog] does not exist
        VirtualHost configuration:
        127.0.0.1:80           blog.localhost (/usr/local/etc/apache2/2.4/extra/httpd-vhosts.conf:29)
        172.18.0.4:80          Somesite.localhost (/usr/local/etc/apache2/2.4/extra/httpd-vhosts.conf:24)
        ServerRoot: "/usr/local/opt/httpd24"
        Main DocumentRoot: "/Users/YOURNAME/Sites"
        Main ErrorLog: "/usr/local/var/log/apache2/error_log"
        Mutex rewrite-map: using_defaults
        Mutex default: dir="/usr/local/var/run/apache2/" mechanism=default 
        Mutex mpm-accept: using_defaults
        PidFile: "/usr/local/var/run/apache2/httpd.pid"
        Define: DUMP_VHOSTS
        Define: DUMP_RUN_CFG
        User: name="YOURNAME" id=501 not_used
        Group: name="staff" id=20 not_used
        

        在这种情况下,您会知道警告,然后更新 Vhost 文件以删除 Vhost。

           sudo nano /usr/local/etc/apache2/2.4/extra/httpd-vhosts.conf
        

        有效!!!

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2013-10-25
          • 2015-09-25
          • 1970-01-01
          • 2021-05-04
          • 2018-08-02
          • 2017-10-19
          • 2017-05-26
          相关资源
          最近更新 更多