全球主机交流论坛

标题: 寻求nginx的第3方模块安装方法 [打印本页]

作者: 哥坏人    时间: 2011-7-2 17:56
标题: 寻求nginx的第3方模块安装方法
高手们帮个忙。。
。。,用惯了一键包,连基本的东西都不会
具体nginx模块 ngx_http_subs_filter
http://wiki.nginx.org/HttpSubModule
http://substitutions4nginx.googlecode.com/svn/trunk/

我从svn里下载了
config
ngx_http_chain_buffer.c
ngx_http_chain_buffer.h
ngx_http_subs_filter_module.c
放到新建的文件夹里 使用命令
./configure --add-module=/path/to/module  无法安装


用的是lnmp一键包环境
作者: vvx.cc    时间: 2011-7-2 17:58
好复杂呀
作者: nbclare    时间: 2011-7-2 18:01
./configure --add-module=/path/to/module
make
make install

这样不可以么?
作者: wdlth    时间: 2011-7-2 18:02
先用nginx -v看看原来编译的参数,再加参数进去。
如:

  1. ./configure --user=www --group=www --add-module=../ngx_cache_purge-1.3 --add-module=../ngx_slowfs_cache-1.6 --with-google_perftools_module --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6
复制代码
当然是到源代码目录里面运行

[ 本帖最后由 wdlth 于 2011-7-2 18:07 编辑 ]
作者: neverno    时间: 2011-7-2 18:03
=/path/to/module  
这个路径问题?
作者: 哥坏人    时间: 2011-7-2 18:05
标题: 回复 3# nbclare 的帖子
-bash: ./configure: No such file or directory   直接是这个。我只下载了那4个文件对吗?
作者: Poison    时间: 2011-7-2 18:06
标题: 回复 6# 哥坏人 的帖子
  到nginx的源码目录下./configure
作者: nbclare    时间: 2011-7-2 18:06
看README的样子,似乎是要重新编译nginx.
and then *compile nginx* with the following option:
./configure --add-module=/path/to/module

所以应该是在nginx的源码那里
./configure 原来的编译参数+ --add-module=/path/to/module
这里的path to module是这个第三方模块的源码目录。


应该是这样吧。木有研究过nginx...

----------------UPDATE:
一般情况下,源码目录中都会有README/INSTALL这些说明文档的,其实看看这些文档会有很大的帮助,呵。

[ 本帖最后由 nbclare 于 2011-7-2 18:09 编辑 ]
作者: lxfy    时间: 2011-7-2 18:08
--with-http_sub_module

这个模块需要用第三方?
作者: 哥坏人    时间: 2011-7-2 18:24
  放在nginx目录里。是把nginx重复安装吧?
作者: Poison    时间: 2011-7-2 18:26
标题: 回复 10# 哥坏人 的帖子
只make  不要makeinstall

编译出来后把objs目录下的nginx替换下装好的
作者: 哥坏人    时间: 2011-7-2 18:30
标题: 回复 11# ssh 的帖子
  你能不能说完整点呀。你半步半步说。等下系统都坏了
作者: 哥坏人    时间: 2011-7-2 18:32
标题: 回复 11# ssh 的帖子
我的nginx位置源码包是 /root/lnmp0.6/nginx-0.7.67

从SVN下载的
config
ngx_http_chain_buffer.c
ngx_http_chain_buffer.h
ngx_http_subs_filter_module.c
要拉到nginx-0.7.67目下下,还是还得在目录下新建个文件夹  ?


然后make运行后。出来的东西在哪? 生成在obj下? 然后哪里替换哪里
作者: nbclare    时间: 2011-7-2 18:44
原帖由 哥坏人 于 2011-7-2 18:32 发表
我的nginx位置源码包是 /root/lnmp0.6/nginx-0.7.67

从SVN下载的
config
ngx_http_chain_buffer.c
ngx_http_chain_buffer.h
ngx_http_subs_filter_module.c
要拉到nginx-0.7.67目下下,还是还得在目录下新建个文件夹  ...


SVN弄下来的东西随便丢哪都可以。。。假设丢在了 /root/substitutions/
那么,你只要在 /root/lnmp0.6/nginx-0.7.67/ 下面
./configure 其它编译参数 --add-module=/root/substitutions/
make

完了之后 把 /root/lnmp0.6/nginx-0.7.67/objs/nginx 复制到原来装了nginx的地方(如/usr/local/nginx/sbin/nginx)。
作者: 哥坏人    时间: 2011-7-2 18:50
标题: 回复 14# nbclare 的帖子
谢谢,懂了




欢迎光临 全球主机交流论坛 (https://91ai.net/) Powered by Discuz! X3.4