I created an .htaccess file with only the following line:
Ubuntu 12.04 (Precise Pangolin)
Server version: Apache/2.2.22 (Ubuntu) Server built: Feb 13 2012 01:51:56
$ ls -l .htaccess
To get this working, I added the following to
/etc/apache2/httpd.conf (which is a zero-length file by default when Apache is installed) and then restarted Apache. Now
Options -Indexes in the
.htaccess file works as desired. Here is the bare minimum required to get it to work:
<VirtualHost *:80> DocumentRoot /var/www <Directory / > </Directory> </VirtualHost>
lanzz's suggestion to add a line of gibberish to the
.htaccess file to see if it was being read was helpful in diagnosing the problem.
AllowOveride defaults to
All, per Evan Mulawski's comment, so it's not required in the minimal set of
httpd.conf lines above.