The Novell guys have pushed out another release of Mono, and I've just updated my VPS.

I'm glad to report that everything works great with BlogEngine.NET on Ubuntu. I've updated my instructions for installing Mono on Ubuntu to include the latest release.

If you haven't given Mono a go yet, what are you waiting for?

The unfortunate reality of having a public blog is having to deal with comment spam. There are many people out here that don't seem to translate the same respect for property in the real world over to the Internet. It may simply be because of the anonymity that the internet affords us, or maybe they simply don't have respect in the real world to begin with. Either way, once your blog is up for a couple of months, you will start to be inundated with comment spam.

Some of this spam will come from automated bots attempting to advertise their wares on your site, but those are easily dealt with. BlogEngine.NET has built-in automated bot handling capabilities that so far has left me spam-bot free.

But the most insidious spam will come from what appears to be a fairly new movement of people that engage in so called SEO competitions. The most annoying of late being the Busby SEO Test crowd. This is from some dodgy SEO company encouraging normal internet users to spam on their behalf in the guise of a competition. You can read more about this at Keyvan Nayyeri's blog.

Unfortunately for us, these spam comments are created by humans and cannot be blocked with the usual counter-bot routines, something more dynamic is required. Luckily for us, there are companies out there actively fighting this kind of spam. One of them is Waegis, a counter-spam community that collects spam from all over the web and builds black lists based on the feedback from thousands of blog and forum owners.

Protect Yourself

Protecting your BlogEngine.NET site using the Waegis filtering power has become so much easier now thanks to rtur, one of our fellow BlogEngine.NET developers. He's put together a BlogEngine.NET extension called Commentor that automatically checks any comments created on your blog against the Waegis database. Comments from known spammers are automatically rejected, but the extension does allow you to review them manually if you so wish.

Head off to rtur's blog to get your own automatic community powered spam assassin!

More for my own reference than anything else, but if you need to change the file permissions on a folder and all its files and subdirectories, simply do the following at the command prompt:

$ chmod -R 0777 /folder

So I finally decided to upgrade my linux server to the latest Ubuntu, Mono and BlogEngine.NET.

As you can see it all worked out in the end, but only after 2 days of fighting trying to compile Mono 2.2. Let me point out though that it should not have been such a mission. Mono 2.2 does compile and install fine using the instructions you can find here.

The snag turned out to be the amount of memory available on my VPS. So here's a note of warning to everyone trying to compile Mono 2.2: You need more that 300 MB of RAM to make it work. Anything less and you're going to end up with the compilation process dying at random points with no indication as to the problem. 400 MB eventually did the trick.

As for BlogEngine.NET 1.4.5, it works fine on Mono except for the URL rewriting. A fix for that is available here.

If you've recently tried to install the latest version of BlogEngine.NET on Mono, you would have noticed that the URL rewriting does not work for posts, but does work for categories.

This comes down to a bit of an oddity in the mono ASP.NET runtime. It turns out that if you have a path like /posts/2009/03/09/slug.aspx and an actual file called /posts.aspx exists in the root site, mono gets confused and mangles the path.

In your URL rewriting IHttpHandler you'd expect the path returned by context.Request.Path to match what was requested, but in reality Mono will give you /posts.aspx.cs/2009/03/09/slug.aspx instead. This is obviously a bug in Mono, but it's fairly easy to work around.

To fix the issue in BlogEngine.NET, open UrlRewrite.cs in BlogEngine.Core and modify your context_BeginRequest method to look like this:

private void context_BeginRequest(object sender, EventArgs e) {
    HttpContext context = ((HttpApplication)sender).Context;
    string path = context.Request.Path.ToUpperInvariant();
    string url = context.Request.RawUrl.ToUpperInvariant();
    // fixes an oddity in mono where .aspx.cs is added
    path = path.Replace(".ASPX.CS", "");
    url = url.Replace(".ASPX.CS", "");

Compile and deploy!

For those of you struggling to install Google Chrome with the retarded downloader Google decided to force on us, there is a direct download alternative.

I really don't know why every company in the world thinks it is necessary to re-invent downloading files from the web.

TCA's blog has the details. Get it here.

When using Mono and developing web applications in Visual Studio, it often becomes a pain to keep copying modified files over to your Linux box for testing.

Luckily for us Linux is compatible with Windows file shares via Samba. Samba allows us to mount Windows file shares as if they were folders on your local Linux drive.

Install Samba

You'll fist need to make sure that you have all the Samba files installed on your Linux box. These instructions are for Ubuntu, but should work for most distributions.

On the command line, log in as root using the sudo command:

$ sudo bash

Enter your password when prompted.

Then download and install the required Samba files.

$ apt-get install smbfs

Once that is installed, we can create the file mapping.

Map the Windows Share

First thing to do obviously is share a folder on your Windows computer. For the purposes of this tutorial, I'm going to be making the following assumptions:

  • Your Windows and Linux PC's are on the same network. Use the "ping" command to confirm!
  • The windows computer is called "MYPC" with an IP address of
  • The folder I'm sharing is called "Projects"
  • The Windows computer has a user account called "Russell" with a password of "mypassword". This user account must have access to the shared folder!

On our Linux box we're going to create a folder which will become our mount point. A mount point is basically a normal folder that will magically map to the shared folder.

So let's create a mount point folder for our projects share:

$ mkdir /mnt/projects

Now let's mount the windows share into our new mount point:

$ mount -t smbfs //MYPC/projects mnt/projects -o username=russell,password=mypassword

If you get an error on the above command, chances are that you're unable to resolve the computer name of your Windows PC. Try using "ping MYPC" to confirm that you can reach the PC. If you get an unknown host error, you can simply fix the problem by providing the IP address in the mount command used above.

Lets confirm that we can see our files:

$ cd /mnt/projects
$ ls

You should a directory listing of the files on your Windows share.

And that's it, now you can access your windows PC files as if they were part of your Linux file system!

A while ago I did a tutorial on installing Mono 1.2.6 on Ubuntu. As it turns out, installing Mono 1.9.1 follows the exact same process. You can thus use the 1.2.6 tutorial as is, just replacing the version numbers in the files you need to download with the corresponding 1.9.1 versions. The only notable exception is mod_mono which is only version 1.9. All full list of exact file locations is available from here:

I haven't yet tested the installation procedures on Ubuntu 8.04, but I assume they'd be pretty much the same. If I'm wrong in that assumption, please let me know.

Firefox 3 has been out for a while now and if you're sitting on the fence about the upgrade, I will personally recommend it, if only for Facebook.

My friends are bloody Facebook application mad, and opening more than one profile at a time was causing Firefox 2 to crawl. That's where Firefox 3 comes in. With the new version they've put major effort into rendering performance, and the difference is as clear as night and day.

Give Firefox 3 a spin on any AJAX enabled site and you'll immediately feel the difference. The only question I have is this: Why did we have to wait this long for a decent browser?

No use in whining however, it's out and available, so download and enjoy!

A rather nasty security hole was discovered in BlogEngine.NET recently. The flaw basically allows a hacker to retrieve your blog usernames and passwords with minimal fuss. You can read more about it here.

This is a rather serious issue, so if you're running BlogEngine.NET (pre v1.3.1.0), you are strongly advised to upgrade to the latest patched version.

I am a software developer / architect currently interested in combining .NET technologies with open-source operating systems. 

I am a member of the open-source BlogEngine.NET development team and focus mainly on ensuring Mono compatibility for the project.



At StayUnlimited Cape Town accommodation we help you choose from and book guest houses, self catering apartments, bed & breakfasts, luxury villas and hotel accommodation.