BerkeleyDB (install for OpenLDAP)

I’m trying to install BerkeleyDB 4.5.20 but I need to configure the install directory to be something other than /usr/local which of course won’t work. Can someone help me? The install instructions from Oracle are beyond what I understand.

Ultimately I want to install OpenLDAP, which hiccups on configure as it’s not happy with the version of BerkeleyDB installed on my machine.

I just installed BerkeleyDB 4.5, 5.1 and 6.0 but in a VPS, noway to do it in a shared hosting as far as i found (you get your process killed if you try to compile or do intensive stuff).