I noticed that the default sites-available file (/etc/apache2/sites-available/default) contained many “directory” tags with various options.
<Directory />, <Directory /var/www/>, <Directory "/usr/lib/cgi-bin">, and <Directory "/usr/share/doc/">
Do I need any of those, or can I safely remove them?
Don’t start adjusting the default site, it will just become a mess and you won’t be able to figure out what directive does what.
I would recommend you write your own virtual host configuration, this way you actually know what your site does. Here is a little bare bones configuration to get you started.
Just put it in
sites-availableand then runa2ensite mywebsite(mywebsitebeing the filename of the vhost configuration), then reload the server configuration with/etc/init.d/apache2 reload.An explanation for all the directives I used can be found in the apache documentation (I am assuming you run version 2.2).
Oh, and of course you need to disable the default site (
a2dissite default) if theServerNames are conflicting.