$ yum install gcc gcc-c++ make openssl openssl-devel
wget http://sourceforge.net/projects/pcre/files/pcre/8.33/pcre-8.33.tar.gz
tar -zxvf pcre-8.33.tar.gz
cd pcre-8.33
./configure
make && make install
cd ../
groupadd www
useradd -s /sbin/nologin -g www www
git clone https://github.com/aperezdc/ngx-fancyindex.git ngx-fancyindex
wget http://nginx.org/download/nginx-1.6.0.tar.gz
tar zxvf nginx-1.6.0.tar.gz
cd nginx-1.6.0/
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --add-module=../ngx-fancyindex
make && make install
ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
git clone https://github.com/ixbear/nginx
mv nginx/nginx.conf /usr/local/nginx/conf/
mv nginx/init.d.nginx /etc/init.d/nginx
chmod +x /etc/init.d/nginx
chkconfig --level 345 nginx on
/etc/init.d/nginx start
注意,这里可能会出现错误提示“error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory” 解决办法:ln -s /usr/local/lib/libpcre.so.1 /lib64
2,打开Nginx索引功能,并美化索引页面 vim /usr/local/nginx/conf/nginx.conf #作如下修改