About the author

Morten Krogh-Jespersen is the founder of dotnamics - an IT company that develop products and consults in the programming field.

BlogEngine.net as a web-application

by Morten Krogh-Jespersen 28. april 2010 07:09

In my last post I showed how to run BlogEngine.Net in a sub-folder on web-host. Web-hosts normally put a lot of websites on the same machines so to minimize cost. The thing is, the more websites the less power for you website. It might even be that your host only have on ASP.NET application pool per machine - or they recycle it often.

I might be wrong - but I have experienced websites that need to recompile on each ASP.NET worker process recycle - so it might be that your website is not only running with half the power - but also experience a more frequently recompilations. 

The only solutions is to make a a web-application (precompiled) web-site. That way ASP.NET only needs to transform the MSIL code to machine code - you can find more information here: http://msdn.microsoft.com/en-us/library/bb398860.aspx

Pro's with a precompiled BlogEngine.net

  • Faster response-time - good for users and SEO
Con's with a precompiled BlogEngine.net
  • Wikis and Extensions are no longer dynamic - you cannot add extensions on the fly

If you need to add extensions on the fly - and you don't have Visual Studio to perform the precompilation then you should stick with the web-version of BlogEngine.net

If not I strongly suggest that you put in the effort. BenAmada has written how to it here: http://blogengine.codeplex.com/Thread/View.aspx?ThreadId=43154

I'm personally the lazy type - and if you are too then you can save yourself some work by download the file attached to this post. Remember, this is a version with BlogEngine.NET running in a sub-folder.

dotnamics_blogengine.rar (2.05 mb)

Tags:

BlogEngine.net

How to install BlogEngine.net in a subfolder on a web host

by Morten Krogh-Jespersen 27. april 2010 08:12

This is my first entry on this blog - so why not kick it off with some information about how I got this blog engine (which name is BlogEngine.NET) running.

I have a danish web host provider called unoeuro.com that does not give me an option to create virtual directories in their webmanager. I guess a lot of people have that problem. I was unable to use a PHP hotel due to some webservices in my domain, and a sub-domain would not be sufficient due to SEO optimizing.

(UnoEuro.com are actually willing to create virtual directories - but that would not be any fun)

If we are unable to create virtual directories, the ASP.NET worker process will execute the files under the root - and see the whole as a large website with just one place of configuration. This means that we need to copy some of the most important files into the root of the website.

So here is what you do for version BlogEngine.Net 1.6.0:

1) Pick a sub-folder name. I chose "mortens-blog" because my name is Morten and it is a weblog

2) Unzip all files of the (web) release into this folder

3) Move the following files into the root:

  • App_Code folder
  • App_GlobalResources folder
  • bin folder
  • Global.asax
  • Web.Config
  • COPY pics
4) Rename "App_Data" to "data" in your sub-folder that I call mortens-blog

5) Modify web.config and change the following lines:
  • <add key="BlogEngine.VirtualPath" value="~/{sub-folder name}/" />
  • <forms timeout="129600" name=".AUXBLOGENGINE" protection="All" slidingExpiration="true" loginUrl="~/{sub-folder name}/login.aspx" defaultUrl="http://{your domain}/{sub-folder name}" cookieless="UseCookies"/>
  • <customErrors mode="On" defaultRedirect="~/{sub-folder name}/error404.aspx">
  • <error statusCode="404" redirect="~/{sub-folder name}/error404.aspx"/>
  • <add name="SecuritySiteMap" description="Used for authenticated users." type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" securityTrimmingEnabled="true" siteMapFile="~/{sub-folder name}/Web.sitemap"/>

6) Your almost there - now the only thing missing is the sitemap located here: ~/{sub-folder name}/Web.sitemap

That is basically it.

BUT WAIT - there might be some references to masterpages, usercontrols etc. that may not work.

That is why i have created a .rar file that you can download. The only thing you have to do if you use this file is:

1) Change the folder "mortens-blog" to your preferred name

2) Search and replace "mortens-blog" with your preferred name in the root web.config

3) Search and replace "mortens-blog" with your preferred name in the ~/{sub-folder name}/Web.sitemap

You could also wait for the next post were I will modify the website to a web-application. If you are planning on hosting your blog on a popular web host you might benefit a bit by choosing the web-application.

BlogEngine.NET.rar (1.42 mb)

Tags:

BlogEngine.net