Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The best way to install this module into nginx? #56

Open
Blake-Guo opened this issue Jan 16, 2019 · 4 comments
Open

The best way to install this module into nginx? #56

Blake-Guo opened this issue Jan 16, 2019 · 4 comments

Comments

@Blake-Guo
Copy link

Blake-Guo commented Jan 16, 2019

Hi, can someone provide some insight regarding how to load this module into NGINX? I do some search and find two ways:
(1) Build a customized NGINX with source code from scratch: https://github.com/ajdruff/nginx-naxsi-rpm/blob/master/how-to-build-your-own-nginx-rpm.md
(2) Install NGINX directly "yum install nginx", then load this module into nginx in the runtime
like "./configure --with-compat --add-dynamic-module=../ngx_aws_auth"
https://www.nginx.com/blog/compiling-dynamic-modules-nginx-plus/

Can anyone provide some insight regarding the pros and cons of these two? Thanks

@aosaginohi
Copy link
Contributor

Not sure 100% about the "technical" differences of the two I think you can find the benefits of both somewhere on the Nginx website.

But for me, I have a yum repository so I can make different rpms for each dynamic module and that way I can update them separately from Nginx.

I personally have used both in the past and not seen any real differences performance wise so I would so just go for the one that makes it most easy for your organization.

Someone else might disagree :).

@Blake-Guo
Copy link
Author

@sbagmeijer Thanks Sjir. I think the second one "load dynamic module into running nginx directly with several steps such as /configure --with-compat --add-dynamic-module=../ngx_aws_auth" is so straightforward. Especially compared with the first solution that need to installs all kinds of the tools, configure all sorts of files, which is so tedious. So just wondering is there any benefit going through that..

@ammartaj53
Copy link

I did that. I put the module in the path /usr/share/nginx/modules/ngx_http_aws_auth_module.so

and added line

load_module modules/ngx_http_aws_auth_module.so;

in nginx.conf

But I get error

# nginx -t
nginx: [emerg] dlopen() "/usr/share/nginx/modules/ngx_http_aws_auth_module.so" failed (/usr/share/nginx/modules/ngx_http_aws_auth_module.so: cannot open shared object file: No such file or directory) in /etc/nginx/nginx.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

@dribblecastle
Copy link

@ammartaj53 I was just looking at this post on Friday and have the same issue as you. Must have been before you posted. Any luck figuring it out since your post? I have the exact same error.

What version of Linux and OpenSSL are you running? I'm running Ubuntu 22.04 and 3.0.2-0ubuntu1.7 for OpenSSL. When I do the compile, I've been getting warnings about SHA256 and Werror=deprecated-declarations. I was wondering if that was the source of my problem, but can't say for sure.

I ran make CFLAGS="-Wno-error=format-truncation" and that seems to get around the compile warnings so I can create the ngx_http_aws_auth_module.so file.

I also tried the compile command without --with-compat, but I still get the error you have above when running nginx -t.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants