Keep [C]*(od|do)ing

June 15 th

10

Save Subversion Server on BlueHost

Filed under: Tools, software — Tags: , — Liwen @ 2:30 pm

The first command I typed in Emacs this morning was “svn up“. Two seconds later, the unexpected unwelcome stranger “svnserve: error while loading shared libraries: libpq.so.3: cannot open shared object file: No such file or directory” popped into my screen, I felt my heart jumped up into my throat and my blood pressure went up a bit. This is no good***@#^& :–(

Checked on BlueHost support site and was informed that they have upgraded PostgreSQL and have recompiled Apache. I suppose I couldn’t ask BlueHost tech support regarding the issue since Subversion is not something included in the hosting package.

Found this thread on Google suggesting to ‘rebuild apt-util’ but without giving any solution, so I decided to roll my sleeves and solve the problem on my own.

Here was my installation hosting environment:
1. Bluehost 64bit box
2. subversion 1.5.5

And here is how I installed subversion in the first place, you may want to check this post (referring as post #1 form now on) first as the following steps are partially in the same context with it.

Failed trying to reconfigure

Tried to install all subversion dependencies downloaded in post #1, it ignores the installation and says the libraries have been installed.
Tried to reconfigure and link, got lots of ‘cannot read symbols‘ error. One of the errors seems to be version related problem which I encountered before while doing apache upgrading.

I guess I may need higher version of apr and apr-util and hope they will still work with subversion 1.5.5, otherwise I’ll have to upgrade my svn on the server as well.

Download apr and apr-util

cd src
wget http://www.apache.org/dist/apr/apr-1.3.5.tar.gz
wget http://www.apache.org/dist/apr/apr-util-1.3.7.tar.gz
tar -xzvf apr-1.3.5.tar.gz
tar -xzvf apr-util-1.3.7.tar.gz

Install apr

cd apr-1.3.5
./configure --enable-shared --prefix=$HOME LDFLAGS="-L/lib64"
make && make install

Install apr-util

cd ../apr-util-1.3.7
./configure --enable-shared --prefix=$HOME --with-apr=$HOME --without-berkeley-db LDFLAGS="-L/lib64"
make && make install

Install neon

Since neon depends on apr and apr-util, I’d better reinstall it as well, tried to install the neon comes with subversion-dep-1.5.5.tar.gz and this time it succeeded, great!

cd ../subversion-1.5.5/neon
EXTRA_CFLAGS="-L/lib64 -fPIC"
CFLAGS="-L/lib64 -fPIC"
./configure --prefix=$HOME --enable-shared LDFLAGS="-L/lib64" --with-libs=$HOME
make && make install

Reinstall Subversion

cd ..
./configure --prefix=$HOME --without-berkeley-db --with-apr=$HOME --with-apr-util=$HOME --with-neon=$HOME -without-apxs --without-apache
make && make install

Something you might want to know if you are going to follow my steps to save your svn server on BlueHost. As the information in this weblog is provided “AS IS” with no warranties : )

1.Check your BlueHost hosting environment (32 bit or 64 bit)
2.Check your subversion version (a new repository schema has been introduced since version 1.4.?, you may want to download all repositories and upgrade them locally)
3.Backup all repositories.
4.If you are not sure about what those steps are all about please do read post #1, don’t replicate them blindly – for your server’s safety, although BlueHost backs up your home directory in daily and weekly intervals.
5.There might be a better solution beyond my knowledge and you can wait for someone to find out – I am just a brave armature :)

10 Comments »

  1. Awesome work. Wish I would have found this 2 days ago when they did the update. Was pulling my hair out. I ended up reinstalling svn with the newest version and installing apr –without-pgsql to hopefully prevent it in the future.

    Comment by Kev — June 15, 2009 @ 8:18 pm

  2. I followed your steps but the last “make install” for subversion gave the same error libpq.so.3 not found or something. Any hints?

    Comment by braddcadd — June 19, 2009 @ 12:54 am

  3. @Braddcadd
    1. Delete the stale subversion source folder completely ( which should has neon inside )
    2. Decompress the subversion and svn dependency packages and configure -> make && make install, the reason is that if you use previously linked/compiled source, it would always refer to the old libraries even after you have recompiled it.
    3. If it still fails, delete all dirty source code and try to do it from scratch (apr, apr-util, neon then svn).

    Comment by Liwen — June 19, 2009 @ 6:47 am

  4. during install apr-util, ./configure warned about option –enabled-shared

    Comment by Harsha Master — June 21, 2009 @ 11:15 am

  5. @Harsha:
    Actually I’ve noticed that warning too, but I don’t remember seeing it last time. It’s just a harmless unrecognized option. Hey, real programmers don’t care warnings, do they :-)

    Comment by Liwen — June 22, 2009 @ 9:14 am

  6. Excellent. Thank you so much for taking the time to document your findings.

    Comment by Vinh — July 2, 2009 @ 7:22 am

  7. If you do a clean wipe of the src how do you reconnect to the old SVN repos. I am a SVN admin nub

    Comment by oopsIDiditagain — July 2, 2009 @ 8:44 pm

  8. @oopsIDiditagain:
    Hi, just need to wipe the dirty package source out, never ever delete your repositories :O Since svn uses the same repos schema since 1.4, no changes need to be made to the repos, just use the same connection (I assume you did not put repos directories in your temporary src folder, if so I’d suggest that you move them to a dedicated safe folder and change repos urls accordingly.)

    Comment by Liwen — July 3, 2009 @ 9:29 am

  9. thank you. works perfectly.

    Comment by winrich — July 11, 2009 @ 6:57 am

  10. Thank you! This just saved my life

    Comment by Mateo — January 12, 2010 @ 6:24 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by Wordpress | All rights reserved, all wrongs observed. @ 2009 Liwen Zhang (17 queries. 0.302 seconds.)