This is an article about how to use WebMatrix to get an open source blog engine, configure it and upload it to a live website in less than 15 minutes.
Using WebMatrix to Build a Blog Site
How better to start a WebMatrix blog than by using WebMatrix to build a blogging site? You see, much of the focus on WebMatrix has been on how easy it is to program ASP.NET Web Pages using the ‘Razor’ syntax, but WebMatrix is a whole lot more than just that. One of these things is the ability to easily use Open Source Web applications from the Web Applications gallery. One such app is BlogEngine.NET, which I’m choosing for 2 reasons. One – it uses .NET, which my ISP (DiscountASP.NET) supports, and the other is that it’s a rare blogging engine that does not require an external database, which my ISP, like most others, will charge me extra $ for.
So, here’s how I started. (This is assuming you have WebMatrix. If you don’t, go visit http://www.microsoft.com/web, and start there.)
When you launch WebMatrix, you’ll see the option to create a new application from the Web Application gallery:
Select this, and you’ll see the Web Application gallery dialog. Select BlogEngine.NET from there.
It will download and install. You’ll then see the WebMatrix workspace with the BlogEngine.NET application loaded.
Run the application using the application button, and you’ll see the default BlogEngine.NET page.
You’re up and running! Congratulations.
So, let’s take it a step further, and see what it takes to add a blog entry. Well, the default user is ‘admin’ and their password is ‘admin’, so sign in with those credentials, and you’ll see an ‘Add Entry’ item on the right hand side, in the Administration section.
When you select this, you’re taken to a web based HTML entry form. It’s pretty cool, and I’ll use it to write the first post, but I personally prefer Windows Live Writer, which you’ll see integrated with the site (hopefully) later on in this article. For now, enter something simple like ‘My First Blog Post’.
Press ‘Save Post’ when you’re done. You’ll be directed back to the blog post which has been safely written and is now being rendered by your page. Now you see that you have a working blog. Next, see what it takes to get it online.
On the site workspace in WebMatrix, there’s a link to ‘Need Hosting for your Web Site’. If you don’t already have a host, this is a great way to find new hosts that support WebMatrix fully.
If, like me, you already have a site, you can set up the remote publishing location for your website with the settings that your ISP gave you.
Publishing supports FTP, FTPS, SSL and WebDeploy. I’m using good old fashioned FTP, so I enter the server details in the Publishing settings dialog.
You see that you can click the ‘Validate Connection’ button to test it, and set the Site Root directly from within the dialog. Click ‘Publish’ and you’re off to the races. WebMatrix will upload your files.
First time around, it has a lot of files to upload, so it should take a while. A great feature of WebMatrix is the fact that it checks for differences before each upload, so subsequent ones will be MUCH quicker. Once it’s done uploading, your site should be good to go.
What happens next depends on your ISP. I use DiscountASP.NET, which allow me to make a folder on my server (in this case /blog), but ASP.NET needs this folder to be seen as an application by IIS before it can run. I haven’t done that yet, so I get this error.
That’s ok. No problem. Don’t Panic, I know where my towel is. My ISP gives me the option to change it easily, and I’m sure yours does too. If you’re not using DiscountASP.NET, check your ISP’s documentation for converting a folder to an application. With DiscountASP.NET, it’s really easy. Just sign into your account at their site, and select the ‘Web Application Tool’.
Select the folder, in this case ‘blog’, and click the ‘Install Application’ button.
It’ll take a few seconds to work its magic. When it’s done, go back to your site. Bada-bing, you got your first blog. Congratulations!
But wait! You’ve just uploaded a blog, and the entire world knows your user name and password. That’s not good! Go back to your local blog, running in WebMatrix and run it again. Log in with ‘admin’, ‘admin’ and change the admin password. You’ll see the ‘change password’ link at the bottom of the Administration section on the right hand side of the page.
Once you’ve changed the password, go back to WebMatrix, and click the Publish button. WebMatrix will crawl through your site, and find the changes that you’ve made.
Click Continue and only these files will be uploaded. Easy, and fast, right? Now when I go to my live blog at http://www.philotic.com/blog (or www.destinypress.net/blog) I can see that the Log In link doesn’t allow ‘admin/admin’, I have to use my new password instead. Yay!
Guess what? I can also integrate the blog now with Windows Live Writer (WLW). It’s easy. Just open WLW, add a new blog from another service, and enter the blog address (in this case http://www.philotic.com/blog) and the user name and password. You’re then good to go. I wrote this post in Word while working, and will now cut and paste to WLW, and publish….
- 10th August, 2010: Initial post