2011-08-07, 04:12 PM
I'm trying to get virtual hosts working on Apache.
In /etc/httpd/conf/http.conf it says that: DocumentRoot "/var/www/html". So I think that's the place where Apache will be looking for your website files.
I made a virtualhost:
NameVirtualHost ipadress:80
# Custom virtualhosts
<virtualhost ipadress:80></virtualhost>
ServerAlias www.feedmebits.nl
ServerAdmin maarten@feedmebits.nl
DocumentRoot feedmebits.nl
ServerName feedmebits.nl
ErrorLog logs/feedmebits.nl-error_log
#CustomLog logs/host.some_domain.com-access_log common
in /var/www/html/ I made two directories so it looks like this:
/var/www/html/websites/feedmebits.nl
When I restart Apached it restarts but gives me an error:
Starting httpd: Warning: DocumentRoot [/etc/httpd/feedmebits.nl] does not exist
When I try and make a directory in /etc/httpd/feedmebits.nl and restart apache I don't get the error message.
And when I try making putting feedmebits.nl in a sub directory: /etc/httpd/websites/feedmebits.nl I also get
an the same error message.
I don't quite understand this because isn't it supposed to go to DocumentRoot which is /var/www/html and if I added
directories in there and mentioned it in my virtual host, isn't it supposed to see it? Why am I getting an error?
Don't quite understand?
Another thing I noticed, is that when I have my virtualhost enabled, and try to go to my test.php which is in /var/www/html/test.php
It doesn't work anymore either. When I add it to /etc/httpd/feedmebits.nl, it works again.