Re: Apache static compile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28.03.23 00:14, Chris me wrote:

Hi, I hope this is an OK question.

I have a need to build apache with all libraries statically linked and included in the httpd executable.

Is this possible?

In https://serverfault.com/a/715193 you will find the answer, to use "configure --disable-shared", but this option is not available in newer Apache servers.

Now you have multiple "static link" options. See

# httpd-2.4.56/configure --help
[...]
  --enable-mods-static=MODULE-LIST
                         Space-separated list of static modules to enable |
                         "all" | "most" | "few" | "reallyall"
[...]
  --enable-so             DSO capability. This module will be automatically
                         enabled unless you build all modules statically.
[...]
  --enable-ssl-staticlib-deps
                         link mod_ssl with dependencies of OpenSSL's static                          libraries (as indicated by "pkg-config --static").
                         Must be specified in addition to --enable-ssl.
[...]
  --enable-static-support Build a statically linked version of the support
                         binaries
[...]
  --enable-jansson-staticlib-deps
                         link mod_md with dependencies of libjansson's static                          libraries (as indicated by "pkg-config --static").
                         Must be specified in addition to --enable-md.
[...]

I tried this on openSUSE Tumbleweed, but for the most libraries the configure scripts does not find static libraries. So the resulting "httpd" has a lot of dynamic dependent libraries.

./configure   --enable-mods-static=all --disable-so --enable-ssl-staticlib-deps

ldd targetdir/bin/httpd
linux-vdso.so.1 (0x00007ffd6d7c9000)
       libssl.so.3 => /usr/lib64/libssl.so.3 (0x00007fc06e81c000)
       libcrypto.so.3 => /usr/lib64/libcrypto.so.3 (0x00007fc06e200000)
       libjansson.so.4 => /usr/lib64/libjansson.so.4 (0x00007fc06e80b000)
       libcurl.so.4 => /usr/lib64/libcurl.so.4 (0x00007fc06e75e000)
       [...]

Björn


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux