After setting up Ubuntu Hardy 64 bits (also known as AMD64) on my PC I had to do what every developer needs to do every now and then: set up my working environment. This is not a hard thing to do on Ubuntu, particularly if you choose to go with precompiled packages, installing them through the friendly Synaptic Package Manager. However, I do like to keep a tight control on what is the base of my day to day work, so instead of using the built-in packages, I chose to build them from source. Once again, this is not hard, but it can bring some complications for 64 bits environments. As I may probably need to do this once again in the future, I’ve decided to blog this guide on how to install the following packages on Ubuntu 8.04 64 bits: Apache 2 (with SSL support), PHP5 with xDebug, MySQL 5, Python through mod_python, SVN (client and server), and Trac integrated with SVN.
Setting up the Basics
As I said, we will install each package by building them from source. However, in order to do so we have lots of dependencies. The most important ones will also be built from source, but others we can safely get from the package manager. So without any further explanation, let’s go ahead and install those basic dependencies (I did mean to actually break it down so you could see which software needed which package, but its very late in the AM and I’m too tired to do that now):
This is a pre-requisite for MySQL and PHP, so let’s build it from source.
Before proceeding with the build, we need to slightly modify the Makefile so we don’t get compile errors when trying to compile on a 64 bit environment. So go ahead and open the make file:
DEPENDS ON: zLib
The following is only needed the first time you build MySQL, so avoid doing it when you are actually re-building:
Now let’s default the MySQL server to use utf8 encoding. Open the MySQL configuration file:
DEPENDS ON: zLib
The following instructions (everything until the next software package install) is only needed the first time you build Apache, so avoid doing it when you are actually re-building.
Once the editor has opened the file /usr/local/apache2/conf/httpd.conf, change the following lines:
Now edit the SSL configuration file in Apache:
DEPENDS ON: Apache 2
DEPENDS ON: PHP5
The following is only needed the first time you build xDebug, so avoid doing it when you are actually re-building. Let’s now enable xDebug on our php.ini file. Open the file for editing:
Python (with mod_python, SWIG bindings, and mysql_python)
DEPENDS ON: Apache 2, MySQL
Since we also have built in MySQL support for PHP5 on our Apache, I needed to build MySQL-python with embedded libraries, or otherwise mod_python would complain about it. This probably means that whenever you re-build MySQL you’ll also need to rebuild its python support. So let’s open the MySQL-python configuration file:
This is a pre-requisite for SVN, so let’s build it from source. Eventhough there’s a newer version (0.28.2 at the time of this writing), I found that there are known issues with SVN and Neon that only let us install the 0.25.5 version. You are welcome to try a newer version, but if it doesn’t work go back to 0.25.5.
Subversion (with Python bindings)
DEPENDS ON: Neon, Swig, Apache 2, Python
Let’s create our first SVN user (replace $USER with your desired SVN user name):
You will now have SVN access to that project using the URL https://SERVER/svn/test
Trac (with SVN integration)
DEPENDS ON: Subversion, MySQL, Python
Now let’s edit the main Apache configuration file:
You can now access your trac installation for the test project using the URL: http://server/trac/test