I have just spent many hours of my life installing php, perl modules, image processing libraries and all sorts of nonsense onto my shiny new VM somewhere out there (in Maidenhead I think...)
...and the result of this is? Well, I have a working install of Bugzilla and Moveable Type of course!
This is a bit of a sysadmin / linux post, so any developers who are bored by such niceties had better look away now.
Soon to be expanded into an article in the wiki (which doesn't exist yet), I present the h2j9k.org guide to installing Bugzilla on a vanilla linux server install (this method has worked on CentOS, openSUSE and Debian) using only SSH and the power of the terminal...
I open with a well quoted sentence of extreme relevance:
PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil, perpetrated by skilled but perverted professionals. -- Jon Ribbens Amen.
Before I started this charade, the only time I had installed Bugzilla was for testing on my development machine. Now when you build a dev machine, you install basically everything in all of the development packages you can find in zypper/apt/yum, don't you? (well, I do). And after you have done this, following simple instructions like
perl ./install-modules.pl --all
Seems sensible. It makes you put Bugzilla in the mental category called "oh just unzip the tarball and point a browser at it to get it working" web applications. You trust in the open source goodness of the creators of wonderfully easy to use applications that you can obtain use and customise for free. Sunshine appears from under your keyboard, and suddenly you are transported to a bustling central London park, with free wifi access, ice cream, and an iPhone 3GS.
So, when building a minimalist command line only Debian server, you think "it'll be fine". You make a cup of tea and sit down to install Bugzilla in half an hour or so. But you have forgotten one thing. Bugzilla is not written in PHP. It is written in Perl.
And Perl doesn't let you get away with things that easily. Not only must you install the interpreter for this
unparsable excuse for a scripting language, you must also install a million and five crazy modules which, if your .deb or .rpm based distribution doesn't provide in convenient binary form, you must install
from source.
Now I have nothing against building software form source. I would run Gentoo on my new laptop just like I did on my old one if it weren't a Mac, and OS X didn't let you build open source stuff using an
awesome package manager already, and work quicker. The problem with building Perl modules from source is that you must use Perl to do it. And Perl is the most hacky, bodged and broken way of building things from source, with the lowest level error reporting you have ever seen, so much so that all errors are completely impenetrable to mere mortals like myself. The only way to do it is to change into some old clothes you don't mind getting filthy in, and put of the following protective safety equipment:
Install gcc, g++, make, automake, autoconf, and every other low level linux dev package you can find. Even gfortran is advisable. If you are on a graphical system, just catch all by installing kdevelop or anjuta, as appropriate to your desktop environment.
If you are going to install something called, say, GD or Image::Magick, run a search in your native package manager and install everything by that name and with that name followed by -lib or -devel or -perl.
Remember the following command as the saviour of some Perl woes, and the generator of others:
~$ perl -MCPAN -e shell
This command takes you to a perl shell which should let you install and debug modules one at a time. You will initially need to configure the CPAN shell - let it do it automatically (you can break things by choosing the wrong options and then it will fail to build anything).
Installing one at a time is infinitely preferable to bulk installs (until you have most stuff working already perhaps) as the relevant error output isn't 500,000 terminal lines upwards from the exit point.
Install a module using:
cpan0> install Their::Hacky::Module::Name
And hit enter to accept the default when it prompts you about dependancy installation (why the people at CPAN thought that prompting for dependency install was a good idea I will never fathom).
Repeat and rinse for 30 minutes
or until golden brown (i.e. you have installed all the dependencies of your Perl app). If you run into build errors it may be that the module is simply broken (and as long as it's only optional i strongly advise you to just skip it) or it will be that you don't have a compiler or linker or maker or somesuch.
If you are using this to install bugzilla, you should exit the CPAN shell using
each time you successfully install something, and rerun ./checksetup.pl and see what remains to install. leave the DB settings as broken until you have installed all the modules.
Now, if you are using mysql, you are about to discover even more fun. The installer script will try and use the ALTER and INDEX SQL commands, which means that the nice MySQL docs example for a creating a limited user will break. Replace it with the following when creating and assigning privileges to the user:
CREATE USER 'monty_bugs'@'localhost' IDENTIFIED BY 'obscure_password';
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX ON bugs_database.* TO 'monty_bugs'@'localhost';
Further narrowing down the usefulness of the information, on CentOS (and I Imagine redhat) you are stuck with the DBD::Mysql module from an rpm (it is a dependancy of the mysql-server package for some reason) which is too old for the latest stable release of Bugzilla (installed is v3, min required is v4). You need to manually download version 4 as appropriate for your distro from
somewhere like this (make sure you get the right architecture - you are
being yum at this point) and install using rpm --install --force /path/to/rpm.rpm
OK, soon this overly opinionated rant will be converted into a passive tense tree of info regarding particular distributions and setups on a MoinMoin wiki (as soon as I have time to get that working) but for now here is the somewhat uncensored version.
Happy Saturday all. (oh by the way, the Movable Type install was a breeze (even though it is also mostly Perl), Bugzilla devs take note.)
Recent Comments