DocumentRoot does not exist problem

Posted November 23, 2014 25.7k views

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

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

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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/