Apache2 DocumentRoot Error

May 18, 2009 at 15:08:43
Specs: Debian Lenny, N/a

I recently installed mod_chroot on a webserver that I am developing. I have managed to configure it and am able to see my test virtualhost site.

However, when I attempt to do a /etc/init.d/apache2 restart I receive the error message:

apache2Warning: DocumentRoot [/test.com/www/] does not exist
... waiting Warning: DocumentRoot [/test.com/www/] does not exist

It seems to me like apache is looking in the wrong place when it does this check. It obviously knows where to look when I try to access the site.

Which config file / what do I need to edit so that the check knows where to look?

(Ordinarily It wouldn't matter since the thing works ... but I'd rather not see an error come up every time I restart apache for each and every virtualhost. This would make troubleshooting a nightmare)

Thanks in advance for any suggestions and let me know if you need any more info.

See More: Apache2 DocumentRoot Error

Report •

May 18, 2009 at 16:09:47
Your apache seems to run chrooted.
So it has no rights to access the /srv/www/...

Please send a reply, if you solved the problem !!!

Report •

May 18, 2009 at 16:19:16
Thanks for the reply paulsep.

Yes , apache is running chrooted.

ChrootDir is set to /var/www/domains/ in the apache2.conf.

DocumentRoot in the Vhost file is set up as /test.com/www/

What would be the best way to resolve this error?

Report •

May 18, 2009 at 16:24:49
Try to put the folder with your website under /var/www/domains so that apache has the permission to access that folder.

Please send a reply, if you solved the problem !!!

Report •

Related Solutions

May 18, 2009 at 18:34:55
The web files were already in the /var/www/domains folder.

I think that the root of my question is this:

How do I "Stop, Start and Restart" the chrooted apache?

I realize now why the error message was occurring... apache is looking for the files in /test.com/www/ from the root directory.

Report •

May 18, 2009 at 19:39:36
/etc/init.d/apache start
/etc/init.d/apache stop
/etc/init.d/apache restart

When you stopped the apache, check whether it's really stopped.
ps aux | grep apache

Please send a reply, if you solved the problem !!!

Report •

Ask Question