May 13 2009

If you’ve recently done an upgrade or dist-upgrade (as I did) on your Ubuntu server and it broke Trac with 500 errors, then this might be the solution for you…

If you’re seeing something like this in your Apache error.log:

No module named trac.web.modpython_frontend

Then what has probably happened is Python was upgraded to a more recent version. I install Trac in python 2.4, therefore the Trac egg was in the /usr/lib/python2.4/site-packages directory. After the upgrade to python 2.6, the location would’ve changed. Thankfully, a very quick and simple solution fixed it for me:

sudo easy_install Trac

It worked like a charm for me, but if you have to install manually then I expect you’ll have to follow the TracInstall instructions over again…

May 11 2009

I’m sure you’ve all heard of Talk Like A Pirate Day, and here’s my rather geeky idea for another day. It’s Talk Like Apache Day!

Basically, you talk like an HTTP server (not specifically Apache, but “Apache” was similar to “A pirate”…). If you need help, here are some responses you can give people to confuse them.

Other ideas could be borne from this, such as Talk Like an MTA Day, or Talk Like SSH Day. I expect the later would have to be encrypted though…

Just imagine the conversation anyway:

You: Hi James, how are you?

Me: 200 OK

You: What?

Me: 304 Not Modified

You: I don’t understand…

Me: 304 Not Modified

You: You’re such an idiot…

Me: 400 Bad Request

Apr 7 2009

UPDATE!!

For the new Zend Framework 1.8.x series, please refer to this article. This is still here for historical purposes.

This is a pretty simple howto, but here it is anyway!

I assume already that you’ve got a LAMP stack working, and if you don’t, it’s easy as pie to install one in Ubuntu:

sudo tasksel install lamp-server

So now you’ve got your LAMP stack up and running, lets download the latest SVN tag of Zend Framework. At the time of writing, the latest stable is 1.7.8, which I’ll use here. If you want to check for the latest version, visit http://framework.zend.com/svn/framework/standard/tags/ in your browser, and the last folder is the one you want. If you want stable full releases, ignore the RC/PR versions. So, once you’ve determined the version you want, we’ll check out the release:

cd /usr/share/php5
sudo mkdir ZendFramework
sudo svn co http://framework.zend.com/svn/framework/standard/tags/release-1.7.8/

It is likely you’ll need to use sudo for these commands as /usr/share/php5 is owned by root by default. You’ll see a big long list of files being checked out, and once that’s done you’ll have a new folder appropriately named “release-1.7.8″. Create a soft link called “current” to the release folder so you can change the default included Zend Framework version without restarting Apache in the future:

sudo ln -s release-1.7.8 current

You can stop there if you like, and manually add the include path into your PHP scripts using set_include_path. However, if you would like the current Zend Framework included automatically, then continue by opening /etc/php5/apache2/php.ini in your favourite editor. Add the path to your include_path list. For example, if your current include_path is (and this is the default):

include_path = ".:/usr/share/php5:/usr/share/pear"

Then change it to:

include_path = ".:/usr/share/php5:/usr/share/pear:/usr/share/php5/ZendFramework/current/library"

All you need to do now is restart Apache:

/etc/init.d/apache2 restart

In the future, if you wish to change to a new default Zend Framework version (for example 1.8.0), then just check out the SVN directory and change the soft link. You won’t even have to restart Apache, and the changes will take effect immediately! For example:

sudo svn co http://framework.zend.com/svn/framework/standard/tags/release-1.8.0/
sudo rm current
sudo ln -s release-1.8.0 current

If you want to keep up to date with the latest Zend software, then just subscribe to their RSS feed!

Nov 19 2008

Prerequisites: apache with mod_rewrite and mod_fcgi, shell access (maybe root/sudo)

UBUNTU USERS – READ THIS FIRST!!

You might think compiling PHP, a scripted language, is a bit daft, but there are a few really good reasons you might want to compile your source code. In fact, compiled web code has been around for a while now, what with ASP.NET and all that. The main two reasons are (1) protecting your intellectual property if your project is closed-source and (2) potential speed increases. I say potential because that’s just a theory really – I’ve not investigated speed increases (or even decreases) yet, all I’ve done is compiled a test app and got it working.

I used Ubuntu as my compilation OS, because… well it’s awesome really*. I used this and this as the main guide, so read them and I’ll skim over the process I did here.

Read the rest of this entry »

Aug 22 2008

I posted the other day that I couldn’t get Bugzilla working due to missing Perl modules*. Well last night I badgered 1and1.co.uk to install the modules, but I got a vauge no. I carefully read various pages, and got it installed… here’s how:

Read these instructions** first. If the CPAN shell complains about not having permissions to modify /root/.cpan, read this. Instead of putting the whole Apache httpd.conf <Directory> section (you probably dont have access to an httpd.conf…), you can put the AddHandler/Options/DirectoryIndex lines in a .htaccess file in the Bugzilla directory. Just to note that I couldn’t add the AllowOverride option in for some reason – it threw a 500 error…

Another thing that confused me was this:

perl -pi -e 's@use strict\;@use strict\; use lib \"/home/foo/perl/lib\"\;@' *cgi *pl Bug.pm processmail syncshadowdb

Perhaps the document is out of date, but none of those files existed. I changed Bugzilla.pm (note: you must use the FULL path to your local Perl installation, not just ~/myperl/lib!!!), and hey presto, it works! I now have a nice neat and tidy Bugzilla installation.

* It turns out that Bugzilla 3.2 (in release candidate stage) has a script to do all this for you – doh!

** Updated documentation link to the correct version – doh!