Building Varnish on RedHat Enterprise Linux 4.0 (RHEL4)

We’re switching to Varnish as our reverse proxy service (and leaving mod_proxy under Apache), and as our web frontends still run RHEL4, there was a few small things that crept up while attempting to build Varnish from source (the supplied RPM packages are only for RHEL5).

You’ll need to have the pcre packages installed:

pcre pcre-devel

When running configure you might still get a notice about pcre not being available:

checking for PCRE... no
configure: error: Package requirements (libpcre) were not met:

Package libpcre was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpcre.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libpcre' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables PCRE_CFLAGS
and PCRE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

You can solve this by setting the PCRE_CFLAGS and PCRE_LIBS environment variables:

export PCRE_LIBS="-L/usr/lib -lpcre"
export PCRE_CFLAGS=-I/usr/include/pcre

Re-run configure and run make, and things should hopefully build properly.

6 thoughts on “Building Varnish on RedHat Enterprise Linux 4.0 (RHEL4)”

  1. Hi ,

    I am getting below error after running make command

    ./.libs/libvarnishapi.so: undefined reference to `pcre_free_study’
    collect2: ld returned 1 exit status
    make[4]: *** [vjsn_test] Error 1

  2. That sounds like an issue with the version of your pcre library and what varnish expects, or you don’t have the correct pcre library installed at all.

  3. Thanks Mats . This issue is resolved by exporting PKG_CONFIG_PATH variable such as export PKG_CONFIG_PATH=/opt/software/pcre/lib/pkgconfig/
    But now I am facing below error . Can you please help . I have already installed python 2.7 . And ran yum install python-docutils . But its says No package python-docutils available.

    checking for rst2man… no
    checking for rst2man.py… no
    configure: error: rst2man is needed to build Varnish, please install python-docutils.

Leave a Reply

Your email address will not be published.