AH00112: Warning: DocumentRoot [] does not exist but it does
Asked Answered
H

3

5

I need some help figuring why apache tells me that my document root does not exists.

My document root is /home/user/Documents/Git/site/index.html... It is there!

My vhost looks like

<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>

Permissions are 775 for Git and its subfolders and files and in my hosts 127.0.1.1 site.com

What am I doing wrong?

Thanks

Heaviside answered 28/3, 2014 at 2:48 Comment(0)
M
15

Your document root cannot be a file, it must be a directory.

Megaspore answered 28/4, 2014 at 12:41 Comment(1)
I logged in the first time for years, just to upvote this. You are my hero.Suffix
B
3

Use below command to know where is the apache configure file is: then to update the document root:

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

it shows below:

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

In this case , you will know the warning, then update the Vhost file to delete the Vhosts.

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

It works!!!

Beardsley answered 30/5, 2021 at 13:25 Comment(0)
M
1

Yes, document root can not be a file such as index.html. Create a root like /var/www. Not like /var/www/index.html

Menial answered 6/6, 2014 at 16:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.