Friday, April 5, 2013

gnome 3 sucks, and so does kde

And I am going to stick with Linux Mint 14 codenamed Nadia. Pretty decent of them to keep Gnome 2 which I think they may have somewhat forked it from GNOME, and they call it NATE or was it? I'm in no way very good with names, except for pretty looking colourful pictures.

Compiling rpm for httpd on RHEL 5.7

I have had the pleasure of knowing that I (possibly) will be deploying the Apache Web server (httpd) version 2.2.22 on a Red Hat Enterprise Linux (RHEL) 5.7. The Apache web server that is included in this release of RHEL is of version 2.0.49. Apparently version 2.2.x isn't included in this release of RHEL.

First things first, I would need the source code for the Apache Web server (httpd) version 2.2.22 from http://archive.apache.org/dist/httpd/

I have had problems compiling the older apr and apr-util, apparently due to some bug which I can't be bother to get them patched, so I decided to use the latest version, available from http://apr.apache.org/download.cgi

Using yum, your friendly Yellowdog Updater Modified, download and install the following packages. Why is doxygen in the list, I have no idea why, apparently it is required by apr.

# yum install -y rpm-build make m4 gcc gcc-c++ autoconf automake ncurses-devel redhat-rpm-config expat-devel freetds-devel unix-ODBC-devel libtool doxygen e2fsprogs-devel db4-devel postgresql-devel mysql-devel sqlite-devel openldap-devel openssl-devel nss-devel distcache-devel

Oh yeah, what is apr, apr stands for Apache Portable Runtime, what it's used for, please read http://apr.apache.org/, all I can say is it's for you to perform certain modifications to the Apache Web server, or in other words runtime, without having to recompile or reinstall or restart the httpd service, among others.

First compile apr
Download apr-1.4.6 and apr-util-1.5.1 (the latest as of this writing)
Move them over to /usr/src/redhat/SOURCES

# mv ~/apr-1.4.6.tar.gz /usr/src/redhat/SOURCES
# mv ~/apr-util-1.5.1.tar.gz /usr/src/redhat/SOURCES

Build the rpm, yep it's quite that straightforward.

# cd /usr/src/redhat
# rpmbuild -tb --clean SOURCES/apr-1.4.6.tar.gz

If the compilation/rpm creation is successful, you should be getting the following messages, you should be getting a lot besides the ones shown below:

.....

Wrote: /usr/src/redhat/RPMS/x86_64/apr-1.4.6-1.x86_64.rpm
Wrote: /usr/src/redhat/RPMS/x86_64/apr-devel-1.4.6-1.x86_64.rpm
Wrote: /usr/src/redhat/RPMS/x86_64/apr-debuginfo-1.4.6-1.x86_64.rpm
.....

When you're seeing the above messages, this means all three apr rpm has been create and can be found under the directory /usr/src/redhat/RPMS/x86_64. As of this writing, I am compiling/creating the rpm using a 64-bit version of CentOS 5.7. And yes, RHEL 5.7 and CentOS 5.7 are binary compatible.

Once that is done, install apr and apr-devel, you'll need this to compile apr-util.

# cd /usr/src/redhat
# rpm -Uvh RPMS/x86_64/apr-1.4.6.x64_64.rpm RPMS/x86_64/apr-devel-1.4.6.x86_64.rpm

Secondly, compile apr-util
Extract the apr-util tarball appropriately, in my case, I had it extracted in /usr/src/redhat/BUILD

# cd /usr/src/redhat/BUILD
# tar xvfz ../SOURCES/apr-util-1.5.1.tar.gz

Copy the apr-util.spec out and into /usr/src/redhat/SPECS

# cp apr-util.spec ../SPECS

Edit the apr-util.spec, and locate the following line

BuildRequires: expat-devel, libuuid-devel

And change it to

BuildRequires: expat-devel, e2fsprogs-devel

libuuid-devel is apparently missing from CentOS/RHEL 5.7 and instead it is owned by the e2fsprogs-devel package

Locate another line that looks like this:

make check || exit 1

And change it to, for some weird reason, which I can't be bothered to find out why :D the when make and ultimately testing during execution of make, testcrypto will fail. Changing 'exit 1' to 'continue' will make the even after failing testcypto portion during execution of make (quite a mouthful isn't it)

make check || continue

And build the rpm, and voila!

# rpmbuild --clean -ba SPECS/apr-util.spec

You will see these messages if the build is completed successfully.

.....
Wrote: /usr/src/redhat/SRPMS/apr-util-1.5.1-1.src.rpm
Wrote: /usr/src/redhat/RPMS/i386/apr-util-1.5.1-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/apr-util-devel-1.5.1-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/apr-util-dbm-1.5.1-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/apr-util-pgsql-1.5.1-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/apr-util-mysql-1.5.1-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/apr-util-sqlite-1.5.1-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/apr-util-freetds-1.5.1-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/apr-util-odbc-1.5.1-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/apr-util-ldap-1.5.1-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/apr-util-openssl-1.5.1-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/apr-util-nss-1.5.1-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/apr-util-debuginfo-1.5.1-1.i386.rpm
.....

Install apr-util and apr-util-devel, which is needed for the next build, and that's for httpd

# rpm -Uvh RPMS/x86_64/apr-util-1.5.1.x86_64.rpm RPMS/x86_64/apr-util-devel-1.5.1.x86_64.rpm

Lastly, build httpd-2.2.22

# rpm -Uvh RPMS/x86_64/httpd-devel-2.2.22-1.x86_64.rpm RPMS/x86_64/httpd-2.2.22-1.x86_64.rpm RPMS/x86_64/mod_ssl-2.2.22-1.x86_64

One final thing, apxs

Oh and in case, should there be a need to manually build dso modules. e.g. mod_jk
Edit the file /usr/lib64/httpd/build/config_vars.mk, locate

exp_installbuilddir = some path

And change it to

exp_installbuilddir = /usr/lib64/httpd/build

Oh and bear in mind that this method will have all DSO modules enabled which makes this install bulky, so pick and choose which modules that you might need. Or otherwise you'll need to manually remark or disable some of the modules.