宝塔面板安装的Nginx(已安装)如何添加echo-nginx-module模块

x33g5p2x  于2022-02-12 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(546)

1. nginx添加模块

1.1 echo-nginx-module - 打印工具

# 从github官网获取echo模块
wget https://github.com/openresty/echo-nginx-module/archive/refs/tags/v0.62.tar.gz
tar -zxvf echo-nginx-module-0.62.tar.gz

# 查看版本以及配置信息 == 必须大写V == 里面的配置信息跟步骤4方法里面的Install_Configure几乎一样
nginx -V

# 进去宝塔的脚本目录
cd /www/server/panel/install

# 读修改宝塔官方写的脚本
vim nginx.sh

# 找到字符  ./configure - 如图1 添加模块
--add-module=/home/root/app/nginx-module/echo-nginx-module-0.62

# 大致了解宝塔写的nginx脚本逻辑内容 - 如图2 - 只需要看我框框部分的代码即可

# 更新nginx以及添加模块
sh nginx.sh update 1.21

# 更新完后查看echo模块是否存在
nginx -V

nginx.sh里面的Install_Configure方法 == ./configure配置修改

# 自行查看--add-module=字符添加到哪里即可
./configure --user=www --group=www --prefix=${Setup_Path} ${ENABLE_LUA} --add-module=${Setup_Path}/src/ngx_cache_purge --add-module=${Setup_Path}/src/nginx-sticky-module --with-openssl=${Setup_Path}/src/openssl --with-pcre=pcre-${pcre_version} ${ENABLE_HTTP2} --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_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-cc-opt="-Wno-error" --add-module=/www/server/nginx/modules/echo-nginx-module-0.62 ${jemallocLD} ${ENABLE_WEBDAV} ${ENABLE_NGX_PAGESPEED} ${ADD_EXTENSION} ${i_make_args}

nginx.sh关键代码阅读

可见echo模块已经添加上去

相关文章

微信公众号

最新文章

更多