Well you could go add index.html files in all directories or you could do it faster by just modifying your apache configuration files.
Goto your site-enabled folder in apache, typically located at /etc/apache2/sites-enabled/
or you can just use the locate command in linux to find it.
Next open your default configuration file from the sites-enabled folder, generally it should just be 000-default.
This file is structured just like any other xml file. Each directory tag inside the virtualhost tag describes a directory to which the rules should be applied.
In order to stop directory listing for the complete server name space just add
Options -Indexes
to the <directory /var/www> tag. In all probability you will already have an Options tag, so just append -Indexes to it.
Alternatively you may also add it to <directory /> tag provided you have defined your documentroot as /var/www
You will need to restart your apache server for the changes to take effect.
Another method is to add
Options -Indexes
to your .htaccess file if you don't want to modify apache config files. However you need to have
AllowOverride All
declared in your apache config file for that to take effect.
I would suggest you use the first approach, you can also google up the .htaccess approach if you want.
Thanks,
-shravan