Does anyone know how to change the document root of the Apache server? I basically want
You need to change the
DocumentRoot setting in your
httpd.conf file. Chances are it will be under something like
Use your favourite editor (I recommend Vim) and look for the
DocumentRoot and change it to
/users/spencer/projects. Also look a little further down for a setting that looks like this:
You will also want to change what is in the quotes to your new directory. This gives Apache access to read from that directory when a user makes a request that call on it.
Now restart your apache service (
httpd -k restart) and you should be good to go.
Edit: Apache2 site config files are now typically kept in
/etc/apache2/sites-available/ (Debian, Ubuntu, etc.).