As you hopefully know apache2 will give you a filebrowser that looks terrible if it cant find an index page (index.html, index.php, or whatever you set it as). This is useful for filesharing, but just looks terrible. The default sorting order is terrible to. We are going to fix all that with prettier icons, and better sorting.
Cool thing too, is the Fancyindexing/file browser feature of apache is read only so noone on the web can edit your stuff. Its also secure. By the way the other alternative to this is making your own php code that will let you browse safely.
But also check this out:
For indepth info on all of the options we will be using: http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html
Going to go from this:
I would usually find out why this is happening, but I dont mind it, looks good and also I dont have the time right now, maybe another day.
So my default config file looks like this, before any edits:
Make a file called /etc/apache2/fancyedits.conf
In that file put this (replace /var/www with the location you want to fancyindex):
NOTE: this will affect everything from /var/www down recursively into it, it will not affect pages that it found an index page on such as index.html, index.php, etc…
NOTE: notice that images are grabbed from fruitopology. We can download all of them, and point them locally.
For example if your picture http://cdn.fruitopology.net/img/icons/type_application.png was here /var/www/index-icons/type_application.png, you could then just say AddIcon /index-icons/type_application.png , all directory names in apache are either absolute from root of the filesystem / or relative from /etc/apache2 or relative from your Directory which in this case is /var/www. For example Directory /var/www is absolute. But these AddIcons and IndexStyleSheet and HeaderName and ReadmeName and FooterName (not included in this example) are relative locations from /var/www so when you see /index-icons/ is actually /var/www/index-icons/. In bonus section I will show you how to download all these pngs and css files into the /var/www/index-icons/ folder. I will also provide with a download link of the files.