Thursday, 13 January 2011

Bacula - Building from source

I like Bacula! - I'm no expert, but I am trying to become one. I'm getting my head around how this project works, and this blog entry will help me, and others.

Just to note, I am running CentOS 5.5 64 bit edition, and 32 bit edition

It's pretty neat when you think about it. It does what it says on the tin. Once configured, Bacula goes about backing up all your data without you noticing. Nice.

The first hurdle is compiling it. This is my experience, (well, one of them) - (Disclaimer: I must make it clear, that I read through a number of sites, and have just put down my notes in this guide that I took from those sites, as well as my own knowledge.

I have to compile my own RPMS so that I can have the latest code, and because I'm running CentOS, which doesn't have 5.0.3

So, first start by installing all the prerequisites:

# sudo yum install mysql-devel rpm-build libX11-devel libXext-devel GConf2-devel freetype-devel libtermcap-devel shadow-utils gcc gcc-c++ make autoconf glibc glibc-devel ncurses ncurses-devel perl  readline-devel libstdc++-devel zlib-devel openssl-devel libacl-devel pkgconfig tcp_wrappers openssl-devel fontconfig-devel libpng-devel openssl fontconfig libgcc libpng libstdc++ zli

Now you should have no problems later on. You need a build environment. I usually create a user called "builder" on the target machine.

# sudo useradd builder
# su builder

And now I can build packages in a safe environment, as a non privileged user. Mr Builder, needs to have a build environment.

# echo "%_topdir /home/${USER}/redhat/" > ~/.rpmmacros
# mkdir -p ~/redhat/{BUILD,RPMS/{i386,i686,noarch},SOURCES,SPECS,SRPMS}

And voila - build environment. Now, at this point, you are ready to build, but to build we need sources. The sources can be found on sourceforge. At the time of writing this was the latests source could be found From here, you need to download

# cd /tmp
# wget
# wget
# wget
# wget

Now we can begin:

# rpmbuild --rebuild --define "_vendor redhat" --define "build_mysql 1" --define "build_centos5 1" ./bacula-5.0.3-1.src.rpm

# rpmbuild --rebuild --define "_vendor redhat" --define "build_mysql 1" --define "build_centos5 1" ./bacula-bat-5.0.3-2.src.rpm

# pmbuild --rebuild --define "_vendor redhat" --define "build_mysql 1" --define "build_centos5 1" ./bacula-docs-5.0.3-1.src.rpm

# rpmbuild --rebuild --define "_vendor redhat" --define "build_mysql 1" --define "build_centos5 1" ./bacula-mtx-5.0.3-1.src.rpm

This will create the RPMS, in the following directory,


which has seperate folders for x86_64 i386, and i686, pick the right one for your system, (I built on a x86_64 system, so I found the RPMS there). I'm 70% sure that there is a way to compile for all architectures at the same time, or at least on the same machine, I'm looking into that, and I'll update in due course.

Well, feel free to comment, and point out my mistakes and I'll update :)

Sunday, 9 January 2011

Smooth Sailing with CentOS

My brand new server arrived in the office 2 weeks ago, along with my new hard drives, 4 1.5TB disks, ready to go into a RAID 10 configuration. I had a few problems getting CentOS installed onto the box, the PERC H200 controller needed to have it's firmware updated, which meant having to install windows 2003 just to run the utilities, (because someone at the dell factory... forgot!)

It didn't take long to install windows, (I have acronis enterprise edition, took about 15 minutes) and update the firmware, and install CentOS. So far so good!

I install CentOS with no extra packages, and try and be as bare bones as possible, just as a general rule.

I run a combination of windows and linux desktops for personal use in and around the office, and I use SSH across all platforms. One windows, I use a client called Tunnilier, it's fast and has support for port forwarding, x-11 forwarding, using keys for SSH login, sftp built in, it's pretty neat. I would advise all linux fanatics who find themselves having to live on windows, to get this client!

As I do with all new installs of CentOS,
yum install -y && reboot
A bit risky, I know, but if it breaks now before it enters testing, then I find that much better, than breaking in production. All the packages update, and I install my favorite combo for virtualisation and managing that virtualisation
yum install xen virt-manager xauth -y
I would not generally advise people to use the -y switch when it comes to installing stuff, unless your very sure you know what packages are coming your way. Basically, for me, I've done this install a good few times, but every sys admin should take their own advice!

These are my my first blog posts, so if they are not complete, or if I should edit them, feel free to comment.

Friday, 7 January 2011

Day One!

Not sure what to call this, so I called it Day One. It's not really day one, been in this position for a long time, but it's day one for this blog.

Currently, I have a whole bunch of servers up and running doing the following:

3 Domain Controllers, 2 DNS servers , 3 Exchange Servers, a PPTP Server, a File Server, an Application Server and a Terminal Server.

These guys are all currently hosted over a mixture of five virtualisation servers, running either XEN, on Centos, or VMware ESX Servers.

While this is a pretty sweet setup - I've decided to 'rotate' my servers. During the installation and setup of this site, it was pretty adhoc. Applications installed and removed, systems configured with more resources than needed. I want to clean up the domain, to make it as efficient as possible.

I've got hold of a new machine - Which will serve as the starting point to allow me install my 'perfect' network. This is just my opinion, and I would welcome input along the way. (If anyone reads this!)

So, my first decision -
What will be the base for my new server?
I pick Centos, so that I can use xen to host the new machines of the domain. Reason? I've been using it for years, and I know it, and I can get it up and running pretty quickly. Feel free to comment if you feel otherwise :)

Well, I got to get cracking, so I'll see you on the other side.