why not ben

ben tucker's virtual life. work, doings, incoming.

January 13, 2010 at 5:08pm
home

Change the DocumentRoot of default vhost on Ubuntu

Ubuntu comes with a default vhost (000-default) which has its DocumentRoot set to /var/www.  It’s fairly customary to have your DocumentRoots for other vhosts set to something within /var/www (for example /var/www/vhosts).  If you neglect to change the DocumentRoot in 000-default you’ve got the potential for a code-leak.  If you’re using a framework which uses constant naming conventions, it’s not that hard to guess your way to any bit of code in the app.

So as part of your setup procedure, be sure to add changing the DocumentRoot of the default vhost to something like /var/www/default.

Notes