skip main content

Posts Tagged ‘centos’

Installing daemontools on CentOS5 x86_64

posted by Duncan at 9:43 pm on November 4th, 2008

[UPDATE] It turns out you need to apply the patch below on any recent Linux distribution, not just 64 bit architectures, if that helps anyone.

More head scratching, web searching, friend asking, and huzzah, finally solved. How to actually install daemonstools on my SliceHost CentOS5 slice. The catch for me was that it wouldn’t compile because ‘it required a patch‘. Who’d of known? So here’s my notes:

$ sudo mkdir -p /package
$ sudo chmod 1755 /package/
$ cd /package/
$ sudo wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
$ sudo tar xzf daemontools-0.76.tar.gz
$ sudo wget http://www.qmail.org/moni.csi.hu/pub/glibc-2.3.1/daemontools-0.76.errno.patch
$ cd admin/daemontools-0.76
$ sudo patch -p1 < ../../daemontools-0.76.errno.patch
$ sudo rm ../../daemontools-0.76.errno.patch ../../daemontools-0.76.tar.gz
$ sudo ./package/install
...
...
Adding svscanboot to inittab...
init should start svscan now.

Installing Python’s Twisted on CentOS5 x86_64

posted by Duncan at 10:43 am on October 26th, 2008

I had to do a bit of searching to find the correct way to install Twisted on a 64 bit CentOS 5 machine, like the one I have via virtual hosting with SliceHost. But once I had the answers it was very actually very simple, so this should save you the same headache.

I was having an import problem with Twisted’s subpackages, and was also initially having a problem building the lib from source. The first problem was caused by the fact that 64 bit CentOS installs things in both /usr/lib and /usr/lib64 which confuses Twisted, as it expects things in the same directory. The final problems was due to me trying to compile Twisted without the python-devel lib and the Twisted Zope Interfaces which is a dependancy.

So to install, run these commands:

$ sudo yum install python-devel python-crypto pyOpenSSL zope
$ mkdir src;cd src
$ wget http://tmrc.mit.edu/mirror/twisted/Twisted/8.1/Twisted-8.1.0.tar.bz2
$ tar jxvf Twisted-8.1.0.tar.bz2
$ cd Twisted-8.1.0
$ sudo python setup.py install --install-lib /usr/lib64/python2.4

Bingo, and you should now be able to test with:

$ python
...
>>> import twisted
>>> import twisted.web

The lines above should give you no output.

Installing MySQL gem on CentOS

posted by Duncan at 10:20 am on October 13th, 2008

Old news, but you’d be surprised how many times the same:

Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.
...

error brings everything to a halt. Well on Centos the way to install the MySQL gem is:

$ sudo yum install mysql mysql-devel gcc
...
 
# 32 bit machine
$ sudo gem install mysql -- \
> --with-mysql-include=/usr/bin/mysql \
> --with-mysql-lib=/usr/lib/mysql
 
# or 64 bit like they are on SliceHost
$ sudo gem install mysql -- \
> --with-mysql-include=/usr/bin/mysql \
> --with-mysql-lib=/usr/lib64/mysq
 
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
1 gem installed
...

Setting the timezone on CentOS

posted by Duncan at 12:51 pm on October 1st, 2008

I forget this pretty much all the time, even though it’s a fairly simple operation. There are loads of timezone data files stored in:

/usr/share/zoneinfo

So for my CentOS install, to set my machine to London time, I use:

#
# this is not correct for me
#
$ date
Wed Oct  1 07:43:58 CDT 2008
#
# to fix it
#
$ sudo rm /etc/localtime
$ sudo ln -s /usr/share/zoneinfo/Europe/London /etc/localtime
#
# now check it's ok
#
$ date
Wed Oct  1 12:42:33 GMT 2008

I imagine this works on Redhat and Fedora as well, but I can’t be sure on other Linux distros.


back to the top