bernie2436
bernie2436

Reputation: 23901

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
Password:
Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist
Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] 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/dummy-host.example.com 
<p> it works </p> 

Upvotes: 3

Views: 11144

Answers (1)

DVG
DVG

Reputation: 17480

mv /usr/docs/dummy-host.example.com /usr/docs/index.html
mkdir /usr/docs/dummy-host.example.com
mv /usr/docs/index.html /usr/docs/dummy-host.example.com/index.html

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.

Upvotes: 3

Related Questions