Mono + Linux + BlogEngine.NET

As you can see at the bottom of the page, this site is powered by the BlogEngine.NET open-source blogging software but, yes, it is running on Linux with Mono and Apache.

There have been just two issues with case-insensitivity in BlogEngine.NET source code, but otherwise the deployment went without any issues what-so-ever! This is a live proof for both Mono and Mono's ASP.NET maturity as well as the .NET's realized promise, thanks to Mono again, of enabling one to write and deliver cross-platform software.

Comments

May 15 laas

laas

Hi!
Could you be so kind to describe what kind of changes you made to the original BlogEngine package in order to make it run on mono ?

May 15 grendel

grendel

Sure! No changes to BlogEngine.Core were necessary and the the diff for the BlogEngine web application is below. Note that those changes aren't as much Mono specific but rather platform specific. They deal with Windows vs Linux differences:

diff --git a/site/blog/App_Code/ExtensionManager/Manager.cs b/site/blog/App_Code/ExtensionManager/Manager.cs
index 8807d99..1bf9d9c 100644
--- a/site/blog/App_Code/ExtensionManager/Manager.cs
+++ b/site/blog/App_Code/ExtensionManager/Manager.cs
@@ -101,7 +101,7 @@ public class ExtensionManager
         xs.SaveSettings(x);
         SaveToCache();

-        string ConfigPath = HttpContext.Current.Request.PhysicalApplicationPath + "web.config";
+        string ConfigPath = HttpContext.Current.Request.PhysicalApplicationPath + "Web.Config";
         File.SetLastWriteTimeUtc(ConfigPath, DateTime.UtcNow);
         break;
       }
diff --git a/site/blog/Web.Config b/site/blog/Web.Config
index 564c954..73449ca 100644
--- a/site/blog/Web.Config
+++ b/site/blog/Web.Config
@@ -20,13 +20,13 @@
     <clear/>
     <add name="LocalSqlServer" connectionString="dummy"/>
     <!-- Mono complains if LocalSqlServer isn't specified -->
-    <add name="BlogEngine" connectionString="Data Source=|DataDirectory|\BlogEngine.s3db;Version=3;BinaryGUID=False;" providerName="System.Data.SQLite"/>
+    <add name="BlogEngine" connectionString="Data Source=|DataDirectory|/BlogEngine.s3db;Version=3;BinaryGUID=False;" providerName="System.Data.SQLite"/>
   </connectionStrings>

   <appSettings>
     <add key="BlogEngine.FileExtension" value=".aspx"/>
     <!-- You can e.g. use "~/blog/" if BlogEngine.NET is not located in the root of the application -->
-    <add key="BlogEngine.VirtualPath" value="~/blog/"/>
+    <add key="BlogEngine.VirtualPath" value="~/"/>
     <!-- The regex used to identify mobile devices so a different theme can be shown -->
     <add key="BlogEngine.MobileDevices" value="(nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)"/>
     <!-- The name of the role with administrator permissions -->
diff --git a/site/blog/admin/Extension Manager/Editor.ascx.cs b/site/blog/admin/Extension Manager/Editor.ascx.cs
index 6256f64..f11e3a0 100644
--- a/site/blog/admin/Extension Manager/Editor.ascx.cs  
+++ b/site/blog/admin/Extension Manager/Editor.ascx.cs  
@@ -66,10 +66,11 @@ public partial class User_controls_xmanager_SourceEditor : System.Web.UI.UserCon
         {
           if (type.Name == _extensionName)
           {
+      char dirSeparator = Path.DirectorySeparatorChar;
             string assemblyName = type.Assembly.FullName.Split(".".ToCharArray())[0];
-            assemblyName = assemblyName.Replace("App_SubCode_", "App_Code\\");
+            assemblyName = assemblyName.Replace("App_SubCode_", "App_Code" + dirSeparator);
             string fileExt = assemblyName.Contains("VB_Code") ? ".vb" : ".cs";
-            fileName += assemblyName + "\\Extensions\\" + _extensionName + fileExt;
+            fileName += assemblyName + dirSeparator + "Extensions" + dirSeparator + _extensionName + fileExt;
           }
         }
       }

May 24 Leadership

Leadership

Hiya, I've recently started running my leadership blog on Wordpress, and have well, started to have a couple of doubts, so wondered whether, seeing as you're using blogengine pretty well here, I'd ask what you thought of blogengine's functionality and backend? Do you think that if I used it on my leadership site, I'd see it as an 'upgrade'?

May 25 grendel

grendel

Given that I'm not much of a blogger, don't take my opinion for granted. Having said that, I like what BlogEngine.NET offers in terms of both functionality and the backend. I previously used blogger.com and I must say I like BE much better. What is definitely nice is its data storage backend configurability. So far, I haven't found anything which I would count as an argument for not using BlogEngine.NET.

the ridges in summerlin

Thanks for it. Are you running it on your own server? And what distro is it using? Just curious about the stability.

Jul 14 grendel

grendel

Yep, on my own Debian/lenny server. There are no problems with stability, it's been up for 7 or 8 weeks now without any issues.

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading