You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Bjoern Voigt <bj...@arcor.de.INVALID> on 2023/04/01 10:06:24 UTC

Re: [users@httpd] Apache static compile

On 29.03.23 18:49, Chris me wrote:

> Thanks, unfortuanetely those options made no difference at all, the same things are still dynamically linked.
> At the very least I figured I can make due with only have the SSL library statically linked but I have tried -with-ssl=path (as per my other email).

I think, the first problem is to find a Linux distribution which still 
contains static versions of all needed libraries. For instance my 
distribution, openSUSE Tumbleweed, does only contain very few static 
libraries. All other libraries are dynamic. This is documented in the 
"openSUSE:Shared library packaging policy":

    "Avoid packaging static libraries. You should use --disable-static
    configure option or, as a last resort, remove static libraries after
    make install. If in doubt, ask."

Source: https://en.opensuse.org/openSUSE:Shared_library_packaging_policy

With such distributions it is impossible to build a fully static Apache 
server.

Björn


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Apache static compile

Posted by Chris me <ph...@hotmail.com>.
I have tried that, but I still get this when making:

ab.c:(.text+0x66b5): undefined reference to `TLSv1_1_client_method'
ab.c:(.text+0x66dd): undefined reference to `TLSv1_2_client_method'

which tells me it is still using the old system openssl libraries and not the location of the new one.

I have tried all of these:
--with-ssl=../openssl-1.1.1t \
            --enable-ssl \
            --enable-speling=shared \
            --enable-rewrite=shared \
        --enable-ssl-staticlib-deps \
        --enable-mods-static=ssl \
        --enable-compat

But when trying to make it is appears to still use the old ssl library on the system.

-----Original Message-----
From: Rainer Canavan <ra...@avenga.com.INVALID> 
Sent: Wednesday, April 12, 2023 12:01 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Apache static compile

On Wed, Apr 12, 2023 at 1:49 AM Chris me <ph...@hotmail.com> wrote:
>
> Basically I am trying to run a later version of apache that supports the newer TLS alongside a much older version. I know it is better to upgrade the server, etc. but that is not an option for the legacy server.
>
> I basically need a completely stand alone version of httpd so I don’t have to worry about upgrading the server libs and current openssl version.

set an installation path with
--prefix=/usr/local/completelyseparatehttpd and LDFLAGS=-Wl,-rpath,/usr/local/completelyseparatetlslibrary when you configure your httpd and you should be done.

rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: [users@httpd] Apache static compile

Posted by Rainer Canavan <ra...@avenga.com.INVALID>.
On Wed, Apr 12, 2023 at 1:49 AM Chris me <ph...@hotmail.com> wrote:
>
> Basically I am trying to run a later version of apache that supports the newer TLS alongside a much older version. I know it is better to upgrade the server, etc. but that is not an option for the legacy server.
>
> I basically need a completely stand alone version of httpd so I don’t have to worry about upgrading the server libs and current openssl version.

set an installation path with
--prefix=/usr/local/completelyseparatehttpd and
LDFLAGS=-Wl,-rpath,/usr/local/completelyseparatetlslibrary when you
configure your httpd and you should be done.

rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Apache static compile

Posted by Chris me <ph...@hotmail.com>.
Basically I am trying to run a later version of apache that supports the newer TLS alongside a much older version. I know it is better to upgrade the server, etc. but that is not an option for the legacy server.

I basically need a completely stand alone version of httpd so I don’t have to worry about upgrading the server libs and current openssl version.




-----Original Message-----
From: Rainer Canavan <ra...@avenga.com.INVALID> 
Sent: Tuesday, April 11, 2023 3:41 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Apache static compile

On Sat, Apr 8, 2023 at 11:22 PM Chris me <ph...@hotmail.com> wrote:
>
> Right. Is there an option to compile Apache using a non-standard 
> location for dynamic libs? IE instead of /usr/lib it could use 
> /usr/lib/custom
>
> I was not able to find anything other than using an ELF patcher to try and change the paths directly in the httpd binary file, but not sure how that would turn out.

Those are usually configured during link time, i.e. via LDFLAGS. It's not entirely clear what you want, and the are at least a dozen rules how the various options interact, so I'd recommend you check the man page for your system's runtime linker (probably man ld). Normally, you'l just pass -Wl,-rpath,/your/lib/search/path, but maybe you want to mess with DT_RUNPATH, DT_RPATH or SEARCH_DIR.

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: [users@httpd] Apache static compile

Posted by Rainer Canavan <ra...@avenga.com.INVALID>.
On Sat, Apr 8, 2023 at 11:22 PM Chris me <ph...@hotmail.com> wrote:
>
> Right. Is there an option to compile Apache using a non-standard location for dynamic libs? IE instead of /usr/lib it could use /usr/lib/custom
>
> I was not able to find anything other than using an ELF patcher to try and change the paths directly in the httpd binary file, but not sure how that would turn out.

Those are usually configured during link time, i.e. via LDFLAGS. It's
not entirely clear what you want, and the are at least a dozen rules
how the various options interact, so I'd recommend you check the man
page for your system's runtime linker (probably man ld). Normally,
you'l just pass -Wl,-rpath,/your/lib/search/path, but maybe you want
to mess with DT_RUNPATH, DT_RPATH or SEARCH_DIR.

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Apache static compile

Posted by Chris me <ph...@hotmail.com>.
Right. Is there an option to compile Apache using a non-standard location for dynamic libs? IE instead of /usr/lib it could use /usr/lib/custom

I was not able to find anything other than using an ELF patcher to try and change the paths directly in the httpd binary file, but not sure how that would turn out.


-----Original Message-----
From: Bjoern Voigt <bj...@arcor.de.INVALID> 
Sent: Saturday, April 1, 2023 3:06 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Apache static compile

On 29.03.23 18:49, Chris me wrote:

> Thanks, unfortuanetely those options made no difference at all, the same things are still dynamically linked.
> At the very least I figured I can make due with only have the SSL library statically linked but I have tried -with-ssl=path (as per my other email).

I think, the first problem is to find a Linux distribution which still contains static versions of all needed libraries. For instance my distribution, openSUSE Tumbleweed, does only contain very few static libraries. All other libraries are dynamic. This is documented in the "openSUSE:Shared library packaging policy":

    "Avoid packaging static libraries. You should use --disable-static
    configure option or, as a last resort, remove static libraries after
    make install. If in doubt, ask."

Source: https://en.opensuse.org/openSUSE:Shared_library_packaging_policy

With such distributions it is impossible to build a fully static Apache server.

Björn


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org