Microsoft’s WebMatrix is a
freely available development tool that lowers the barriers to creating Websites
atop the company’s Windows operating system and IIS Web server tandem, both in
terms of locating and installing needed components, and coding data-driven Websites.
Predictably enough,
WebMatrix fills out the Windows and Internet Information Services stack with
Microsoft’s SQL Server database and .Net application-development components,
but the tool makes it fairly easy to swap out these latter layers for open-source
MySQL database and PHP scripting language.
In fact, one of the most
impressive aspects of WebMatrix turns on its support of these and other open-source
projects, which the product exposes in the form of a Web Gallery feature that
offers one of the simplest paths I’ve seen to minting new Websites based on
popular open-source projects such as Wordpress or Drupal.
With that said, I did
experience a handful of snags during my tests with WebMatrix and MySQL,
although nothing that a couple of workarounds couldn’t address. Somewhat
trickier is the product’s affinity for SQL Server Compact Edition, which offers
a smooth transition up to full-sized SQL Server, but suffers from a surprising
lack of migration tools or of integration with the rest of Microsoft’s
application family.
I can recommend WebMatrix
without hesitation to Windows users interested in exploring the wealth of
open-source Web-application projects available and in getting started with
Microsoft-centric Web development. I would love to see WebMatrix offer a broader
set of deployment options; the tool benefits significantly from its embrace of
PHP and MySQL, and would further benefit from support for additional open
source-components such as Mono, Linux and Apache.
Browsing the Gallery
After downloading
WebMatrix (from microsoft.com/web/webmatrix), installing the application on my
Window 7 64-bit test virtual machine, I turned first to the tool’s Web Gallery
feature, which listed 41 different open-source Web-application projects powered
by some combination of .Net, PHP, MySQL and SQL Server. I opted to install Wordpress
3.0, and after giving my Wordpress site-to-be a name, WebMatrix set about
downloading the necessary dependencies—Wordpress, PHP, MySQL and a .Net MySQL
connector.
It was here that I hit my
first snag. The transfer rate I experienced while downloading the MySQL
elements was extremely slow, so I canceled and restarted the process in the
hope that WebMatrix would switch to a faster mirror. Although I restarted the
process several times, WebMatrix always chose the same, slow mirror. I’d like
to see WebMatrix include some capability for spreading downloads across the
available mirrors. I downloaded and installed the two MySQL components
manually, and let WebMatrix pull down the remaining dependencies.
With that initial
dependency hiccup behind me, my Wordpress installation proceeded without issue.
WebMatrix had downloaded a slightly old version of Wordpress, 3.0.3, rather
than the current 3.0.4 version. However, I was able to upgrade to the latest
release through the Wordpress admin console just as I would with any other
installation of the blogging software.
WebMatrix offers a basic,
usable interface for editing the files that comprise a Website, complete with
code highlighting. It was easy, for instance, to sort out the PHP bits from the
HTML elements in my Wordpress files. I made changes to the files—removing, for
instance, the site title from the header of the default Wordpress theme—saved
my edits and saw the changes live on the IIS instance running on my test
machine.
I installed a handful of
other projects from the gallery, with similar results—WebMatrix made the
download and configuration processes very easy, and having set up MySQL on my
test machine once, I didn’t have to do it again. I initially was blocked from
installing the open-source CRM project SugarCRM from the gallery due to a
mismatched file signature, but when I tried again a few days later, that issue
had been resolved.
Roll Your Own
In addition to its Web
Gallery feature, WebMatrix offers options for building sites from scratch,
based either on a series of packaged templates or on blank projects. I was
particularly interested in trying out Razor, a syntax and methodology for
mixing C# code in with HTML in pages to be served by IIS. I chose a fairly
simple test case—writing out a bulleted list of eWEEK Labs stories from a
database I use to track our work.
As it turned out, the
coding portion of this couldn’t have been much simpler: I pointed to my chosen
database and query in the page I was writing, and mixed in with my bullet-list
HTML a bit of C# code to iterate through the query results and print them out
in a list.
Much tougher was the task
of getting my data source straightened out. The WebMatrix UI makes it very easy
to create a new SQL Server Compact Edition database, but offers no tools for
populating a SQL CE database with existing data. It makes sense to offer a
single-file database option with WebMatrix, but SQLite, for which an ODBC
driver is available, would serve this function better than SQL CE does.
I turned instead to the
MySQL instance I’d already installed on my test machine, which was easy to
populate with data, and easy to connect to my WebMatrix site. I used the
Database portion of the WebMatrix interface to query the data source and get my
SQL statement squared away. When it came to testing out my page, however, I
could not get the simple code I’d written to work. It turns out that the
problem was another snag in WebMatrix’s MySQL dependency handling. I had to
manually upgrade from the 6.2.3 version of the MySQL .Net connector that the
product specifies to the newer, 6.3.6 version of the connector.
Reports and Tools
For both the
“roll-your-own” and Web Gallery project types, WebMatrix offers a handful of
useful tools, including a feature that scans for and highlights potential
search-engine-optimization issues in your project code. From this report, I was
able to click through to the specific files in question and make the suggested
tweaks.
WebMatrix also offers a
handy view into the contents of the Web page requests that travel back and
forth from browser to server, which can be very helpful when debugging page
issues.