| Comments

A few days ago, I saw someone posted on Twitter a question about running WordPress on Windows Server.  Since I had done this for a few sites, I responded with my thoughts and tips.  Another suggested that I post those here, and so here I go.

WordPress is a blogging/content-management platform that has been around for a while.  It has been gaining more in popularity for general purpose content sites over the past year I’d say, but is primarily seen as a blogging platform by most.  Even though I use Subtext for my platform, I have to admit that if I hadn’t already started using Subtext, it would be really hard to sway me away from WordPress.  It’s just the killer app for blogging.  Why?  Because of the immense ecosystem of people using it, there is pretty much a plethora of plugins, themes and tools for it.

WordPress is a PHP application and mostly used on Linux environments.  But guess what—PHP has been running on Windows for years.  In fact, our IIS team created a FastCGI implementation for IIS to make PHP applications even run better on Windows.  So here’s how I got started…

Install WordPress

First you obviously need to install the pieces.  I’m assuming here you have access to the actual server.  WordPress requires PHP, MySQL and the WordPress bits themselves.  You can certainly hunt around for those yourself, or you can use the Web Platform Installer from Microsoft and install WordPress on your box in about 15 minutes including download time.  No hunting for the right bits, no tinkering for the right configs.  Just install WebPI, select WordPress and go.  Honestly, this is the best way to get it started on Windows.

After installing you should be up and running with a starting site.  Login to complete the process.

Decide on your permalinks or ‘pretty/clean URLs’

Here’s the main issue with WordPress on Windows.  By default Windows 2003 is still using ISAPI filters to process requests.  What this means is that it needs something to trigger the subsystem it will use to render.  In this case it’s .php for the php files of WordPress – IIS then knows to use PHP to render the files/logic.

However because of this the default pattern of WordPress URLs on Windows 2003 will be <domain>/?page_id=12345.  For everything.  That isn’t very clean or friendly according to the SEO experts. 

Now if you are installing WordPress on Windows 2008 and IIS7 the following does not apply to you.  IIS7 actually has built-in support for this and WordPress current versions recognize IIS7 installs and do the appropriate configuration for you!!!

If you want your URLs to be like <domain>/my-cool-page-title-name then you’ll have to do some hacking.  You can do a ton of high-tech stuff including actual new ISAPI filters to do some URL rewriting.  I chose the low-tech way: 404 handler.  You see if someone requests <domain>/some-page-name IIS won’t be able to find it and will generate a 404 message.  Luckily YOU control that 404 message.  I use a very simple 404 handler that I found online and modified ever-so-slightly.  You can download mine here: wp-404-handler.renametophp.  Simply put this in your WordPress root folder with all the other PHP pages.  Now in IIS Manager you’ll want to configure the IIS site to use your new custom 404 handler. 

WordPress 404 Handler Config

Just click the current one, choose URL and then type /wp-404-handler.php in there and you’re good to go.  Now you can go to the Permalinks section of the WordPress admin and choose “friendly” URLs.  Here’s what I typically use:

WordPress Permalink Config

Now anytime someone requests a friendly URL it will actually hit your 404 handler first, determine the right place and render the content – but keep the friendly URL in tact to the user!

At this point you can close your remote server session – all other routine tasks can be done via the web admin console.

Find Awesome Plugins

Finding plugins is VERY easy in WordPress – it’s in the administrative console of the app:

WordPress Plugin Search

Search for what you want and you can install right from the admin console – no need for FTP and unzip, etc.  Here is a list of my default plug-ins that I install (all of which you can search via your WordPress installation for more details and to directly install):

  • Akismet – comment spam tool
  • All-in-One SEO pack – tools for enhancing your SEO metadata for your posts/pages
  • Contact Form 7 – a typical contact form engine
  • Google XML Sitemaps – an auto generator of sitemap.xml files for search engine indexing
  • Internet Explorer 6 Upgrade warning – you know, to support the death to IE6 cause :-)
  • Really Simple Captcha – for contact forms to prevent robots.
  • WPTouch iPhone Theme – if you want an iPhone friendly theme
  • Silverlight for WordPress – to embed any Silverlight XAP in a post/page
  • Silverlight Media Player for WordPress – uses the Silverlight Media Framework for embedding video or IIS Smooth Streaming content.

There are TONS more, but these are my default that I always put on every site first.  If you want Twitter and other types of integration, they are there…just search for them.  There are currently over 9,500 plugins to choose from…amazing!

Find Awesome Themes

