LNMP安装Fancy Index

Posted by 冰河 at 16:05 Add comments 9,306 Views
132015

1.安装LNMP
下载版:http://soft.vpser.net/lnmp/lnmp0.9.tar.gz  (46.45KB)
完整版:http://soft.vpser.net/lnmp/lnmp0.9-full.tar.gz  (61.83MB)
MD5:0eb79ddd5cd1df3a487f62e7943aaa9d

安装步骤:
1)使用putty登陆VPS或服务器;
登陆后运行:screen -S lnmp
如果提示screen: command not found 命令不存在可以执行:yum install screen安装。

2)下载并安装LNMP一键安装包:
安装LNMP执行:wget -c http://soft.vpser.net/lnmp/lnmp0.8-full.tar.gz?&& tar zxf lnmp0.8-full.tar.gz && cd lnmp0.8-full && ./centos.sh

2.升级Nginx
upgrade_nginx.sh,选1.6.2

3.下载fancyindex
git clone https://github.com/aperezdc/ngx-fancyindex.git ngx-fancyindex

4.重新编译Nginx

/usr/local/nginx/sbin/nginx -V #查看nginx已经编译参数

cd nginx-1.6.2
make clean
./configure --add-module=../ngx-fancyindex  [extra desired options](上面的Nginx已经编译参数)
make
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx-1.6.2
cp objs/nginx /usr/local/nginx/sbin

5.修改虚拟主机配置文件(/usr/local/nginx/conf/vhost/dl.binghe.org.conf)
server {
listen 80;
server_name dl.binghe.org;
access_log off;
index index.html index.htm index.php;
root /home/wwwroot/dl.binghe.org;
location / {
fancyindex on;
fancyindex_exact_size off;
fancyindex_localtime on;
fancyindex_footer “/footer.html”;
fancyindex_ignore “footer.html” “exclude_centos.list”; }
}
参数解释:
fancyindex on:开启fancy索引
fancyindex_exact_size off:不使用精确的大小,使用四舍五入,1.9M会显示为2M这样.如果开启的话,单位为字节
fancyindex_localtime on:使用本地时间
fancyindex_footer /footer.html:把网站根目录下footer.html内容作为底部.文件不存在底部会出现404
footer.html内容如下:
<!– footer START –>
<div id=”footer”>
<div id=”copyright”>copyright</div>
</div>
<!– footer END –>
fancyindex_ignore:哪些文件/目录隐藏掉

fancy指令使用:
fancyindex
语法: *fancyindex* [*on* | *off*]
默认值: fancyindex off
配置块: http, server, location
描述: 开启/关闭目录索引功能

fancyindex_css_href
语法: *fancyindex_css_href uri*
默认值: fancyindex_css_href “”
配置块: http, server, location
描述: 外置css路径,可以用这个css替代掉现有的css样式

fancyindex_exact_size
语法: *fancyindex_exact_size* [*on* | *off*]
默认值: fancyindex_exact_size on
配置块: http, server, location
描述: 定义如何显示文件的大小,默认是on,on:文件大小使用精确值,单位为字节.off:单位为KB,MB,GB,如果含有小数点,将会四舍五入。例如1.9MB,将会显示为2MB。

fancyindex_footer
语法: *fancyindex_footer path*
默认值: fancyindex_footer “”
配置块: http, server, location
描述: 指定哪个文件嵌入到索引页面的底部

fancyindex_header
语法: *fancyindex_header path*
默认值: fancyindex_header “”
配置块: http, server, location
描述: 指定哪个文件嵌入到索引页面的头部.用法和fancyindex_footer类似

fancyindex_ignore
语法: *fancyindex_ignore string1 [string2 [… stringN]]*
默认值: No default.
配置块: http, server, location
描述: 哪些文件/目录隐藏掉,支持nginx正则

fancyindex_localtime
语法: *fancyindex_localtime* [*on* | *off*]
默认值: fancyindex_localtime off
配置块: http, server, location
Description: 使用当地时间显示文件的创建时间,默认是off(GMT时间)

参考:

http://lnmp.org/install.html

https://blog.linuxeye.com/409.html

https://www.nginx.com/resources/wiki/modules/fancy_index/

相关日志

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Protected by WP Anti Spam
© 2009 - 2024 冰河的博客