0

I need to build an apache httpd server that will be able to run under multiple linux os (RH, SUSE, e.t.c.)

The main problem is that httpd is using shared libraries:

ldd httpd/bin/httpd
    linux-vdso.so.1 =>  (0x00007fff955fe000)
    libexpat.so.1 => /lib64/libexpat.so.1 (0x00007fec3df54000)
    librt.so.1 => /lib64/librt.so.1 (0x00007fec3dd4c000)
    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fec3db14000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fec3d8f7000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fec3d564000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fec3e183000)
    libfreebl3.so => /lib64/libfreebl3.so (0x00007fec3d301000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007fec3d0fd000)

On 1 of the servers this is causing httpd to fail because of old glibc package:

ldd httpd 
./httpd: /lib64/libc.so.6: version `GLIBC_2.10' not found (required by ./httpd)
./httpd: /lib64/libc.so.6: version `GLIBC_2.9' not found (required by ./httpd)
    libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00002b1e6b55d000)
    librt.so.1 => /lib64/librt.so.1 (0x00002b1e6b680000)
    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002b1e6b789000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b1e6b8c3000)
    libc.so.6 => /lib64/libc.so.6 (0x00002b1e6b9dc000)
    /lib64/ld-linux-x86-64.so.2 (0x00002b1e6b441000)

Updating glibc on the system is not an option unfortunately.

Is there a correct way of compiling apache httpd with static libraries?

4
  • 8
    It's not very likely that you need to do this. What are you really trying to accomplish? Mar 27, 2013 at 15:29
  • I'm trying to create a package that will be persistent across multiple servers with different OS.
    – user166655
    Mar 27, 2013 at 15:50
  • 1
    That's clear enough. What's not clear is why. On its face, this is "doing it wrong". Mar 27, 2013 at 15:52
  • I needed to do this, in order to obtain a standalone copy of the 'ab' test utility.
    – Ed Randall
    Sep 24, 2019 at 13:11

2 Answers 2

4

Building a static version of httpd requires usage of a legacy configure flag "--disable-shared" with "./configure". http://www.gossamer-threads.com/lists/apache/users/360330

3

I need to build an apache httpd server that will be able to run under multiple linux os (RH, SUSE, e.t.c.)

No you don't. You have a problem that you're trying to solve by static linking. Static linking is a horrible solution from the previous century and should not be done anymore. Please try to find a different way of solving your actual problem.

9
  • So basically you are saying that I don't have another option, but to update every OS on every server? And if I don't have the possibility to do that?
    – user166655
    Mar 27, 2013 at 15:54
  • @user166655, keeping servers (Internet-facing ones at that) without careful management (which, inter alia, includes rigurous updating) is just irresponsible. And if there are several, it isn't that you can't install e.g. CentOS for free. Uniform operating system across the board means less headaches (including what you are trying to do).
    – vonbrand
    Mar 27, 2013 at 15:58
  • If you don't have the possibility to do that, you'll need to explain why, as that's highly suspicious. But yes, stick to distro-provided packages as much as possible and always update for security patches. Mar 27, 2013 at 16:22
  • This package I'm creating will be used only locally on servers that are not open to internet. Package installation and os upgrade is highly complicated and will take quite a long time, that is why I was looking for a quick and better solution.
    – user166655
    Mar 27, 2013 at 16:41
  • What's highly complicated about 'yum update'? Or even just 'yum update httpd'? It's far more complicated to keep your server secure with a statically compiled apache. Security doesn't end at the internet facing part of your network. Somebody could penetrate that and proceed from there, or an internal person could decide to do something malicious. Mar 27, 2013 at 16:47

Not the answer you're looking for? Browse other questions tagged .