Reputation: 21
I am trying to set up a website with name based virtual hosting. Now when I visit the website, lukej.us, I get a url not found error. Here is the conf file
<VirtualHost *:80>
ServerName www.lukej.us
ServerAlias lukej.us *.lukej.us
DocumentRoot /vars/www/html/lukej.html
</VirtualHost>
<Directory /vars/www/html/>
AllowOverride All
Order allow,deny
Allow from all
</directory>
Upvotes: 0
Views: 174
Reputation: 54729
DocumentRoot
is supposed to be a directory. It is the root folder from which all files will be served. You attempted to specify a file, which then gets interpreted as a directory, since it expects a directory. So its trying to serve from the directory /vars/www/html/lukej.html/
which probably doesn't exist.
You probably wanted something like this:
<VirtualHost *:80>
ServerName www.lukej.us
ServerAlias lukej.us *.lukej.us
DocumentRoot /vars/www/html/
DirectoryIndex lukej.html
</VirtualHost>
This will serve files from the /vars/www/html/
directory, and will show the lukej.html
as the index file (when you access the path /
from the web).
Upvotes: 1