I’ve been playing with WebMatrix quite a bit and wanted to see how long it would take to get a blog application configured and published to a host. Laurence had a great experience configuring BlogEngine.NET with WebMatrix, so I thought I’d try the popular WordPress blog platform. I was surprised how easy it was to not only get configured on my local machine, but then upload to a host.

Why not WordPress.com?

You might ask why not just go to WordPress.com and start a blog? That’s a great question and using an existing blog host is the easiest way to start any blog. I wanted to host my own WordPress blog for a few reasons. I didn’t want to transfer my domain to WordPress and I want more control over my WordPress configuration. By downloading with WebMatrix to my computer first, I can tinker and change the blog before publishing it out to my host.

What is WebMatrix?

WebMatrix is an easy way to get started with web development on Windows. It takes the pain out of getting your computer configured to run popular web applications like WordPress. It also includes powerful deployment software to make uploading your work to a host very simple. You can read more about WebMatrix at http://www.microsoft.com/web/webmatrix/ Install WebMatrix from here: http://www.microsoft.com/web/webmatrix/download/

Getting Started

After you have WebMatrix installed, launch it and you’ll see the following welcome screen: image To create a web site using a popular web application, click the Site From Web Gallery option.image  You’ll see a list of options for lots of popular web applications. Select WordPress and click Next. image The next several screens will walk you through the configuration of MySQL (the default database for WordPress) and the WordPress software. First, you can choose whether to install MySQL locally or use an instance of MySQL on another computer. I chose to install it locally. image Because I’m installing locally, I need to define a password for the MySQL admin account. Remember this password, because you’ll need it in a minute. image The next screen allows you to read the End User License Agreements for each of the pieces of software and then accept them in one click. image Now that MySQL is installed, WebMatrix will create the WordPress database for you. This screen asks you for some basic information. In most cases you can use the defaults. You do need to define a Database password for the WordPress database and also enter the MySQL administrator password you defined earlier. image The last four questions ask for unique keys to further protect the passwords that will be stored in the database. You can simply type in random sentences here, or you can use a the security key generator from wordpress.org for more secure keys. Click the URL and it will generate keys for you. Copy each key into text boxes – it does not matter which order and you do not need to remember the keys. image Finally, you’ll see the screen that shows you’ve successfully installed WordPress. image Click, OK and you’ll be taken to the WebMatrix site page where you can begin working with you’re new WordPress blog. You can launch WordPress by clicking the http://localhost:#### Url shown at the top of the page. image Once you’ve launched your blog, you can click through the intial WordPress screens. WordPress will ask you for a name for your blog and your email address. Then it will generate an Admin password for you. You should use this password to log in the first time and then immediately change it to something you will remember. image Now you can tinker with WordPress and get it setup the way you want.

Publishing Your WordPress Blog to a Host

Once you are done getting your WordPress blog setup, you will want to publish it to a host. WebMatrix makes this really easy. Click the Publish button in the tab bar and choose Find Web Hosting. You’ll see a list of several web hosting providers which you can research and choose from. Click the provider and sign up for an account. imageimage Once you’ve signed up for a hosting account and received your account information, click the Publish button again and choose Configure. Enter the information sent to you by your hosting provider. Click Validate Connection to test that you are able to connect to the hosting provider. For the Database configuration, you’ll need to enter a connection string. Some of the hosts will require you to create a database using their control panel. Once you have the information, create a connection string like the following and enter into the configuration in WebMatrix: Server=SERVER_NAME;Database=DATABASE_NAME;Uid=DATABASE_USER;Password=DATABASE_PASSWORD imageimage When you are ready, click Publish. WebMatrix will compare you’re local files to the ones on the server and tell you what changes need to be made. Of course, on this first upload all of the files are new. Check the database checkbox so that the database is upload. Click Continue to start the process. image You can monitor the publishing process at the bottom of the WebMatrix window. Once it is complete, you’ll see a message like the following: image Now click the Go to link to see your blog running at the hosting provider.

Now What?

WebMatrix is a great tool for getting popular web applications downloaded, configured, and then published to a host. However, it also is a great tool for writing code. With WordPress configured, you can now use WebMatrix to create plugins and themes for WordPress or create additonal PHP or ASP.NET pages (they can be mixed in the same site). To get started writing code, click the Files button in the left-side panel of WebMatrix. Expand wp-content and you’ll see