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!


Thawte logoAnd the offers keep coming in!  Another one of our key partners for testing XAP signing for trusted applications was Thawte.  Their group helped provide us with valid certificates to verify their process and signing worked as expected (and verified) for Silverlight 4.  Today I just got an email from their marketing department that they would like to offer Silverlight developers a discount on Thawte code-signing certificates to $89 for a 1-year…about 70% off their current rate.  That’s pretty amazing of them to do.

Here’s their terms and details on how to get it…

Terms

  • For developers of XAP code for Microsoft Silverlight 4
  • Get a single-year code signing certificate for US $89 (over 70% off), or a two-year code signing certificate for US $178 (over 67% off)
  • For new Microsoft Authenticode code signing certificates or renewal of existing Microsoft Authenticode certificates
  • Enter promotional code MSSILVER when prompted during certificate enrollment/renewal
  • Offer expires 01-June-2010, so chop-chop!

How to get the certificate

  • Have your enrollment information and credit card ready, and go to http://www.thawte.com/code-signing
  • In the Thawte Code Signing Certificate for Microsoft Authenticode section, select the certificate term desired (1 year or 2 years), then click either Buy or Renew.
  • This will launch Thawte Certificate Center, where customers enroll for and manage their SSL and code signing certificates.
  • The first page will confirm your choice of code type and certificate validity period.
  • At the bottom of the page, enter the promotional code MSSILVER. Click the yellow Continue button to see the updated (lower) price applied in real-time.
  • Simply continue the process to complete the certificate enrollment.
  • The authentication process usually takes about 2 weekdays. Thawte will keep you updated throughout the process.

NOTE: I will say that I recall the Thawte certificate process requiring IE7 or earlier and it did not work well with IE8/Win7.  It actually issued, but there was no way to export the PFX.  Please heed this advice.  Fire up Windows XP Virtual PC like I did and issue the request and use the same machine to pick it up and export.  This is, of course, unless they have indicated they’ve got it working on IE8 now.

Other conditions and stuff to know…

  • Thawte code signing certificates are issued to organizations for a specific type of code, such as (in this case) Microsoft Authenticode which will cover XAP developers. Since the certificate is issued to the organization and not the code, the certificate can be used to sign any instance of that type of code generated by the organization, over the entire lifespan of the certificate.
  • Thawte code signing certificates follow an authentication process which is very similar to the organization authentication process for Thawte SSL Web Server Certificates, which usually takes about 2 weekdays. Because the organization authentication process is so similar, customers who already have at least one active Thawte SSL certificate will save time, as their organization has already been authenticated.
  • To confirm eligibility for the offer, Thawte’s sales or authentication representatives may require verification that the customer is developing XAP code for Silverlight.

Before you start laying on the comments below, yes we all know there are a multitude of ways to get these certificates.  Thawte reached out to me to ensure that Silverlight developers are aware they can get this promotional discount as well.  If you are an existing Thawte customer you can renew your certificate as indicated in the terms above.  If you have questions, please contact their customer service area.

For more information on XAP signing and the reasons/benefits see these posts:

Thanks to Thawte for extending this promotion!


There are a few ways to give feedback on Silverlight.  I wanted to share my thoughts on them as some are obvious and some aren’t.

Forums

The product team and test team regularly monitor the Silverlight Forums.  It is a great place to get your questions answered by other experts, community members and perhaps the product team directly.  This is a good place to search for previous questions as well.

Report a bug

If you’ve scoured the forums, posted your question and didn’t get any answer and you think you’ve identified a bug, you can submit one.  I’ll admit here this is a cumbersome process.  We’re trying to improve it, I promise.  I’ve been on some user studies with this team giving them feedback on that.  Until then, here’s what you’d have to do:

  1. Visit http://connect.microsoft.com/visualstudio (you have to have a Live ID to login)
  2. Create a new issue under Visual Studio 2010 and .NET 4
  3. In that template you’ll see a drop-down list for Visual Studio Version – here select your version of Silverlight (3 or 4)
  4. Complete the rest of the form.

Yes, I know it may seem odd, but for now that is a part of the process.  If you submit a bug, be prepared to submit a reproduction of the bug.  I can’t stress enough this fact: providing a reproducible project showing the potential bug is the fastest route to resolution.

Got a suggestion for the future versions?

Here’s my favorite part.  If you think you’ve got a suggestion (not a bug) and want it on the wish list, then add it!