Whatever you do, don’t skip this step.  Don’t keep the default WordPress theme – it’s like any other default user interface thing on any software…it sucks.  Like plugins, there are a plethora of places to get awesome themes.  Here’s my default go-to list:

  • WooThemes – these guys are sweet.  Their menu system is actually going to be a part of WordPress 3.  Most of their themes are premium paid themes, but they do have a few free.  If you want high quality, check out these guys.
  • Themeforest.net – a larger selection of theme from various user-contributed designers and developers.  These aren’t free either, but for < $40 you can have a great quality looking theme.
  • wpsnap.com – these are free themes with community licenses.  There are some gems in here, but most are lower quality compared to the previous two recommendations.
  • WordPress theme gallery – explorable from the WordPress admin page in your installation there are a few in here (some repeats from wpsnap.com).  Usually aren’t the best to be honest.  My favorite for a cleaner default look is Journalist – it’s very basic, but clean looking and professional.

There is no excuse to have a crappy looking WordPress site no matter if you have no money, doing a blog, doing a content-managed site, etc. No excuse.  Spend 30 minutes and find a good template.  Guess what, it installs from the web admin console as well!!!

Author Content

While WordPress uses a web-based interface for authoring content, it isn’t required.  Windows Live Writer understands the WordPress API for both posts and pages and can be used as a rich client tool for authoring content.  It’s awesome together and I use it exclusively to author content for my WordPress sites.

Gotchas for running on Windows 2003

Ok, while I’m sure there are others, I really only found one big gotcha while running WordPress on Windows 2003 (that shouldn’t apply to the IIS7/Windows 2008 installations).  This involves plugins that do form posting.  A good example is a PayPal plugin that is a complete shopping-cart for PayPal (yes it’s in the plugin gallery and free).  Most plugin developers assume your installation is likely Linux.  If this assumption is made, postbacks for some plugins might not work if you use the clean/friendly URL 404 handler I talk about above.

Each plugin is going to be different, but you’ll likely have to modify the post action of that plugin to point more directly to that index.php?page_id=XXXX where your content page is.  I’ve only had to do this twice and It’s relatively painless.  One thing to keep in mind though is that as plugins update (you are alerted in your web console if a new version exists), your changes will likely be overwritten, so document them!

Extend WordPress yourself!

Since I’m a Silverlight guy, I wanted to make sure there were some good Silverlight plugins in the gallery.  The plugin developer process is very PHP driven so if you don’t know that, follow the CASE methodology (Copy Always Steal Everything).  You can learn from others.  I created my WordPress plugins for Silverlight very quickly.

Microsoft is also doing more with WordPress through the MIX labs team.  Check out their information on http://wordpress.visitmix.com for other tips and how, if you want, to run WordPress on SQL Server as well!

Summary

WordPress is awesome.  WordPress on Windows is also awesome.  Windows 2003 takes an additional tweak, but other than that it is very simple to get running and take advantage of this ecosystem.  What other WordPress on Windows tips do you have?

Hope this helps!


| Comments

As a follow-up to my Silverlight For WordPress plugin, I have just deployed Mark Heath’s Silverlight Audio Player as a WordPress plugin.  Thanks to Mark for changing his license to Ms-PL so that I could make this happen.  If you are a WordPress user and want to use Silverlight for audio playback, you use some WordPress macro language (in this case slaudio) and put it in.  The rendered output is like this:

Silverlight Audio Player for WordPress (collapsed)

And when you click the play button it expands:

Silverlight Audio Player for WordPress (expanded)

Again, most of the actual Silverlight work is Mark’s, so be sure to head on over to his project to thank him or if you find issues in the Silverlight player.  I’ll update the plugin whenever a new version of the player is released.

NOTE: A lot of people ask me if I’m running WordPress on this blog because of these plugins.  The answer is no.  I run the most awesome Subtext framework here.  I do have a few other sites that I use WordPress on.

To install in WordPress, simply search for the plugin in your admin dashboard under ‘silverlight’ and you will find it listed as Silverlight Audio Player for WordPress.  I’ve tested it on 2.8.5 but should work back to 2.2.x.

Hope this helps!

| Comments

I’ve made no hiding the fact that my blog is build on Subtext and that I’m very happy with it right now.  Lately though my wife has been blogging more (that’s another story) and she also started her own business.  Being curious about all the WordPress love, I decided to start checking it out.

Thankfully, the Web Platform Installer helped me get started on WordPress without any troubles at all and I was up and running on my Windows server (I didn’t want to start another hosting account anywhere).  I have to say, I really like what WordPress has done, especially with the extensibility points and the administration options. 

That being said, I started looking at the various plugins available and was curious about anything for Silverlight…to be able to easily put Silverlight content within a post like other plugins have enabled.  Sure, it isn’t a difficult task to begin with, but sometimes different hosts/tools make it difficult for us to add <object> type content.  After some searching in the WordPress plugin library, I found one that was built back in the Silverlight 2 beta days.  The link to the author was no longer valid so I decided to create one using that as a base.

NOTE: I totally failed my Internet duties to look via any search for one…I kept my searching to the official plugin directory.  Apologies to Peter Loebel for not recognizing he also did some work, but admittedly it was also during the beta days.  I’ve credited both Peter and Juergen Oberngruberin my readme.txt for the plugin as contributors.

