Posts Tagged ‘rhel5’

Upgrading ImageMagick on RHEL5

Friday, November 13th, 2009

Somehow my prior install of ImageMagick, a custom build from source, lacked proper PNG support. A bit of searching uncovered this excellent guide to installing it from a source RPM – but I had a few modifications to those instructions so decided to record my own.

Firstly, I had to uninstall my custom build, so off to the build directory (you should always keep these) to run sudo make uninstall. Or check for any old rpm installs: rpm -qa | grep ImageMagick.

Next, upgrading packages. Some I had, some I didn’t. You’ll need EPEL.

yum --enablerepo=epel --enablerepo=rpmforge install djvulibre-devel libwmf-devel jasper-devel libtool-ltdl-devel librsvg2-devel openexr-devel gcc gcc-c++ ghostscript freetype-devel libjpeg-devel libpng-devel giflib-devel libwmf-devel libexif-devel libtiff-devel

Note there are several deletions from the post I referenced above; I had some dependency conflicts and I removed them.

Next, download this source RPM:

wget http://red.penguin.ro/SRPMS/ImageMagick-6.5.7-0.src.rpm

And build it:

rpmbuild --rebuild ImageMagick-6.5.7-0.src.rpm

Hopefully it will work first time; did for me.

Now you should be able to run:

$ rpm -Uvh /usr/src/redhat/RPMS/x86_64/ImageMagick-6.5.7-0.x86_64.rpm
$ rpm -Uvh /usr/src/redhat/RPMS/x86_64/ImageMagick-devel-6.5.7-0.x86_64.rpm

I skipped all the others since I don’t need them but you might want to add the C++, perl, etc libraries too.

Confirm you’ve got the correct version in your path:

$ convert --version
Version: ImageMagick 6.5.7-0 2009-11-12 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

And now reinstall rmagick:

sudo gem install rmagick

And we’re done!

Installing nginx-gridfs on RHEL5

Thursday, October 8th, 2009

Now, installing on RHEL5. This took a while to work out!

cd ~/src
mkdir nginx_gridfs && cd nginx_gridfs
 
yum install scons boost boost-devel pcre pcre-devel
 
git clone git://github.com/mdirolf/nginx-gridfs.git  
wget http://sysoev.ru/nginx/nginx-0.7.62.tar.gz
tar -zxvf nginx-0.7.62.tar.gz
 
#note my mongo install path; different from on OSX
export MONGO_INCLUDE_PATH=/root/src/mongodb-linux-x86_64-1.0.0/include/mongo/
export LIBMONGOCLIENT=/root/src/mongodb-linux-x86_64-1.0.0/lib64/libmongoclient.a
export BOOST_INCLUDE_PATH=/usr/lib64/
export LIBBOOST_THREAD=/usr/lib64/libboost_thread.so
export LIBBOOST_FILESYSTEM=/usr/lib64/libboost_filesystem.so
 
cd nginx-0.7.62/
 
./configure --add-module=/root/src/nginx_gridfs/nginx-gridfs
make
make install

I’d like to point out that this install was by pure trial and error; a lot of trials, and a lot of errors, since I have no clue whatsoever about C++. The above Works For Me™ but is probably suboptimal and your mileage may vary.

update: it should be noted that this is very early version software; there are bugs and it’s probably not a production option yet. Great potential though, so check it out.

RabbitMQ on RHEL5 x86_64

Thursday, June 25th, 2009

Want to install RabbitMQ on RHEL5 but running into hideous erlang crashes? Chances are it is an issue with dual installations of erlang, one i386 and one x86_64.

Here’s how to fix it:

$ yum erase erlang.i386
$ rm /usr/bin/erl
$ rm /usr/bin/erlc
$ rm /usr/bin/escript
$ ln -s /usr/lib64/erlang/bin/erl /usr/bin/erl
$ ln -s /usr/lib64/erlang/bin/erlc /usr/bin/erlc
$ ln -s /usr/lib64/erlang/bin/escript /usr/bin/escript
$ service start rabbitmq-server
> Starting rabbitmq-server: SUCCESS

Let’s test:

bash-3.2$ irb
>> require 'bunny'
=> true
>> b = Bunny.new
=> #
>> b.start
=> :connected
>> exec "echo YOU WIN"
YOU WIN
bash-3.2$

