文章目录
- 一 宝塔的目录结构
- nginx默认安装脚本
- nginx源码位置(重点)
- 二 重新编译宝塔的Nginx
- 1 查看nginx的编译参数
- 2 添加FastDFS模块
- 3 执行`./configure`命令
- 4 引入依赖
- 5 编译nginx
- 三 验证结果
参考教程:
宝塔面板编译Nginx secure_link 防盗链模块
https://www.bt.cn/bbs/thread-17026-1-3.html
一 宝塔的目录结构 nginx默认安装脚本
/www/server/panel/install/nginx.sh nginx源码位置(重点) 在面板上选择编译安装nginx1.16完成后,就可以看到源码的位置了【FastDFS和宝塔Nginx整合篇-2】
cd /www/server/nginx/src/ 二 重新编译宝塔的Nginx 进入源码目录cd /www/server/nginx/src/1 查看nginx的编译参数
nginx -V 复制返回的结果,比如我的是--user=www --group=www --prefix=/www/server/nginx --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 --with-openssl=/www/server/nginx/src/openssl --with-pcre=pcre-8.43 --with-http_v2_module --with-stream --with-stream_ssl_module --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 --with-ld-opt=-ljemalloc 2 添加FastDFS模块 # 把获得的参数最后添加上 以下语句--add-module=/home/temp/fastdfs-nginx-module-1.20/src/ 3 执行./configure命令 在/www/server/nginx/src/目录下执行语句#上面拼凑的最后命令是./configure --user=www --group=www --prefix=/www/server/nginx --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 --with-openssl=/www/server/nginx/src/openssl --with-pcre=pcre-8.43 --with-http_v2_module --with-stream --with-stream_ssl_module --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 --with-ld-opt=-ljemalloc --add-module=/home/temp/fastdfs-nginx-module-1.20/src/ 4 引入依赖 编辑 /www/server/nginx/src/objs/Makefilevim /www/server/nginx/src/objs/Makefile# 添加以下语句-I usr/include/fastdfs \-I usr/include/fastdfscommon \# 如下图5 编译nginx 在/www/server/nginx/src目录下执行命令
makemake install 三 验证结果 编译完成后,进入宝塔页面进行操作,看到下图即成功[
- 春季老年人吃什么养肝?土豆、米饭换着吃
- 三八妇女节节日祝福分享 三八妇女节节日语录
- 老人谨慎!选好你的“第三只脚”
- 校方进行了深刻的反思 青岛一大学生坠亡校方整改校规
- 脸皮厚的人长寿!有这特征的老人最长寿
- 长寿秘诀:记住这10大妙招 100%增寿
- 春季老年人心血管病高发 3条保命要诀
- 眼睛花不花要看四十八 老年人怎样延缓老花眼
- 香槟然能防治老年痴呆症? 一天三杯它人到90不痴呆
- 老人手抖的原因 为什么老人手会抖
