当前位置:论坛首页 > Linux面板 > 讨论

宝塔面板Nginx添加fancy-index组件的方法

发表在 Linux面板2019-12-14 08:42 [复制链接] 7 4090

PS:看到一些小伙伴在论坛里问,加之也没有详细的文档供参考,便详细记录下来,以供后人参考。

1.
下载最新版本的Nginx fancyindex组件,命令:
  1. git clone https://github.com/aperezdc/ngx-fancyindex
复制代码
2.将组件拷贝到宝塔面板的Nginx源码目录:
  1. cp -R ./ngx-fancyindex /www/server/nginx/src
复制代码
3.进入Nginx源码目录,查看已安装组件情况:
  1. cd /www/server/nginx/src
  2. nginx -V
复制代码
4.配置Nginx参数,并重新编译(复制一整条直接执行):
  1. ./configure --prefix=/www/server/nginx --with-openssl=/www/server/nginx/src/openssl --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --add-module=/www/server/nginx/src/nginx-sticky-module --add-module=/www/server/nginx/src/nginx-http-concat --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-stream --with-stream_ssl_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E --with-pcre=pcre-8.42 --with-cc-opt=-Wno-error --with-ld-opt=-ljemalloc --add-module=/www/server/nginx/src/ngx-fancyindex
复制代码
5.备份原Nginx,将编译后的文件复制过去,并重启nginx。
  1. cd ../sbin
  2. copy nginx nginxbak
  3. copy ../src/objs/nginx ./nginx
  4. systemctl restart nginx.service 
复制代码
6.执行命令查看fancy-index组件安装是否完成
  1. nginx -V
复制代码
7.大功告成。
老规矩,有问题请在下方留言,我会一 一解答。
使用道具 举报 只看该作者 回复
发表于 2020-3-13 23:02:29 | 显示全部楼层
按照流程操作 ,提示 ./configure: warning: the "--with-ipv6" option is deprecated

于是我把--with-ipv6删了。然后编译,复制,重启,但是还是不行。nginx -v 查看依旧没有这个模块
使用道具 举报 回复 支持 2 反对 0
发表于 2020-8-6 00:53:37 | 显示全部楼层
按照这教程弄弄没成,网上搜索了好多文章也是么有成功

系统版本,以及面板版本



nginx版本1.18.0


使用道具 举报 回复 支持 1 反对 0
发表于 2019-12-14 09:39:56 | 显示全部楼层
插个眼
使用道具 举报 回复
发表于 2019-12-14 10:37:44 | 显示全部楼层
火钳刘明
使用道具 举报 回复
发表于 2020-8-14 09:16:24 | 显示全部楼层
-bash: ./configure: No such file or directory\

--

请问这是怎么回事,还需要安装什么吗?
使用道具 举报 回复 支持 反对
发表于 2020-8-14 09:17:09 | 显示全部楼层
-bash: ./configure: No such file or directory\

--

请问大佬,这是怎么回事,还需要安装什么吗?
使用道具 举报 回复 支持 反对
发表于 2021-7-27 17:07:23 | 显示全部楼层

最后一行除了加上红色部分,还要加上最后蓝色部分才能编译成功。
捕获.PNG
捕获.PNG
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

企业版年付运维跟进群

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急问题处理

论坛响应时间:10分钟

问题处理方式:1对1处理(优先)

工作时间:白班:9:00 - 18:00

工作时间:晚班:18:00 - 24:00

立即付费处理
快速回复 返回顶部 返回列表