Welcome! Log In Create A New Profile

Advanced

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

Thomas Ward
January 07, 2021 01:36AM
You should, yes, to make sure your build as closely mirrors what is in
the Fedora repos.


Thomas


On 1/6/21 11:19 PM, Phoenix Kiula wrote:
> Perfect. This is clear Thomas. Much appreciated...between Miguel's
> original pointer and this clarity from you I think it solves what I'm
> looking for. One last question: the `nginx -T` options...I'll add
> those to the ./configure command, yes?
>
>
>
> On Wed, Jan 6, 2021 at 10:55 PM Thomas Ward <teward@thomas-ward.net
> <mailto:teward@thomas-ward.net>> wrote:
>
> This is where **manually compiling by hand** is the problem.  You
> would do the compilation in a separate directory **NOT** inside
> the space of the system's control - usually I spawn new `/tmp`
> directories or destructable directories in my home space.
>
> I'm not familiar with Fedora and the `dnf` command - but `dnf
> install` installs the repositories-available-version of NGINX for
> Fedora's repos.
>
> The next steps you would take by hand are:
>
> (1) Install **all build dependencies and runtime dependencies**
> for NGINX and the modules you're compiling dynamically.
>
> (2) Download the tarball to temporary space.
>
> (3) At the *very* least (though I suggest you go digging in the
> source of Fedora's repos to get their build options, you can find
> them with `nginx -T` output though) you need to do this:
>
> ./configure
> --add-dynamic-module=/path/to/third/party/module/source/directory
> make
>
> **This does not install nginx, this is the compiling of the
> binaries.**
>
> (4) Dig in the completed compile and find your .so file and put it
> in /etc/nginx/modules (I believe that's where it is on your
> system, but I can't validate that - again I'm not a Fedora user so
> I can't verify that's exactly where you drop the module files
> themselves.
>
>
> These're the *basic* steps - but again this will **not** install
> your manually compiled nginx to overwrite what `dnf` installs -
> this simply compiles everything and it's up to you to go digging
> to get the components you need and put them where you need them to
> be for your system to recognize them.
>
>
> Thomas
>
> On 1/6/21 10:47 PM, Phoenix Kiula wrote:
>> Thank you Thomas. Much appreciate this, it sounds promising.
>> Appreciate your clarity.
>>
>> So if I:
>>
>> 1. Compile nginx via `dnf install nginx` and that becomes my
>> system's Nginx, installed usually in `/etc/nginx`
>>
>> 2. In a totally separate folder, say, `/usr/src`, I then download
>> a tarball of Nginx and compile it along with the dynamic modules
>> -- which will produce the .so files for said modules
>>
>> 3. Copy over the modules into the usual `/etc/nginx/modules`
>> folder from Step 1
>>
>>
>> ....in this sequence of steps, how do I make sure that:
>>
>>
>> A. The compilation in Step 2 does not become my "system's nginx"
>> (so when I do an `nginx -v` at the command prompt it should be
>> refer to the nginx installed in Step 1 above, and *not* the one
>> compiled via Step 2)
>>
>> B. The compile in Step 2 will use the "same libraries" that DNF
>> used? In the DNF version of life I didn't pick any libraries
>> manually...DNF found what was on my system. Will the manual
>> compile not do the same?
>>
>> Many thanks!
>>
>>
>>
>>
>> On Wed, Jan 6, 2021 at 10:19 PM Thomas Ward
>> <teward@thomas-ward.net <mailto:teward@thomas-ward.net>> wrote:
>>
>> I'm fairly familiar with the 'compiling process' for dynamic
>> modules - the process is the same for NGINX Open Source as
>> wel as NGINX Plus.
>>
>> You would need to compile the modules alongside NGINX and
>> then harvest the compiled .so files and put them into
>> corresponding locations on the system you want to load the
>> dynamic modules.  In Ubuntu, we do this (or at least, I do)
>> by using the same OS and libraries as installed on the target
>> system (as well as the same NGINX version).
>>
>> This being said, **compiling** NGINX is different than
>> **installing** NGINX - you can *compile* the nginx version
>> 1.18.0 with the dynamic modules and the same configuration as
>> the Fedora version, and then **take the compiled module** and
>> load it up in your installed nginx instance.  Compiling NGINX
>> to make the dynamic module does NOT require you to then
>> install that NGINX version, provided that you match the
>> `make` steps and installed/available libraries to those used
>> in the original nginx compile done in Fedora.
>>
>>
>> Thomas
>>
>>
>> On 1/6/21 5:30 PM, Phoenix Kiula wrote:
>>> Thank you Miguel. But you misunderstood the question. This
>>> suggestion...
>>>
>>> nginx blog as a great guide on it though
>>> https://www.nginx.com/blog/compiling-dynamic-modules-nginx-plus/
>>> https://www.nginx.com/blog/compiling-dynamic-modules-nginx-plus/
>>>
>>>
>>>
>>>
>>> ...misses the very first question in this thread: we cannot
>>> compile nginx from source on our server. At least not in a
>>> way that that compiled version would become the nginx
>>> installed in our *system*. We need to install nginx via the
>>> default Fedora dnf package manager, which at this time
>>> installs 1.18.0.
>>>
>>> Now, what I don't mind doing is to compile nginx in some
>>> self-contained folder somewhere, then use that compilation
>>> to create the .so or whatever the module file for that
>>> version is....if all of this module compiling does *not*
>>> affect the system-installed dnf version of nginx. Is this
>>> possible?
>>>
>>> If so, the instructions do not help with this. The first
>>> step in that official tutorial is to compile nginx and that
>>> compiled nginx then becomes the system's main nginx. It
>>> replaces whatever was installed via "dnf install nginx". Yes?
>>>
>>> Hope this makes sense. Have I correctly understood how nginx
>>> compilation works? Appreciate any pointers.
>>>
>>> Thank you.
>>>
>>>
>>> _______________________________________________
>>> nginx mailing list
>>> nginx@nginx.org <mailto:nginx@nginx.org>
>>> http://mailman.nginx.org/mailman/listinfo/nginx http://mailman.nginx.org/mailman/listinfo/nginx
>>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

pk899 January 05, 2021 07:28PM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

mike-pt January 05, 2021 08:22PM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

pk899 January 05, 2021 11:04PM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

mike-pt January 06, 2021 06:08AM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

pk899 January 06, 2021 05:32PM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

Thomas Ward January 06, 2021 10:20PM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

pk899 January 06, 2021 10:48PM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

Thomas Ward January 06, 2021 10:56PM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

pk899 January 06, 2021 11:20PM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

Thomas Ward January 07, 2021 01:36AM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

pk899 January 07, 2021 08:58PM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

pk899 January 07, 2021 10:40PM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

GreenGecko January 06, 2021 10:54PM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

mike-pt January 07, 2021 04:44AM

Re: Installing dynamic modules when Nginx itself is installed via yum/dnf (Linux)

Francis Daly January 11, 2021 04:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 241
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready