Varnish: varnishhist/varnishtop: error while loading shared libraries: libvarnishapi.so.1: cannot open shared object file

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, November 25, 2011

Follow me on Twitter as @mattiasgeniar

This isn’t actually a Varnish problem, it’s most likely just your system not having an up-to-date linker to point to your correct modules.

You’ll see this when trying to run varnishhist or varnishtop:

e>

It’s usually as simple as running ldconfig:

# ldconfig

If you have Varnish installed in some obscure location, you may have to add that location manually first.

# ldconfig -n /usr/local/lib/

If that still doesn’t work, make sure you installed it correctly with the correct packages as dependency (Varnish won’t tell you these have been missed during configure & make).

# apt-get install libpcre3-dev libncurses3-dev automake autoconf libtool

And don’t forget to run ‘make clean’ before you try to reconfigure.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.