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 :)

February 14 th

2

Install Subversion 1.5.5 on Bluehost 64bit Box

Filed under: Tools, software — Tags: , , — Liwen @ 11:55 pm

The first thing I do before start typing code at home is to put it under version control system; the first thing I tried to do when had a SSH enabled reliable hosting, of course, was to set up Subversion server on it.

There are already several tutorials in the Internet, why I am writing this again? Well, I just wanted to prove that I too, can write blog! Among all those tutorials, none of them worked for me, I guess either I was trying to install the newest version of SVN or the BlueHost hosting environment has changed, or they just hate me. So I am constructing this and hope to contribute something I learned along the frustrating process of setting up SVN on 64bit shared hosting so you don’t need to smash your keyboard.

Once you enabled SSH on BlueHost control panel with a photo ID, it’s time to set up Subversion.

1. Open a terminal, type in:
ssh username@yourdomain.com
and hit enter, then input your hosting password.

2. It’s better to create a separate folder for all the operations, in case our home directories got messed up by any mistakes.

mkdir src
cd src

3. Download Subversion and dependencies:

wget http://subversion.tigris.org/downloads/subversion-1.5.5.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.5.5.tar.gz
tar -xzvf subversion-1.5.5.tar.gz
tar -xzvf subversion-deps-1.5.5.tar.gz
cd subversion-1.5.5

4. Install apr and apr-util, notice the var LDFLAGS , it’s 64 bit, it’s m-A-g-I-c.

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

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

5. Install neon, I had been stuck here for an hour because of the 64 bit mode problem, remember to explicitly enable compilation of shared libraries and prefix the files into home directory.

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

6. Install Subversion, pass --without-apxs and --without-apache to prevent svn installing Apach modules, also you need to explicitly specify the dependencies.

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

7. Modify .bash_profile and .bashrc file

nano -w .bash_profile (pico is always my favourite.)
add $HOME/system/bin to PATH variable, it should look like this:
PATH=$PATH:$HOME/bin:$HOME/system/bin
Also add this line to your .bashrc file, after the ‘fi
PATH=$PATH:$HOME/bin

8. Logout the current session and log on again, let’s try:
mkdir ~/repos
cd repos
svnadmin create topsecrets007plus

now you can access your repository like this:
svn+ssh://username@host/home/username/repos/topsecrets007plus/
just replace username with your 8-character user name given by BlueHost.

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