I installed nginx 1.10.2 to my RHEL 7 server using yum from epel repo:
$ sudo yum install epel-release
$ sudo yum install nginx httpd-tools
Now I want to add ldap authentication. I found this from a github search: https://github.com/kvspb/nginx-auth-ldap
However, from the instructions, it needs to add the module via configure and make commands on the nginx sources, which I believe I don't have access to.
Does this mean I need to re-install nginx from source ? Is there any other way ?
Until release 1.9.11 all nginx modules, including the 3rd party modules, had to be compiled statically into nginx. Unlike Apache nginx had no support for dynamically loading modules. So every time you wanted to add a new module, you had to recompile nginx.
nginx 1.9.11 introduced the
load_module
directive but not all modules have or can even be converted to dynamic modules yet. And a lot of existing documentation still reflects that.The nginx-auth-ldap
config
looks to have the right syntax to work as a dynamic module, it is then more a question of whether or not the nginx package maintainers for EPEL provide a ready made RPM that offers nginx-auth-ldap and if they don't you will need to compile the module yourself.BTW You can install the SRC rpm package get access to the sources and SPEC files used to make the binary nginx RPM
I ended up re-installing NGINX from source and added the nginx-auth-ldap module at compile time. I found a very helpful how-to here: http://www.ehowstuff.com/how-to-install-nginx-on-centos-7-rhel-7/ I simply added the nginx-auth-ldap module to the ./configure command and it was correctly added at compile time. I'm up and running now ! :-)
A few lessons learned from the experience: