Ruby on Rails on Arch Linux with Mongrel and Apache

I’ve spent the last week or so trying to get a Ruby on Rails up and running on my Arch Linux box. I was determined to get something ‘better’ than WEBrick running to allow me to have production(ish) environment. I also wanted to achieve side by side with LAMP configuration I’m running to serve this (wordpress) blog.

I started off looking at using Apache with mod_fastcgi, which for the life of me, I couldn’t get the module to compile at all. I tried numerous PKGBUILDs from other archers but none seem to compile.

I then looked to Apache with mod_fcgid which is supposed to be better for Apache2 installations over mod_fastcgi. I had a little more success with this but overall it didn’t work. I successfully created my own Arch package for this which seemed to install OK, I just never seemed to get it ‘talking’ to rails properly 😦

I then started to read some stuff about Mongrel which looked interesting. No FCGI but with speed 😀 I actually was reminded about Mongrel while reading Amy Hoy’s article ‘Because let’s face it, WEBrick sucks‘ which showed my how easy it would be to use Mongrel. Thanks Amy 🙂

So, getting Mongrel working was fine, but I wanted to proxy the requests through apache so that I had only one webserver talking to the outside world. I found Hank Matter’s article ‘Successful settings for Apache forwarding to Mongrel‘ set me off in the right direction but actually discovered this was overly complex for my setup. It was actually alot easier than this to setup.

Hank seems to be setting it up so that a folder off your site proxys back to Mongrel and serves your rails content. If though, like me, you are using virtual hosts, the setup is simplified further.
It is just a case of adding this in your virtual host config –

Redirect /
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/

That’s it, Apache is now proxying back to Mongrel 🙂

Simplest LAMP Set-up

Having just moved this blog from Windows to Arch Linux, I’m keen to stress how easy it was.

Installing Arch isn’t supposed to be easy, but I think it is, it’s not graphical with bells and whistles but it’s simple and concise. Once I had Arch up and running, I had a quick look at the Arch Wiki and soon had a fully working LAMP set-up.

I think that has to be the most painless install of Apache, MySQL and PHP I have ever done. Well done Arch 🙂

Thoughts on SLED 10

For me and probably a great many others, the most anticipated Linux release of late has been that of SuSE Linux Enterprise Desktop 10 (SLED10). When Novell released the public beta I rushed to download the 5 CDs and burn them. I then, having recently moved house, found myself in a situation where I had absolutely nothing to install it on as my house was still in boxes. When I finally got round to unpacking my office equipment the first thing I therefore wanted to do was install this puppy 🙂

The install went very well. I was very impressed with this distro’s ability to detect my 200GB disk attached as a third IDE device on my motherboard, no other distro has ever managed this! The install made a pretty reasonable assumption that I wanted to install in the 150GB of free space on this drive and reuse the swap space allocated for an existing linux distro. Good assumption but not what I wanted to do. I simply told it to use my second disk and overwrite the exisiting linux distro, which it was happy to do and was childsplay really. I answered a few no-brainer questions and the installation of files started, I was impressed at this point with the ‘slideshow’ and ‘details’ (I think that was what it was called) tabs during this stage. Slideshow provided some nice blurb about the OS and it’s features while the details tab allowed me to really see what was going on. I like the way the installer showed me how long it was likely to be until a disk change, very neat. On the subject of disk changes, this is where the installer took a turn for this worst. I watched the time counter get to 0 and expected the installer to ask for disk 2, it didn’t, it simply rebooted. I would consider myself pretty techy and even I was worried at this point, no warnings, no nothing, just a reboot. My fears were unnecessary as the installer started back up again after the reboot got straight back to where it left off and asked for disk 2, that’s fine but why not tell me it’s going to reboot? One thing I noted at this point was that the installer now only had the details tab rather than the option of the friendly slideshow, this struck me as a strange inconsistency which might scare a non-technical user.