Visit http://silverlight.mswish.net to add your suggestions.  Here is what I ask of you:

  • SEARCH FIRST using simple terms.  Duplicates suck.  Add your votes to something that already exists first.  If you search for “I think printing should work with bilateral PNG fusion” then you may not find anything.  But if you search “printing” there may be a suggestion already logged for you to add your votes to.
  • BE VAGUELY SPECIFIC.  This is a tough one.  Ensure you don’t make a suggestion that boxes everyone else out from voting.  Example: Printing sucks, fix it. is not a good suggestion.  It’s too vague and doesn’t help.  Meanwhile Printing should include automatic pagination is a much better suggestion.
  • DON’T PUT MULTIPLE SUGGESTIONS IN ONE.  Don’t add a suggestion that is actually multiple.  Example of a bad one: Change printing, implement modal and add transparent windows is actually 3 different suggestions.

The team looks at this list to help prioritize and understand how people are using this.  This list is always there and we’ll mark things planned/completed when we identify what we’ll be working on.

Blogs

As always if you see something on my blog or other Silverlight team members’ blogs, leave a comment.  We don’t go around announcing each other’s blog posts so if you send me a question about something David Poll wrote…it’s better to start with him first.  Blogs are great sources of information but also can be hard to find specific bits of information at time.  They are a mechanism for sharing bits and pieces.  Usually you’ll find deep feature content from a program manager who owns that feature.

Hope this helps!


NOW OFFICIALLY RELEASED: DOWNLOAD HERE

A while back I posted a sneak peek preview of 3 new themes that we were working on for Silverlight 4 applications.  Our team wanted to do more than just the overall base theme and provide the themes for the core, SDK and some Silverlight Toolkit controls as well.  In addition, there was a lot of internal chatter about how cool these new themes were and a lot of teams wanting to adopt them as default, including WCF RIA Services.

While we finalize a better distribution plan for these templates (and some may show up as defaults soon), I wanted to provide a raw drop of the sample project we use to display the themes.  These projects have the Silverlight ResourceDictionary files for the themes and a few pages showing samples.  These are raw theme project files.  And without further adieu, I present the bits for you:

Grayscale Theme

This theme is a clean implementation that initially has a ‘greenscale’ approach to it, but modifying the brushes even slightly will give you some great color pallettes to work with.

Silverlight 4 Theme - Grayscale

Honestly, initially this one didn’t pop for me as much, but the fit-n-finish added here is really making me like this structure.  And the ability to change a single brush and have it replicate through other areas makes this clean template highly customizable.

Windows Theme

Want a theme for your application to look a bit more native?  Here’s a starter place for you. 

Silverlight 4 Theme - Windows

Cosmopolitan Theme (formerly Metro)

And finally the most popular requested, we’re calling Cosmopolitan.  This one has features that resemble the Zune and Windows Phone design language aspects of it in a modern, clean UI form.

Silverlight 4 Theme - Cosmopolitan

This theme also has a ToUpper and ToLower behavior files that you can apply to your XAML for text formatting.

How these raw projects are structured

As I mentioned, these are raw project structures…ripped from the designer’s desktop, zipped and presented here.  There may be dependencies that you don’t have and will need (i.e., Toolkit, etc.).  There may be residual test files in there.  Deal with it :-).  But at the basics the core themes are all structured as ResourceDictionary files in the Assets folder:

Theme project structure

As you can see in here the files should be relatively self-explanatory.   We tried to make it so that you can pick and choose what you’d like from them (as well as learn how to segment out these types of dictionary files).

In each project you will also see the themes represented in showing: core controls, sdk controls and toolkit controls.  Please make sure to appreciate all of them.  I didn’t post screenshots of all here.

The future deployment of these themes/templates

The idea is that we’ll clean these up in a more distributable manner.  We’ll likely create VSIX files (Visual Studio extension installers) so that you could then say File…New Silverlight Cosmopolitan Application and have these already in there.  This also allows us to put them in the Visual Studio Gallery where you can search/download directly to Visual Studio.  We also will likely put the resources on the Expression Gallery for download.  And as I mentioned before, it’s possible that future iterations of things like WCF RIA Services and such might use them as default.  You tell me: what is the best distribution method?  How would you expect to download/install/use these?

Summary

I love these new themes.  I think our design team did a great job here.  Tsitsi and Corrina are awesome and put a lot of work into refining these.  By the feedback that I’ve been getting in email and blog comments, these are exactly the type of things that you’ve been wanting.  Mostly from developers I’m hearing the thank you for helping me since I have no design skills!  This is great feedback that our team loves to hear.  I hope you find these valuable.

These raw project templates here are essentially the Silverlight Navigation Application template modified.  We’ll have the biz app ones a while later, but these should get you started.

Hope this helps!


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

While working on some plugins for the new Seesmic Desktop Platform I got sick of copying and pasting some boiler plate code over and over.  I had created some helper templates for myself so that I could say File…New Seesmic Desktop Plugin and get everything I needed initially.  This weekend I had some time and formalized those templates into an easy-to-use installer for anyone to consume. 

