我在我的服务器上使用nginx,我下载它的源代码并使用以下方法编译它:
./configure --prefix=/opt/nginx --user=nginx --group=nginx --with-http_ssl_module \
--conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--add-module=/opt/ngx_http_substitutions_filter_module \
--with-http_stub_status_module在conf.d .d中设置并添加文件,并使其正常工作。但是突然间,当我重新启动它时,它给了我错误消息:
nginx: [emerg] unknown directive "stub_status" in /etc/nginx/conf.d/mytest.conf:6我查看了更多细节,发现它无法加载模块"http_stub_status_module“。我知道我用安装来编译它。
My Question is there any way i can reload this module or add somewhere in conf to make it working??\*\*i dont want to install it again because if i compiled it again it will remove my current configuration.
发布于 2017-05-08 09:26:41
您需要使用stub_status编译nginx,将以下内容传递给您的./配置文件:
--with-http_stub_status_module to ./configure
Gentoo用户:启用扩大使用-旗帜 status并重新编译nginx。例如/etc/portage/package.use/nginx:
www-servers/nginx NGINX_MODULES_HTTP: stub_status
最后,执行以下操作:emerge -pav nginx
发布于 2016-03-11 01:12:07
与Apache等其他软件不同,Nginx没有在运行时加载模块的机制;它们必须编译在其中。
如果在构建新版本之前在旧版本上运行nginx -V,您将得到一条消息,其中包含它所使用的configure命令。尝试在您的新源代码树中使用相同的模块;如果您实际上没有所需的模块可用,那么在这一点上它将失败。如果使用相同命令的配置和后续构建都成功,那么您应该有理由相信您的新构建具有与旧版本相同的功能。当然,您仍然需要注意可能对nginx本身或其中任何模块所做的任何破坏更改。
发布于 2014-04-11 05:52:32
问题是,您的系统上可能有多个nginx二进制文件,并且现在试图在没有模块的情况下加载该二进制文件。这是一种常见的情况,当某人在通过包管理器安装后自己从源代码中编译一些东西。
https://stackoverflow.com/questions/23003700
复制相似问题