Google Search Within opentiss.net

2006-11-19

SLES 10之Apache定制mod_autoindex的心得

文件/etc/apache2/conf.d/apache2-ftp.conf
Alias /ftp/ "/data/"

<Directory "/data">
Options Indexes
IndexOptions FancyIndexing XHTML HTMLTable ScanHTMLTitles FoldersFirst SuppressRules
IndexIgnore favicon.ico header.html footer.html
HeaderName /header.html
ReadmeName /footer.html
IndexStyleSheet "/linux.css"
IndexOrderDefault Ascending Name
AllowOverride None
Order allow,deny
Allow from all
</Directory>

说明:
/data目录是我的vsftp用户目录,我所有的上传文件均在这个位置。
HTMLTable配置选项是用表的方式输出。
XHTML表示输出的页面是XHTML了。
HeaderName是页面的上半部分。
ReadmeName是页面的上半部分。
SuppressRules可以控制不输出文件或目录列表中的两条水平线(位于列表标题下面及列表底部)。
IndexStyleSheet是输出页面的样式表(linux.css是我从pjanik那里直接拿来进行测试用的),需要注意的是,这是apache2.2.x的特性,如果想在稍早的版本使用样式表,请您将css文件的内容以<style type="text/css"> <style>的形式放在HeaderName文件的开始部分,用于定制您输出页面的样式。
其他几个选项,网上的文档已经说得比较清楚了,我就不献丑了。
需要说明的是HeaderName与ReadmeName是html页面中位于标记<body> </body>之间的内容,不要把其他内容写入这两个文件中,写了也没有用处。

最初的想法来源是OpenOffice.org一个开发者的ftp站点,我经常从这个站点下载源文件及安装程序,前些日子,捷克的OpenOffice.org宗师之一Pavel在其个人博客上发布消息称ftp.linux.cz has new HTTP look!,我当时非常羡慕这个网站的样子,就在想这个Pavel Janík先生是用的什么软件,然后就在sf.net上使劲地搜索,结果没有什么激动人心的收获,只好重新思考了一下,结果发现,原来这是apache的一项配置,从周五晚上一直到周六凌晨,我一直在弄,最终于周六下午把这个配置文件弄好了,最后解决的是SuppressRules选项,如果有这个选项的话,那么就不会在表中多出两行来,这上下两个空行非常令人不舒服,尤其是采用HTMLTable格式时,我还是从apache网站上下载了源代码之后,看了看文件mod_autoindex.c,才搞明白这个配置选项的用途的。

12 条评论:

匿名 说...

Hi there it's me, I am also visiting this website daily, this web site is really fastidious and the viewers are in fact sharing nice thoughts. raspberry ketone side effects - raspberry Ketone side effects - raspberry ketone scam

Take a look at my homepage: raspberry ketone side Effects

mao qiuyun 说...

cleveland cavaliers jersey
nike roshe
links of london uk
oakley sunglasses
karen millen uk
louboutin shoes
oakley sunglasses
lululemon outlet
indianapolis colts jerseys
oakley sunglasses
seattle seahawks jerseys
abercrombie and fitch
adidas wings
adidas shoes
coach outlet online
minnesota vikings jerseys
michael kors canada, http://www.michaelkorsoutletcanada.in.net
abercrombie
louis vuitton outlet
lacoste shirts
nike air max uk
pandora jewelry
tory burch outlet
chelsea jersey
hollister shirts
cheap oakley sunglasses, http://www.oakleysunglasses-outlet.us.com
basketball shoes,basketball sneakers,lebron james shoes,sports shoes,kobe bryant shoes,kobe sneakers,nike basketball shoes,running shoes,mens sport shoes,nike shoes
ugg boots, http://www.uggbootsclearance.in.net
north face outlet
coach outlet store
nfl jerseys
louis vuitton outlet
ed hardy t-shirts
ugg uk
nike running shoes
kate spade handbags
michael kors outlet
0827maoqiuyun

chenlina 说...

louis vuitton bags
hogan scarpe
uggs pas cher
oakley sunglasses outlet
michael kors handbags
louis vuitton outlet
ugg boots
kevin durant shoes
michael kors outlet clearance
adidas ultra boost
ugg boots paris
coach outlet
coach outlet store online
new england patriots jerseys
michael kors handbags
air jordan pas cher
ugg boot uk
jordan shoes
mont blanc pens
christian louboutin sale
toms shoes
ralph lauren uk
fitflops
true religion outlet
louis vuitton borse
polo ralph lauren
ugg uk
toms shoes
michael kors handbags
ralph lauren
jordan 11
adidas shoes
gucci handbags
coach outlet store online
coach outlet
ugg uk
cheap jordans
uggs outlet
louis vuitton handbags
cheap ray ban sunglasses
chenlina20160831

Qinan Chen 说...

20160922qiujie
hermes bags
polo ralph lauren outlet online
louis vuitton outlet online
nike free flyknit
ugg boots clearance
jordan retro
cheap jordan shoes
burberry outlet online
canada goose outlet
hugo boss suits

Unknown 说...

bears jerseys
michael kors handbags outlet
nike huarache
nba jerseys
nike tn
versace shoes
michael kors handbags
nhl jerseys
vikings jerseys
michael kors handbags

chenmeinv0 说...

fitflops sale clearance
fitflops
toms outlet
nike air max 2016
true religion
coach factory outlet
cat boots
true religion jeans
christian louboutin sale
true religion outlet
2017.3.13xukaimin

xumeiqing 说...

pandora charms
air jordan retro
hollister co
coach outlet
michael kors
fred perry polo
birkenstocks
fitflops uk
coach outlet
adidas outlet
20170315huazhen

chenmeinv0 说...

louis vuitton outlet
michael kors canada
ray ban sunglasses
coach outlet
mac cosmetics online
pandora jewelry
asics shoes
uggs outlet
clarks shoes
michael kors
20175.26chenjinyan

郑佳颖 说...

nike mercurial vapor
burberry scarf
adidas neo online shop
adidas nmd r1
links of london
nike air max 2018
kobe bryant shoes
michael kors handbags
prada sunglasses
fitflops clearance

raybanoutlet001 说...

kate spade outlet
reebok shoes
ugg outlet
coach outlet
fitflops sale
fitflops
jordan shoes
nike huarache
pandora jewelry
snapbacks wholesale

吥離吥棄 说...

converse shoes
louboutin shoes
lebron 13 low
light up shoes
nike dunk low
nmd
nike air force 1
longchamp handbags
air jordan shoes
air jordan

raybanoutlet001 说...

cheap oakley sunglasses
fitflops shoes
new york knicks
coach outlet
raiders jerseys
skechers shoes
christian louboutin shoes
ed hardy outlet
kate spade handbags
coach factory outlet