bernie2436 bernie2436 - 1 year ago 233
Apache Configuration Question

Why is Apache saying that DocumentRoot does not exist even though it does?

I am working on configuring Apache virtual hosts for the first time. I configured apache to use virtual hosts using this tutorial. When I restart apache it says the document root for one of my "virtual" links does not exist -- even though the file exists on my system. Why is Apache saying this? How can I fix it?

prompt$ sudo apachectl -k restart
Warning: DocumentRoot [/usr/docs/] does not exist
Warning: DocumentRoot [/usr/docs/] does not exist
httpd: Could not reliably determine the server's fully qualified domain name, using Abrams-MacBook-Air-3.local for ServerName
prompt$ cat /usr/docs/
<p> it works </p>

Answer Source
mv /usr/docs/ /usr/docs/index.html
mkdir /usr/docs/
mv /usr/docs/index.html /usr/docs/

This will rename your file to a proper index.html file, create the subdirectory you actually want and then file the new file under the host directory like you actually want.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download