When you need a blog on Kentico based web-site, the first idea is use default "Blogs" feature. Sure, it's a good option for all. I really like free CMS edition for small projects. No pay for outstanding functionality, what can be better. A fly in the ointment is a limitation. No more 1000 pages are ok for a small site, but for site+blog could be a problem. Because we are going to post a lot, really;) Tough choice, but as was written on the cover of "The Hitchhiker's Guide to the Galaxy": DON'T PANIC.
There is a third option. Integration Kentico with open-source blog engine. Let’s choose one.
BlogEngine.NET – popular solution with the great community. You can:
- download it from CodePlex as precompiled Web project;
- get a source code from GitHub;
- deploy it from Azure Marketplace directly as a Web App.
If you start from the scratch, please follow this guide.
If you already have worked Kentico site, please read the text below.
Set up virtual directory
We want to publish the blog as a virtual application with nice URL ~/blog.
- create folder “blog” in "wwwroot" folder
- upload here "BlogEngine.Net" project files
- configure virtual directory for "blog" in IIS or Azure application settings.
Set up database
By default, BlogEngine prefers XML files as a data store. We like SQL Server, moreover, we already have Kentico site here. You can switch database any moment, better to do it from the start because no data migration from XML files provided.
- run /blog/setup/SQLServer/Setup.sql file on your DB instance
- change "connectionString" in /blog/setup/SQLServer/DbWeb.Config, copy file to blog root (~/blog) and rename DbWeb.Config to web.config.
- (optionally) delete "setup" folder. No way back from now :)
Put the final touches
You're almost ready.
Go to the blog page. When everything right, you will see this post: "Welcome to BlogEngine.NET using Microsoft SQL Server".
Now you have to change "admin" password. Login to admin menu by following <<your site>>/blog/admin with default credentials:
user: admin \ password: admin.
When you configure custom errors in Kentico project, this will be shared with the blog. Please override it in wwwroot/blog/web.config.
That's it. Enjoy!