Use custom icons with Apache directory listings

Nov 07, '02 09:32:19AM

Contributed by: jago_lebow

If you are running apache, you can replace the default icons used when a directory is listed with your own. This way you can make your webserver running on OSX look like it is running on OSX. The icons are in /usr/share/httpd/icons/, and I would suggest backing all of these up before you mess with them. you can do this quickly by typing:

sudo cp -r /usr/share/httpd/icons /usr/share/httpd/icons.bak
You can use the Get Info (Command-I in the Finder) command to view the icon for a certian type of file, then copy it and use Photoshop or something to save the icon as a gif. Then replace the default icon file with the one you have just created. Now when list a dirctory you should see your customized icon.

You can also add new types by edditing you httpd.conf file (/etc/httpd/httpd.conf). Add the line:
AddIcon [PathToIcon] [Extensions]
For example, if you want an icon to show up for disk images then add the line:
AddIcon /icons/diskimg.gif .dmg .cdr .smi
I would suggest adding these lines in with all of the others that are already in the httpd.conf file.

Comments (14)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20021107063219391