Friday 28 November 2008

Apache, Mono and Virtual Hosts

I run some ASP.Net applications under mono on a Debian host. Mono has come a long way in the last few years and is now making progress in support for C# 3.0 and even WCF. This adds appeal to the platform and increases the scope of it's usefullness.


One thing I had trouble finding documentation for and ended up accomplishing through trial and error was setting up my Mono applications to run in an Apache (2) Virtual Host. The most difficult bit turned out to be the configuration of my sites-available file in /etc/apache2/sites-available. So I've decided to share it here:


<VirtualHost *>
ServerName example.com
ServerAlias www.example.com example.net www.example.net example.co.uk www.example.co.uk
DocumentRoot /var/www/example.com
ServerAdmin serveradmin@example.com
ErrorLog /var/log/apache2/example.com-error_log
#RewriteEngine on
#RewriteRule ^/([A-Za-z]*)/?$ /?Page=$1 [PT]
AddMonoApplications example "/:/var/www/example.com"
MonoUnixSocket example /tmp/.example_mod_mono_server2
MonoServerPath example /usr/lib/mono/2.0/mod-mono-server2.exe
AddType application/x-asp-net .aspx .ashx .asmx .ascx .asax .config .ascx .svc
MonoApplicationsConfigDir example /etc/mono-server2
MonoPath example /usr/lib/mono/2.0:/usr/lib:/usr/lib/mono/2.0
<Directory "/var/www/example.com">
MonoSetServerAlias example
SetHandler mono
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

As you can see, I have commented out the RewriteEngine and RewriteRule directives but there is enough there for you to see what new tricks we .Net devs have to play with when we write code for a Mono deployment...

Thursday 13 November 2008

Help find Philip McNeil

The last few days have been an emotional roller coaster. We heard on Monday that Jo's brother has not been heard from or seen since early October when he disappeared from Yellowknife.

There are good indications that he is alive but piecing together the facts from an overwhelmingly large selection of tiny clues has been exhausting.

I have learned so much this week about human nature that my head feels like it's going to explode. Listening to second and third hand reports is useful but you can't beat going straight to the source to get the facts. It seems that when someone relates an incident or a conversation to you, they can't help but include their own interpretation or understanding of an event and when the relay has already passed through more than one chinese whisper the facts can get seriously twisted.

The whole week has been spent speaking to everyone we can find who has spoken to or seen Phil in the weeks leading up to his disapearance and organising the effort to find him.

We put up a simple website to colate some of the information gathered so far at: www.philipmcneil.com.

Jo left for Yellowknife this morning. She's due to meet up with Julie when she arrives and start interviewing people face to face as well as recruiting a team to help her search for Phil.

I love you Jo. Good luck! Find him quickly.

Monday 26 May 2008

Driving in Tico Country

Driving in Costa Rica is pretty awesome. The landscapes are varied and breathtaking. Making a wrong turn almost always results in some kind of adventure whether it's discovering the capabilities of your offroader or finding a great place to eat and taste foods you've never tried. I ended up on a rope bridge a couple weeks back that came complete with two sets of wooden planks spaced roughly the distance that a set of car wheels have between them apart and all the thrills and wobbles of riding a rollercoaster that you can steer.

Today, however, I discovered that it doesn't matter what your driving skills are when I managed to execute an emergency stop on a wet highway to avoid colliding with cars ahead of me that had somehow become stationary in a very short distance. I had all of 2 or 3 seconds to enjoy my near miss before seeing in the rear view mirror that the 2 wheel drive Hyundai behind me didn't have a prayer of stopping without using his bonnet and my boot as his crumple zone. I made a vague effort to remove my car from the road but the combination of the rain soaked tarmac and old Kumho tires on the doomed car to my rear proved a versatile adversary and the inevitable crunching and screeching ensued. Everyone was ok and aside from being jolted into a new level of awareness all six of the Hyundai's passengers emerged a little shaken and embarrassed but good spirited enough to know that it could have been a lot worse. The Costa Rican police were on the scene quickly and had everything documented before I could say pura vida.

Needless to say the Hyundai was a write off while my trusty Terios only lost its cosmetic bumper cover and right indicators. In future I'll be reaching for the hazards a bit quicker and relaxing a little slower when I've just avoided an accident. And I'm enjoying the convenience and disposability of rental cars a little more today.