Apache在自动生成索引时直接使用图标中的哪些图标



Apache的mod_autoindex模块可以在没有用户创建的index.html file的情况下生成文件索引。打开FancyIndexing选项后,Apache还会根据文件名在文件旁边添加一个图标。

在这些图标来自的/usr/share/apache2/icons目录中,有74个不同的图标(我只计算大小合适的gif(。

这些图标是:

a.gif
alert.black.gif
alert.red.gif
back.gif
ball.gray.gif
ball.red.gif
binary.gif
binhex.gif
blank.gif
bomb.gif
box1.gif
box2.gif
broken.gif
burst.gif
c.gif
comp.blue.gif
comp.gray.gif
compressed.gif
continued.gif
dir.gif
diskimg.gif
down.gif
dvi.gif
f.gif
folder.gif
folder.open.gif
folder.sec.gif
forward.gif
generic.gif
generic.red.gif
generic.sec.gif
hand.right.gif
hand.up.gif
image1.gif
image2.gif
image3.gif
index.gif
layout.gif
left.gif
link.gif
movie.gif
p.gif
patch.gif
pdf.gif
pie0.gif
pie1.gif
pie2.gif
pie3.gif
pie4.gif
pie5.gif
pie6.gif
pie7.gif
pie8.gif
portal.gif
ps.gif
quill.gif
right.gif
screw1.gif
screw2.gif
script.gif
sound1.gif
sound2.gif
sphere1.gif
sphere2.gif
tar.gif
tex.gif
text.gif
transfer.gif
unknown.gif
up.gif
uu.gif
uuencoded.gif
world1.gif
world2.gif

我发现了一个旧帖子,声称";在所有这些中,它只使用了25〃;。

这是真的吗?自动索引中实际使用了哪些图标?

我想创建自己的一组图标,所以我想知道哪些图标我应该真正创建,哪些没有使用。

我在serverfault上找到了答案!

mod_autoindex的默认配置在一个名为extra/httpd-autoindex.conf的文件中定义。

#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions.  These are only displayed for
# FancyIndexed directories.
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
#
# DefaultIcon is which icon to show for files which do not have an icon
# explicitly set.
#
DefaultIcon /icons/unknown.gif

以下是整个文件以供参考:https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/extra/httpd-autoindex.conf.in

因此,答案是默认情况下,这25个图标在索引中使用:

  • 压缩.gif
  • text.gif
  • image2.gif
  • sound2.gif
  • movie.gif
  • 二进制.gif
  • binhex.gif
  • tar.gif
  • world2.gif
  • a.gif
  • 布局.gif
  • text.gif
  • c.gif
  • p.gif
  • f.gif
  • dvi.gif
  • uuencoded.gif
  • script.gif
  • tex.gif
  • 炸弹.gif
  • 后退.gif
  • hand.right.gif
  • 文件夹.gif
  • 空白.gif
  • 未知.gif

当然,AddIcon指令可以添加更多