I've had some requests for a tutorial on installing BlogEngine.NET on Linux (and in particular Ubuntu).

Getting BlogEngine.NET itself to run is the easy part, the hard part is getting the latest release of Mono compiled from source on Ubuntu and getting mod_mono and apache2 configured together.

So to that end I'm starting a series of tutorials, beginning with the installation of Mono 1.2.6 from source on Ubuntu 7.10 (Gutsy Gibbon). These instructions should also work on Ubuntu 6.10/7.04. The next tutorial will be focused on installing BlogEngine.NET itself.

Here's the first tutorial: Installing Mono from source on Ubuntu 7.10 (Gutsy Gibbon)

If you should have any issues with the tutorial, either contact me directly or add a comment on this post, and I'll attempt to guide you through any problems you may have. Any feedback should also help in creating a troubleshooting section for the tutorial to help others out that may have the same issues.

I'm still no closer to solving the problems I'm having with mod_mono. It means having to restart the apache server at least twice a day, leaving large gaps in the day where this blog is completely inaccessible.

Until such time as I can trace and resolve the mod_mono issue, I've decided to resort to an ugly hack. Yes, you guessed it: automatically restarting the server if the blog goes down.

There are native Linux solutions to this very problem. System Integrity Monitor is one of them, but I was unable to make it work for my mod_mono driven virtual host, so I decided to roll my own solution.

The idea here is to periodically poll the blog and determine whether there are any HTTP errors returned. If an error is returned, we simply restart apache and send an email off to ourselves notifying us of the action.

There are native Linux commands that could be compiled into a bash script to do all of this. But since I'm a windows programmer, it's way easier writing a simple .NET console application to do the work. In my implementation, I only need to know if the blog returns anything other than the requested page and a 200 response code. More...

I'm still having problems with mod_mono, and apache. For no apparent reason, mod_mono stops communicating with the mod-mono-server process causing "Service Unavailable" errors to be returned by apache.

In another classic grope-in-the-dark move I've decided to build mod_mono from the daily builds on the anonymous mono SVN server.

I'm not sure that this will resolve the error at all, but for future reference I'm outlining the steps below (official instructions here: http://www.mono-project.com/AnonSVN):

Firstly, you'll need SVN (SubVersion) installed on your linux box. You can do this on Ubuntu with the following command:

apt-get install subversion

The next step is retrieving the sources from the anonymous Mono subversion repository.

svn co svn://anonsvn.mono-project.com/source/trunk/mod_mono 
svn co svn://anonsvn.mono-project.com/source/trunk/xsp

You need to build a new version of XSP too, as mod_mono will fail to run if the XSP and mod_mono versions differ.

Once the sources have downloaded, change into the "xsp" folder and run:

./autogen.sh --prefix=/usr/local; make; make install;

Do the same for the mod_mono folder.

Restart apache:

/etc/init.d/apache2 restart

And you should be done.

I'm having some strange issues with mod_mono on my server at the moment. Sometimes while using the blog site, my apache2 server suddenly starts giving "server is down for maintenance" errors.

Checking the apache2 error log I'll find an error like this:

[error] (107)Transport endpoint is not connected: write_data failed
[alert] Failed to send initial data. Transport endpoint is not connected

 

This clearly shows that the apache2 process is no longer talking to the mod_mono process. Restart the apache2 server, and you start seeing errors like this:

Failed to destroy the '/tmp/mod_mono_dashboard_XXGLOBAL_1' shared memory dashboard
File exists: Failed to create shared memory segment for backend 'XXGLOBAL'

 

The best information for the problem I've found has been here, but unfortunately no solution as yet.

Hopefully I'll figure it out soon. This particular issue is serverely testing my patience at the moment. So if the blog is down, I appologise, we are attending to the problem :P


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.

twitter

BlogEngine.NET


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