And as always, remember:

chkconfig rabbitmq-server on

I’m paranoid about chkconfig now!

Switched to PowerDNS

Thursday, June 25th, 2009

I’ve now switched to PowerDNS, running on a MySQL backend, and controllable using the pretty-damn-good .

Reasons for switching:

  • I am sick and fucking tired of editing and backing up countless arcane zone files. It might be “hard core” and “old school” but it’s also annoying as hell, and I can never remember the syntax or forget something stupid like updating the serial, or whatever.
  • A database is the natural storage container for numerous data files of the same syntax and consistent references, and is far more convenient. I can take snapshots of my entire DNS setup, one file, ready to import at a moment’s notice elsewhere.
  • Furthermore, a database is amenable to controlling with a web interface, which is far more convenient (and less prone to error) than ssh’ing in and editing files manually
  • I have one less thing to back up (actually, about 30 less things)
  • BIND has a terrible security record
  • PowerDNS has some neat other features such as dynamic lookup that I am eager to start playing with.

I’ve been considering this for a while, decided to make the jump today. First I got it set up and running perfectly on an unprivileged port; then turned off BIND and turned on PowerDNS. Total downtime: under 5 seconds.

Here are the steps to install on RHEL5:

$ yum install pdns pdns-backend-mysql pdns-backend-pipe pdns-backend-sqlite
# create a mysql user & db "powerdns"
# edit /etc/pdns/pdns.conf to increase port, add gmysql backend and add db credentials
# create the dir to put powerdns-on-rails in, go to it
$ git clone git://github.com/kennethkalmer/powerdns-on-rails.git
# enter DB creds into config/database.yml and create the DB
$ rake db:migrate
$ rake db:seed
# import zone files
# note: you may need to temporarily cp them to /var/named/
$ zone2sql --named-conf=/var/named/chroot/etc/named.conf --gmysql > zones.sql
# import the sql into MySQL via whatever means customary
# start and test powerdns at this point, see the docs
# then revert the port
# add the web app in Apache or whatever you use, log in, bingo
$ service named stop
$ service pdns start
$ chkconfig named off
$ chkconfig pdns on # make sure mysqld is on too ...

There are some more tips if you want to have a look.

Downtime, Upgrade

Wednesday, June 11th, 2008

Apologies for the downtime – I took it upon myself to upgrade this server to RHEL5.

The upgrade went pretty smoothly, taking about 6 hours – although that includes a lot of time copying files around. Some sites on this server aren’t back up yet, as I’m taking the opportunity to modernise a few bits of infrastructure here and there. Also, the media folder is completely missing for now – that will take a long time to copy back from my pathetic DSL.

My main reason for upgrading was difficulties I’d had installing various pieces of software – mostly pretty new stuff. Anyone who’s glanced at the CouchDB mailing list in the last few months will likely remember (with a groan) my epic struggle to get the thing working reliably on RHEL4 – that was a lot of hours splashed to the winds there. I’m delighted to be able to report that installation on this clean, modern server went without a hitch. I consider the time it’s taken me to reinstall “paid for” with that development alone.

Other changes include moving to nginx for Rails hosting, decommissioning SVN once and for all, moving to a new and more logical folder structure, revamping users and permissions, a coming public git repository, and other things I’d been wanting to do for a while but didn’t get round to because of the previous mess.

I’ll be renewing my efforts to hew strictly to RPM-installed packages on this OS. Some source installations are inevitable – Ruby and Erlang, for example, are quite old on the default system/package repo so they have to be installed from source. But everything else I’ll be endeavouring to keep as clean as possible for as long as possible – I want absolutely no repeat of the fucking debacle the js/spidermonkey CouchDB prerequisite install turned into.

In-place upgrades are not my usual cup of tea – I’ve made an exception this time because the hardware is still pretty decent, there were no immediately obvious gains in value to be had upgrading that, and I literally couldn’t do what I wanted to with the previous OS. A hardware upgrade is on the cards, however, and in anticipation of that I’ve kept my most detailed install notes ever – literally every command. What took me 6 or so hours (and counting) should take 1 or 2 next time.

Onwards and upwards, then ..