-2
  • Debian 9.5
  • Apache HTTP Server 2.4.34 (httpd)

After installing Apache from the official page with sudo make install, I want to check that the installation works starting the server:

$ sudo /usr/local/apache2/bin/apachectl -k start

But I get an error

/usr/local/apache2/bin/httpd: symbol lookup error: /usr/local/apache2/bin/httpd: undefined symbol: apr_crypto_init

Is the error related to the subject of libraries? What could it be?

The configuration that I made during the installation was:

$ sh configure --prefix /usr/local/apache2

If you need to attach screens, logs or installed libraries update the post to have more details.


SOLUTION

I rebuilt httpd with a prefix of /usr/local

$ sh configure --prefix /usr/local
$ sudo make install
$ sudo /usr/local/bin/apachectl -k start

I recommend returning to the initial state of the virtual machine, so there are no residual libraries and files.

  • 1
    Is there a particular reason you didn't user the packaged version of apache via apt? – slm Jul 23 '18 at 10:56
  • I was following a tutorial (subdomain for jira software) which redirected me to a new page with the Apache documentation, and from that page I accessed the download. I did not know I could do it via apt. How should I do it? – IT Developers Jul 23 '18 at 11:42
  • 1
    I believe you can do an apt-get install apache2 to get this installed in Debian. There are many tutorials for this. I'm not versed in Debian but this looks promising - linode.com/docs/web-servers/apache/apache-web-server-debian-8. – slm Jul 23 '18 at 11:44
  • 1
    It looks like you have already verified that it does not work. – ctrl-alt-delor Jul 23 '18 at 12:09
  • Some things to consider: install with apt-get (already mentioned), use stow to combine self-builds into /usr/local, use docker, to have a self contained server (May be a newer version, can be from any distro, can be self-built). – ctrl-alt-delor Jul 23 '18 at 12:15
0

Yes, the error (probably) relates to libraries. I suspect that since you gave configure a prefix of /usr/local/apache2, the libraries built for httpd ended up in /usr/local/apache2/lib, which the dynamic linker doesn’t know about.

There are a number of ways to fix this:

  • Use the package instead, it will make your life easier in the long run:

    sudo apt install apache2
    

or

  • Add /usr/local/apache2/lib to the dynamic linker’s configuration; create a file, /etc/ld.so.conf.d/apache2-local.conf, containing the single line

    /usr/local/apache2/lib
    

    and run sudo ldconfig.

or

  • Rebuild httpd with a prefix of /usr/local, so that its binaries end up in /usr/local/bin and its libraries in /usr/local/lib.

(By the way, you don’t need to run configure as root, and you shouldn’t — configure and build as a plain user, and only install as root.)

  • The 3rd option works – IT Developers Jul 24 '18 at 6:26
  • What is the difference between using PREFIX = /usr/local or resolving this with a dynamic linker's configuration? – IT Developers Jul 24 '18 at 7:08
  • Setting the prefix to /usr/local means that the libraries end up installed in a directory the linker already knows about, so it doesn’t need any configuration. Setting it to /usr/local/apache2 means that the libraries end up in a directory the linker doesn’t know about, so it needs to be told about it before it can use it. – Stephen Kitt Jul 24 '18 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.