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!

Jun 27 2008

This article I found on the Mind Tree Blog sort of covers old ground for me, but it was interesting nonetheless. It’s interesting the way he doesn’t forward specific things, but rather everything in the URL… so we’d forward something like:

http://www.asgrim.com/channel/Google/news/something/

to:

http://www.asgrim.com/index.php?p=channel/Google/news/something/

and letting the PHP script decode the specifics of the URL, rather than setting up specific forwards like:

http://www.asgrim.com/index.php?module=channel&provider=Google&section=news&article=something

I’m not sure which I prefer. The method mentioned in the article does give extra flexibility without having to modify the .htaccess, but the latter gives more specification as to how the URLs should work. I guess at the end of the day it’s up to opinion.

May 13 2008

Just a quick simple reference point for me, as I am using this while I migrate websites from Tampa to Oblivion (Oblivion is not yet public, so I need Tampa to forward HTTP requests of websites that have moved onto Oblivion).

RewriteEngine on
RewriteCond %{HTTP_HOST} ^[a-zA-Z0-9.]*hostname.com$ [NC]
RewriteRule ^(.*)$ http://internal-hostname/$1 [P,L]

Note that this needs mod_proxy as well as mod_rewrite to be enabled.

May 1 2008

Something I’ve not really played around with but I may do in the near future…. a very helpful info page about Apache’s mod_rewrite stuff:

http://corz.org/serv/tricks/htaccess2.php