NOTE: It is likely that Seesmic themselves will create developer project/item templates…these were for my own use and I shared them on the Seesmic Desktop Platform developer forum for anyone to benefit from (or ignore).  They are not the official templates from Seesmic.

Prior to VS2010 you could create what is called a Visual Studio Community Content Installer…which is a .VSI file that installs things like snippets, etc.  And actually you can still do that today.  The process is manual and involves a few XML manifest files, zipping up the contents and renaming it to .VSI (the VSI is just a ZIP format).  It isn’t hard, but isn’t painless as well – it’s a lot of manual steps.

Enter VS2010 and the Visual Studio SDK.  First, the items I am describing below require you to have the VS2010 SDK installed.  It is NOT installed by default.  Visual Studio 2010 has a file format called VSIX which is basically a Visual Studio Extension (VSX was already taken by Visio).  This extension format is intended to be a one-stop installer format for all things extensible.  Things like add-ins, etc.  But it can also be used for simple things like Item and Project template types.  Here’s what I did.

1. Starting the project

After you have VS2010 SDK installed, choose File…New VSIX Project

VSIX Project

Note that this is under a language area (C# or Visual Basic).  This is because there is some assumption that you are creating more than just a template deployer…but just note that.  In my instance it actually didn’t matter what language area I chose.

2. Removing ‘binary’ packages

By default the VSIX project thinks you are going to be creating code extensions and will package the project’s DLL and PDB files as a part of your extension.  If you are using this process as I was for template extensions, this is not necessary.  There is an easy way of avoiding this.  Open up the csproj file (or vbproj) you just created in notepad and add these lines in the XML file:

   1: <PropertyGroup>
   2:   <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
   3:   <CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
   4: </PropertyGroup>

This tells the compiler to not package those types of files into our extension.  I put these below my last PropertyGroup statement in the file.  Save the proj file.  If you return to Visual Studio (and had the project open while making these edits in notepad) you’ll be alerted to reload the project, go ahead and reload baby.

3. Editing the manfiest information

When you create the project it will open up with a dialog that is a visual editor to the core manifest.  This is where you will put your metadata as well as begin to add your content.  Here is a snapshot of mine:

VSIX Manifest Editor

Notice the simple metadata information (name, author, version, etc.).  This is important information that I’d highly recommend to include as you’ll see why in later steps.

Notice the Content area in the bottom.  This is where you’ll add your content.  If you have a blank project you will click the Add Content button and choose the type (in my case Project Template and Item Template) and browse to the file.  Note that this copies that file to this project…not a reference.  So if you change the file outside of this project, you’ll want to update it again.  Do this for each template type you want to deploy.

4. Understanding Path information for templates

Notice my path of my templates:

template path data

This is important because it will determine how the templates are structured in Visual Studio after the user installs them.  My path above results in this:

Installed Templates view

This enables my users to find it under Silverlight as well as the custom branch that I have specified.  This is a helpful tip to your users and provides a more professional look in my opinion.

5.  Building the VSIX file

This step is easy.  F5.  It’s the same build process as any other project type.  The result is a VSIX file.  When the user double-clicks on that (and has Visual Studio installed) they’ll see your dialog:

VSIX Install Dialog

You could optionally digitally sign your VSIX file so the ‘unidentified publisher’ statement isn’t there.

6.  Making your VSIX Discoverable

This is the fun part.  Now that you have a standard Visual Studio Extension, you can make it readily available to any Visual Studio developer.  You could simply post a link to it on your blog, have the user download the VSIX and that is acceptable.  But you can also make it available in Visual Studio’s online gallery which then becomes searchable and seamlessly installable by end users.

Visit the Visual Studio Gallery page to start the process.  Notice the Upload button in the upper right area…that is where you start.  After authenticating with Windows Live ID, it is a 3 step process:

  1. Determine what type (Tool, Control, Template)
  2. Upload the VSIX
  3. Edit and annotate further criteria

The first two steps are simple, in my case I chose Template, then uploaded my VSIX which goes through some steps of validation making sure it is a valid VSIX file.  The final step enables you to specify more data that is annotating your extension to make it more searchable.  Here was my page.

Visual Studio Gallery info page

Notice the tags I added to help it be discoverable?  Now users can – from within Visual Studio 2010 – search and install extensions immediately:

Integrated extension search in Visual Studio

Any installed extensions show up in the Extension Manager (Tools menu) for easy disabling or uninstalling).

Summary

After this quick process I have a distributed package for my community as well as now have added templates to my development environment making it easy to create new extensions for Seesmic (my sample used here):

new project templates

It was fairly simple and I love that it is integrated into Visual Studio 2010 for everyone now!

Hope this helps!