0

My document root (suddenly and unexpectedly) changed to /htdocs from /var/www. This happened after I restarted apache2.

The only thing I changed was the httpd.conf file which now reads as follows:

<VirtualHost *>
    ServerName hostname
    UseCanonicalName ON
</VirtualHost>

I've greped through the entire /etc directory looking for DocumentRoot and they all say /var/www.

I removed the 000-default from sites-enabled and replaced it with one that is named default. Changing this back doesn't appear to have an effect.

1 Answer 1

2

Turns out that by adding a <VirtualHost> without a DocumentRoot it will default to the basic Apache2 DocumentRoot. Contrary to what the package (and everything else says), the source gives the DocumentRoot as /htdocs.

The solution is to add DocumentRoot: /var/www to the httpd.conf file.

Source: wiki.apache.org

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .