The idea of building applications from source is foreign to Windows and commercial software users, but it is really not as scary as it sounds. Recently, I was called upon to install and configure Apache, MySQl and PHP on a client’s RedHat 9 installation. They were keeping their Redhat 9 machine up to date using the yum legacy program, but the legacy repositories are not always up on the latest editions. After all, volunteers maintain these, too.
As the client’s requirements included a need for transactions, the InnoDb database engine was a good choice. PHP supports a new MySQL interface in PHP 5.0.3 which takes full advantage of the new features in MySQL 4.1.x, so I chose to build Apache, MySQL and PHP from source. A little Googling came across several useful sites, where other developers had posted the commands they used to do this. Two I found especially useful:
Building from source involves a few steps:
- Download the source, typically from the main project web site or a trusted mirror. A good place to store all the files is /usr/local/src.
- Unpack the files into their own directories, typically with tar -zxvf for a tar.gz (“tarball”).
- Hop into that directory and take a quick read through INSTALL, README, LICENSE and CONFIGURE files to see if there are any gotchas.
- Build the script that does the compile (a “makefile”) with ./configure. If you followed the links above, you can see ./configure may have many options. Adding –help after ./configure will list them, and a little research can tell you the ones you want. If you get errors during this step, it’s back to the forums, Google or the instructions to determin if there’s more you need to do.
- Now that you’ve created the makefile, you invoke it with the command ‘make.’
- Install your application with ‘make install.’
It still sounds like a chore, but the end result is a working application that you have tuned to your system and needs, up to date with the latest source you could obtain, and installed where you want.