首页» IT互联网 » PHPNOW目录浏览启用关键点

PHPNOW目录浏览启用关键点

in IT互联网 | 没有评论

下载了PHPNOW的精简版 PnLite-12.02.04 结果无论如何都无法启用目录浏览,翻遍了资料发现只需要在httpd.conf 中添加支持模块。
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
即可!汗,折腾大半天,mark一下备用
—————————

一.目录浏览的配置。
主配置文件 httpd.conf 中修改:
1)添加支持模块。
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
2)为DocumentRoot目录添加Options Indexes,即可生成目录。

options Indexes FollowSymLinks

3)加载 httpd-autoindex.conf 配置
Include conf/extra/httpd-autoindex.conf

在配置文件httpd-autoindex.conf中的修改:
IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=* FoldersFirst Charset=UTF-8 SuppressDescription SuppressHTMLPreamble
其中FancyIndexing 支持美化显示;HTMLTable 允许底层代码把文件列表生成在一个table元素里面;VersionSort 安装版本排序;NameWidth=* 页面自动匹配文件名宽度;FoldersFirst 安装文件夹优先排列;Charset=UTF-8 支持中文显示;SuppressDescription 不显示文件描述;最后一个忘记是什么了,去看apache 官网的说明。。。
2.apache 原生目录实在难看难过。还好有改善的方法。
网上有 H5AI 的模版可以下载使用。但现在是用在嵌入式平台,资源有限,只做了参考。
1)apache提供配置两个文件,以便修饰页面。
# ReadmeName is the name of the README file the server will look for by
# default, and append to directory listings.
#
# HeaderName is the name of a file which should be prepended to
# directory indexes.
ReadmeName /footer.shtml (文件前必须加/,使用绝对路径,否则子目录无法继承该文件)
HeaderName /header.shtml
这两个文件放于DocumentRoot目录下。
2)如果制作这两个文件基本与底层无关了。可以参考:
http://www.360doc.com/content/12/0113/22/3130130_179259431.shtml

关键词:

还没有评论哦,赶快抢沙发~~

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注