DocumentRoot does not exist problem

November 23, 2014 4.1k views

AH00112: Warning: DocumentRoot [/var/www/] does not exist

what does this mean and how can I fix it?
Thank you.

1 Answer

It means that you have a VirtualHost with its DocumentRoot set to /var/www/, but that directory does not exist. You would simply have to create the directory to fix it:

sudo mkdir /var/www/
  • I tried it but it says;

    mkdir: cannot create directory ‘/var/www/’: No such file or directory

  • Oh, /var/www/ does not exist either so you'll have to create it first:

    sudo mkdir /var/www/
    sudo mkdir /var/www/

    You can also pass the -p option to mkdir that creates all missing directories:

    sudo mkdir -p /var/www/
Have another answer? Share your knowledge.