So after a few minutes, I was able to get it working and created the Silverlight for WordPress plugin.  It’s simple and you basically can input into your post data:

   1: [silverlight: <app>, <width>, <height>, <initParams>, <minVer>]

Where:

  • app is the URI to your Silverlight application (XAP)
  • width/height should be obvious
  • initParams will map to the initParams of your application
  • minVer maps to the minRuntimeVersion required for your app

The only parameter required is <app> and all others are optional and have defaults which you can change via the plugin settings:

Silverlight for WordPress default settings

I’ve applied yesterday to put the plugin in the official WordPress plugin directory, but haven’t heard back yet and they don’t really have any SLA.  I’m hoping to get it in soon, because they have a good discovery model for updates, etc. and authors can install in one click.  For now, I’m also going to maintain a link to the current version with release notes on my site here: Silverlight for WordPress.

UPDATE: Silverlight for WordPress is now available in the plugins directory…just search on Silverlight.

Like I said, it’s simple (and perhaps dumb to some), but I look to your input.  Hopefully some WordPress authors may be able to use it.  I know my wife’s new photography site will :-).

Hope this helps!


This work is licensed under a Creative Commons Attribution By license.

| Comments

After looking at the options available for WordPress plugins for Silverlight, I found one that was outdated and the author’s URL looked to be broken.  So I adapted/updated the plugin to work again.

I’ve now provided the Silverlight Plugin for WordPress for an easy way to host Silverlight applications within your WordPress content.  You can get the plugin via the WordPress plugin directory by searching on Silverlight or clicking here.

Once downloaded, unzip the contents in your /wp-content/plugins directory.  You’ll then be able to activate the plugin and start working with it.  Adding content is as simple as adding this text to your post:

[silverlight: myapp.xap]

And you will have your content in your post.  You can optionally specify the width, height and minimum Silverlight version required.

Version 1.0.3 (31 MAR 2009) includes:

  • Ability to add local/absolute Silverlight applications (XAP)
  • Optionally set width/height/minRuntimeVersion of the Silverlight host plugin
  • Optionally provide initParams to the plugin

Silverlight Media Player (new 2010!)

I also have a Silverlight Media Player for WordPress which is built on top of the Silverlight Media Framework.  It is also as simple as tagging content and supports any Silverlight-supported video type, including IIS Smooth Streaming:

[sl-media: http://mysite.com/myhomemovie.mp4]

You can find this and the installation/configuration details page in the WordPress plugin directory as well!

Please leave a comment for things you’d like to see or bugs you find!


This work is licensed under a Creative Commons Attribution By license.

| Comments

Ok I’ve seen all the announcements and read all the buzz.  I know some folks on the team as well and had heard all their raving about their offering.  It wasn’t until today where I really realized what was going on.  In fact I was thinking about titling this post: WordPress installed and configured in under 5 minutes, but it’s much more than just that.

Introducing: Web Platform Installer 2.

The team at Microsoft has been working hard to make getting your web platform (server and client) up and running quickly and taking any pain out of the process.  In one click you can have Visual Studio and Silverlight Tools installed, IIS7 configured, Smooth Streaming enabled, etc.

But it’s much more than just that.  You see the team partnered with the community and popular Open Source projects to provide much more than just Microsoft offerings.  Earlier today I wanted to check out WordPress templates in more detail and wanted them on my own server.  Let me set the stage for you.  My server is Windows 2003, IIS6, and has no SQL Server installed.  That’s it…a bare web vanilla front end.  I fired up WebPI (as it is affectionately known) and look what you see:

Web Platform Installer Applications

That’s right, WordPress as an offering.  No, not some hacked “run as .NET” version of WordPress.  The real deal from the WordPress project site…Microsoft hosts nothing but a simple manifest describing the project.  I selected WordPress and the tool knew what was missing from my environment: MySQL, PHP, FastCGI, etc. 

WordPress Install dependencies

I clicked “install” and literally in about less than 10 minutes I was running WordPress.  I’m not saying “installed” or downloaded.  In fact most of the time of that 10 minutes was from downloading the various bits.  When the “You’re finished” message came up, I had a working WordPress site, configured to MySQL, configured with a content database, etc.  I had to do nothing to configure my MySQL settings, I had to do nothing to my get PHP running on my site…WebPI did it all for me.  It was totally friction free.

It’s not just WordPress either.  Drupal, Umbraco, DasBlog, Subtext, ScrewTurn Wiki, etc.  And you can put your app there as well.  It really is a great resource not only for server components but also for client web platform stuff like I mentioned previously for Visual Studio and Silverlight developer tools.

Great job to this team and you all should definitely check it out.  They really did a good job.  My server didn’t get screwed up at all and everything “just worked.”  I think this installs WordPress faster than WordPress instructions! :-)