The rest of the install is a blur, so I guess it went pretty well. All of my hardware was detected correctly including my graphics card and monitor combo which has always been a headache for SuSE. No other SuSE install has ever configured X correctly on this machine. So all was good, apart from one major bugbear. On logging in to my new spangly desktop my first impressions were immediately marred by the realisation that the X config had somehow left me with a 20 pixel (or so) black strip down the right hand side of my screen. I could probably delve into xorg.conf (or similar) and tweak a number that reflects the geometry of my monitor, but I shouldn’t have to.

I’m really encouraged by what I’ve seen so far in SLED10 and to be honest I haven’t had much time at all to play with it. I was particulary impressed that Banshee managed to play my music collection (from an NTFS partition) with no problems at all, even though the entire lot are encoded as AAC, now that’s pretty good for linux.

Beagle seems really good, although rather slow on my test machine. I have however, managed to crash beagle just by clicking on one of the little arrows to see more results 😦

I really would like to test the distro more and I’m pretty confident that Novell will kill any little bugs before final release. Since installing SLED10 I’ve spent some time installing Arch on another machine so that I can move this blog off of my windows machine (the dual boot with SLED10). With this blog now running on Arch I can spend more time in SLED10 🙂

GNOME Mockups

Originally discovered by carbon-12 on this Ubuntu Forum Post, Novell seem to have been playing with some new UI design ideas possibly for NLD10. The link there then got OSNews’d and subsequently has been secured by Novell. Thankfully somebody grabbed them 🙂

GNOME Mockups

My take.. most look really nice, later on they seem to be heavily influenced by Mezzo which isn’t a bad thing!

ASSP vs DSPAM Part 1

I’ve been meaning to get around to this for some time now but just never seem to have the time. With my wife now back at University studying all the time, I have a bit more time to myself.

This is in no way a thorough comparison of the two anti-spam mechanisms I currently use but is just a few current thoughts about the two –

ASSP as I understand it is a set of Perl scripts that proxy mail to your ‘real’ email server identifying spam in the process. As a direct proxy to your live ‘real’ email server, ASSP ceases to function when your ‘real’ email server is down/unavailable. In comparison DSPAM acts a relay (in my set-up), sitting in front of your ‘real’ email server receiving mail, quarantining what it classifies as spam and relaying the rest on to your ‘real’ email server. In this way DSPAM is able to accept email for you and queue it when your ‘real’ email server is actually down/unavailable.

I really like the quarantine aspect of DSPAM, in my current set-up I have ASSP marking spam with a prefixed subject and a server side rule on our ‘real’ email server uses that info to move suspected spam to a subfolder which is therefore skipped on POP3 collections. ASSP in this set-up is therefore similar to DSPAM, YMMV. This is just my set-up and not a property of ASSP though and therefore DSPAM is better in this aspect. DSPAM is also user configurable at this level, a user can specify to have all mail relayed and just have the subject prefixed rather than the quarantine default. DSPAM actually has lots of user configurable settings which is great.

DSPAM is user specific, as mentioned above users have preferences, they also have their own corpus and therefore their own idea of what spam is. One mans spam is another mans email, I suppose.

ASSP is MUCH easier to set-up than DSPAM and as it’s just some Perl scripts it runs on many OS’s including Windows. DSPAM was pretty complex to set-up but in it’s defence I’m no Linux guru and therefore things like this do take a while for me to master.

One of the things I’m finding using DSPAM is that you can do so much to filter out spam before it even reaches DSPAM. I’m using DSPAM with postfix and have quite a few spam prevention measures set-up within postfix that drastically reduce the spam that DSPAM even sees.

I’m yet to upgrade DSPAM to version 3.6 which was recently released, I’m sure the upgrade of the core will go fine, but personally worry about setting up the Apache side of things. My Apache knowledge isn’t great and as it’s all SSL with user authentication this is the reason I’m putting of the upgrade.

Anyway I’m bound to think of more I’d like to say in comparison of these two products and one day I will actually review these ‘notes’ and do a proper comparison. Until then, bare with me 🙂

Posted in Linux, Spam. 3 Comments »