Windows Web Hosting, Web Technologies, etc
Web Applications
Introducing WebMatrix a new way to publish
Jul 6th
I’m excited to announce that Applied Innovations has partnered with Microsoft and is providing free beta hosting for WebMatrix users. If you’re not familiar with WebMatrix, (that’s probably because it was launched less than an hour ago), let me bring you up to speed.
WebMatrix is a new, easy to use tool from Microsoft that integrates a web server, a file based database server, the web application gallery and as ScottGu put it: “A new view-engine option for ASP.NET that enables a code-focused templating syntax optimized around HTML generation” (that’s fancy talk for you can embed ASP.NET commands right inside your HTML markup).
What makes WebMatrix Cool?
So WebMatrix is one of those tools that makes building new websites for guys like me really easy. You see, I can’t code C# to get save my life (I try but I realize it’s a hack job). What I can do though is take an off the shelf product like WordPress and make it pretty bad ass!. That’s what WebMatrix will help me do.
Everyone knows I love WordPress. It’s one of those tools let’s a guy like me throw up a quick website and make it look really professional. A great example of this is, www.terryhoffconstruction.com. Terry’s my cousin and builds beautiful homes for a living. His previous website became dated and was difficult for them to manage. So I thought “Hey, we can throw a nice WordPress theme on that site, a couple modifications and have a really nice, professional website” and thus 2 hours later we had Terry’s new website built, deployed and ready to go live. I’m lucky because I have access to 2000 web servers and just have to spin up a new site or a new VPS server and can build, test and deploy a site like this in no time. But for someone that doesn’t have unlimited access to a thousands of servers, it’s not so easy.
That’s where WebMatrix comes in for you and why it’s cool. WebMatrix will install the IIS Developer Express server for you, connects to the Web Application Gallery (Part of the WebPI) and let you build a new website on any of a number of open source applications. If you don’t have something that’s required for your particular application (like MySQL or PHP installed) no worries, it will go out download it, install it and configure it all for you with just a click or two. Then you’ll be able to build a new website on your local machine in no time! But let me show you.
Building a local WordPress site with WebMatrix
When you start WebMatrix you’ll get a few options as seen below:
I’m going to open to install a site from the Web Gallery and it’s going to give me a list of over 2 dozen different applications I can install:
I’m going to build a WordPress site so I highlight WordPress and click next and this brings me to a screen that tells me what I’m missing (I’ve already installed PHP and MySQL on my dev machine otherwise it will let me know I needed to download and install those too):
After I click “I accept”, it goes out, downloads the installation pack and then asks me for some application specific entries (in this case, it’s my MySQL database info):
Runs for a little while
and then .. BA-BAM!! All done:
And see that installer log? If it runs into any problems, you can view the log and see where it ran into a problem (like if you typed the wrong MySQL root password .. not that I did that before or anything
)
Now that it’s built my screen looks like this
and if I click on the link http://localhost:38623 there I will see my wordpress site:
Run through the wizard and my new WordPress site is ready to build out locally. Now I can add my themes, my plugins, test it out, make sure everything is ready go and then when I’m done locally go ahead and deploy it.
Deploying my WordPress site with WebMatrix
Before I can deploy my site, I’ll need WebMatrix Hosting. I’m going to head over to http://www.appliedi.net/webmatrix and signup for a free WebMatrix hosting account. After I signup I’ll get an email with my information. Since I plan to connect my WordPress site to a MySQL database I’ll need to log into my control panel and create the MySQL database first (don’t worry instructions on how to do all of this is included in the welcome email).
Then I’m going to start the deployment process. First thing I’m going to do is select the configure publishing settings by click on the arrow below the publish icon:
Then I’ll review my Welcome email with instructions on how to publish using Web Deploy:
I’ll also want to go ahead and publish my Database so I’ll enter my connection string:
As I was instructed to do in the welcome email:
So my entire screen looks like the below image:
I’ll click the “Validate Connection” to make sure my publish is going to happen correctly. and then click the Publish button.
It’s going to check and see what files need to be updated:
And then I’ll tell it to publish everything INCLUDING the MySQL database (let’s see your other web editor do that for you!)
After I click publish it starts doing it’s work:
And then in a few minutes… My publish is completed
and if I click the link…
My WordPress site is installed and ready to go.. But don’t just take my word for it. Go check it out yourself: http://testall.web01.appliedi-labs.net/
Windows Hosting or Linux Hosting? Which runs PHP Faster?
Aug 6th
This is one of those questions everyone and their brother tries to answer and it seems in the 10 years we’ve been offering web hosting at the question is still the same and the answers are still the same BS 10 year old answers.. Typically you hear responses from the advocates of Linux over Windows such as these:
- Keep Microsoft for Microsoft and Use Linux for everything else. (yeah those days are over. Unlock the doors and come outside, Y2K never happened and it’s not going to.)
- PHP is faster on Linux, it’s optimized for Linux and will NEVER run on Windows. I know because I’m a uber-hacker and have my own apartment (in the basement of my mommy’s house.. er I mean my room-mate!)
- Windows Hosting is more expensive than Linux hosting. (Until it breaks and you need to call support but your site is down for 3 days while you try to get support off some usenet feed… Then which is more expensive?)
Well, I’m a big fan of benchmarking things and just testing this for yourself. Of course ever since my Virtuozzo versus VMware versus VirtualPC comparison where all of VMware wanted to take me outside and have me drawn and quartered, I’ve decided to not post such comparisons. Fortunately for us Joe was kind of enough to run such a comparison (using the exact same machine you VMware fan-boys) and really compare PHP on Windows and Linux as well as ASP.NET on both. I’m not going to repeat his results you can see it on his blog. But the long and short of it is:
- ASP.NET rules the world of performance…
- PHP 5.3 on Windows is as fast or faster than it is on Linux. Did you hear that? PHP 5.3 on Windows is as fast or faster as it is on Linux.
- MySQL on Windows is slower than it is on Linux (Which we knew from our own experiences)
- PostGreSQL is comparable on both.. I never even considered looking at PostGreSQL.
- the MS SQL PHP driver is slightly slower than MySQL (but version 2.0 is in the works and will hopefully address this).
So there you have it you you whiny little school girls that insist PHP runs like crap on Windows and why would you ever use Windows Hosting for PHP or for anything (I’m not calling out any names but you know who I’m talking to). Microsoft has stepped up and leveled the playing field with PHP.
If you’re curious what work has been done in this area, Mai-Lan from the IIS team has a nice write up on it.
So that’s the word. Microsoft has recompiled PHP5.3 and helped optimized it for Windows. Now the Windows-Haters will have to find another reason to complain.
Hey to celebrate the increased performance and Joe Stagner stepping up to show the world that Windows IS good for PHP and doing an informal benchmark on his own. Here’s a coupon code that’s good for 25% off your first hosting term on any shared Windows hosting or Windows VPS hosting package good for the month of August: JoeRocks25. You can thank Joe for inspiring the great discount and go subscribe to his blog I do!
The easy way to create your first WordPress Theme.
May 6th
Tired of trying to find just the right wordpress theme? There’s millions of them to choose from afterall. Would love to create your own but have less artistic talent now than you did in Kindergarten with a box of busted chunks of crayolas? (You know what I’m talking about. First week of school you had brand new Crayolas by the second week they were all bits and pieces and nubs)
Well No worries! Artisteer to the the rescue! If you can use word, if you can click a couple buttons you can create your own WordPress theme with ease.
Creating your first wordpress theme is as easy as 1, 2, 3
After you download and install Artisteer you’ll want to run (uh duh, tell me something I didn’t know Jess). You’ll be prompted to pick what kind of theme you want to create and it supports more than just WordPress. In fact today it supports WordPress, Joomla, Drupal, an HTML template, an ASP.NET Application and a CodeCharge Studio Template (CodeCharge is for wannabe programmers just like us wannabe artists, I’ll talk about it in the next series and yeah, I use it too and no real programmers use it too).
Here’s the startup screen:
You’ll select WordPress and then get a screen like this:
Now with absolutely ZERO artistic ability and effort. I could export that theme and have just created my first WordPress theme. Let me show you how.
First you’ll click on the Export Button on the top right. and it will prompt you with a screen:
You’ll give it a name and set a path to where you want it to export to as I did above and then click the OK button to let the magic happen. Open up that folder you had it export to and ta-dah! There it is:
That’s it upload that folder to your wwwroot/wp-content/themes folder and you’ve got your own theme installed and ready to go.
Here’s my blog right now (that uses an artisteer theme)
and Here’s my blog with that new theme we just created selected as the theme to use:
Just as easy as 1, 2, 3 I was able to completely change up my blog’s design.
Making the Artisteer theme, your theme.
Here’s the thing. I don’t really care for the yellow sunburst, the palm trees or general layout of this theme so let’s change it up. By clicking the “Suggest Design” a few times, artisteer will randomly create some suggested designs for me and every time it’s something completely different.
After three clicks I got this:
I like the design, but I don’t care for the colors. So I click the suggest colors button a few times and I get:
Those are colors I can live with but I don’t like the background so guess what, I click suggest background:
Now I can go through and get suggestions for every element of my theme and I can also go in and tweak the particular features of the theme as well. Let’s look at the header. I want to change it up. So at the top I click Header and get a new menu bar at the top:
Now I can change the background image, the text location, add a foreground photo, etc, etc, etc.
With a little playing around (and don’t worry if you goof it up just click the undo button at the very top to roll back) this is what I came up with:
Yeah, I know what’ you’re thinking. That’s one scary clown Jess.. But you get the idea, you can tweak every single element of your theme and if you actually have (unlike me) more artistic talent than you did in kindergarten with those broken bits of crayola, it will look pretty nice.
If you haven’t grabbed artisteer yet, definitely do head over and give it a whirl.
Enabling WP Super Cache for WordPress on Windows Hosting
Feb 10th
PHP on Windows Server is gaining great popularity thanks to Windows Hosts that support PHP like us (Applied Innovations), the work Microsoft and Zend are doing together to make PHP even faster on Windows and the large number of PHP developers that realize Apache represents only a piece of the total website/ webserver market out there and want to really expand their market.
A few months ago I had enabled WP-cache on my site but in order to get it running I needed to make numerous tweaks. WP-SuperCache actually offers many more abilities over wp-cache and it supports Windows by default from install (well, almost).
Why install caching on your WordPress blog (or any blog)
WordPress dynamically generates your pages for you by making calls to the MySQL database server. If your site suddenly sees a HUGE increase in traffic or popularity it’s possible that the MySQL database server you’re using won’t be able to handle the traffic load. What would cause this to happen? Well, one could only be so lucky. Typically if your blog is posted on a site like digg.com or slashdot.org or hey maybe CNN.com even. Chances are your shared MySQL database server isn’t going to be able to handle the load and before long you’ll find either the server crashes or the hosting provider shuts down your DB to allow the other sites on the server to remain online. Not good.
Caching applications like wp-supercache, cache these dynamic requests as static content on your site and pull the content from that static cache instead of making each page that’s called get generated dynamically. Static content can be served EXTREMELY FAST in IIS compared to dynamic content and puts almost no load on the webserver. So by serving static content and limiting the calls to the database server you’re improving the site speed, lowering the load on the server and increasing the number of simultaneous site visitors your blog can handle.
Warning to the faint of heart.
NOTE: Before we go any further it’s important to understand that when we first install this plug-in it’s going to break our blog. We’re going to need to edit one line on one file to fix this. If for some reason after you install this plug-in if you need to manually uninstall it and aren’t able to access the admin interface here’s how to do that:
- Delete the entire folder wp-supercache in the folder wp-content/plugins in your blog directory.
- Delete the files advanced-cache.php and wp-cache-config.php in the folder wp-content in your blog directory.
Once you delete these files and folders the plug-in should be disabled. Go into the plugins menu and verify it’s removed and not listed there.
Remember, this has worked for me on 6 different installs of WordPress 2.7 on Windows 2003 and 2008 based servers but the configuration at Applied Innovations may be different than your host’s configuration.
You make these changes at your own risk and are solely responsible for anything you break.
How to install WP-SuperCache
Within the WordPress Dashboard you’ll select the Plugins option on the left
This will bring up the Manage Plugins page and expand the plugins options in the menu. From here we’ll select ‘Add new’
This will bring up the Install Plugins page with a search box at the top. For term we’ll type “super cache” and click the search button:
The search will run and list several plugins. We’ll select “WP Super Cache’” which as of this writing was at version 0.9 and we’ll click the install link.
This will bring up a pop up and we’ll click the install button to automatically install this plug-in.
Once the plug-in is installed we’re going to activate it but before we do that I need to warn you, that we may start getting errors on our blog. The reason we activate it and enable these errors is that activating the plug-in creates a file we need to edit in order to remove these errors. Without first activating (and/or enabling the plug-in) these files won’t be created and we’re not able to edit them to proceed.
So go ahead and activate it now but understand we’re going to get errors.
Activating the plug-in & editing it for Windows
When we activated this plug-in we probably got an error like this:
Warning: include(D:\Domains\domain.net\wwwroot/wp-contentD:/Domains/domainnet/wwwroot/wp-content/plugins/wp-super-cache/wp-cache-base.php) [function.include]: failed to open stream: Invalid argument in D:\Domains\domain.net\wwwroot\wp-content\plugins\wp-super-cache\wp-cache.php on line 49
Warning: include() [function.include]: Failed opening ‘D:\Domains\domain.net\wwwroot/wp-contentD:/Domains/domain.net/wwwroot/wp-content/plugins/wp-super-cache/wp-cache-base.php’ for inclusion (include_path=’.;C:\php5\pear’) in D:\Domains\domain.net\wwwroot\wp-content\plugins\wp-super-cache\wp-cache.php on line 49
As you recall I said that I had found this plug-in works “almost” out of the box on Windows. I believe each host has a different PHP configuration and at Applied Innovations you have to make a slight tweak to allow this app to work.
NOTE: If for some reason these files don’t exist for you yet. skip ahead and turn on the caching and then open the site again in your FTP client to edit the files. Remember if you need to completely disable this plug-in just delete the folder wp-supercache in wp-content/plugins. If you delete these files and it still doesn’t load you may need to delete the files advanced-cache.php and wp-cache-config.php in the wp-content folder as well.
Open your FTP client and download the file in wwwroot/(yourblogfolder)/wp-content/wp-cache-config.php
and edit the line like this (it should be line #7):
define( ‘WPCACHEHOME’, WP_CONTENT_DIR . "D:/Domains/YOURDOMAIN/wwwroot/wp-content/plugins/wp-super-cache/" ); //Added by WP-Cache Manager
to this:
define( ‘WPCACHEHOME’, "D:/Domains/YOURDOMAIN/wwwroot/wp-content/plugins/wp-super-cache/" ); //Added by WP-Cache Manager
Basically remove the “WP_CACHE_DIR .” portion and reupload the file.
So once we clean this up the paths we should get no more errors displayed.
Enabling WP Super Cache now that we’ve edited it.
From here click on settings and then WP Super Cache to bring up the Super Cache settings menu
Now we’re going to turn on the cache feature:
and click the update status button. WP Super Cache should now be enabled and you should now be caching your dynamic pages as static pages.
Verify caching is enabled.
Now we need to make sure our site loads and is caching. Go to your site in a browser and make sure the page comes up. Hit refresh after it first comes up and it should load faster. Do this on a few different pages and then click “view source” in your browser on one of your pages and scroll to the bottom you should see a couple lines like this at the very bottom:
<!– Dynamic Page Served (once) in 0.429 seconds –>
<!– Cached page generated by WP-Super-Cache on 2009-02-10 12:45:34 –>
You can go back into the WP Super Cache Settings and you’ll see stats on your cached content:
We’re all cached up!
So there you have it. We’ve enabled caching on your site. This article is a work in progress and may be updated or followed up from time to time. Any questions or problems though feel free to comment.
Creating your own Zooming Photo Mosaic
Jan 7th
I was really impressed with the deep zoom version of the Newseum newspaper frontpages from the Obama Election win in my previous blog post. I was so impressed that I had to figure out a way to do this myself. This post will guide you through this process, step by step.
Step 1, creating your Photo Mosaic
Recently Carlos mentioned he wanted to get a Photo Mosaic made by his Photographer from his wedding photos. I figured in this day and age of Information sharing there had to be low cost applications out there that would automate this process for you. (If you haven’t learned yet, everything is on the Internet)
After a quick web search, I found AndreaMosaic, a FREE application for this very purpose. (REALLY AMAZING APPLICATION)
With AndreaMosaic you take a picture you want to be the base of the mosaic:
Select a bunch of pictures you want to use to create your Mosaic (the more pictures the better):
And click a couple buttons and Presto! Photo Mosaic for free:
But you run into a problem. If you zoom into the picture moderately, you get okay photo resolution:
If you try to zoom in a lot though, you start to lose detail:
So what to do?
Step 2, Enter Silverlight Deep Zoom
From my earlier blog posts you know Microsoft’s Silverlight Deep Zoom allows you to take a bunch of high resolution images and stream them as you zoom in providing more detail on just the area you’re viewing.
The good news is that AndreaMosaic will generate a Deep Zoom application for you automatically, the bad news is to do anything with that you’re going to want to import it into a tool like Deep Zoom Composer and and start working with it. I ran into a problem here because my home PC only has 4GB of memory and quickly depleted that and Deep Zoom Composer would crash (let’s chalk it up to beta software). To get around this, I had Andrea Mosaic split my image up into 4 separate images:
I created a new Silverlight project in Deep Zoom Composer (DZC), added my 4 images to the project:
Then I zoomed in to arrange them on the palette in DZC so that they lined up I set the export options in DZC:
and had it create my new Deep Zoom project in an HTML / Silverlight project that was web ready for me. I could now go from:
To this:
All the way to this:
With plenty of detail that I could really enjoy. Best of all, the newly generated project has all the controls for zoom in, zoom out, center and even FULL SCREEN, all created automatically for you!
Step 3, uploading your new project.
Now that you’ve got your project created and tested out the next step is to upload. Now in the “New Microsoft” they’re all about hosting the content and applications for you so you can either host your new project on their site, or be uber-cool and host it on your own website like me:
http://www.jesscoburn.com/coburnchristmas08/
There’s a little massaging to do though to get it to display out of the gate. So here’s what I did:
- In your exported project you’ll find a folder DeepZoomProjectWeb. Let’s assume you’re going to upload your project to a new folder on your site called deepzoom. Within the DeepZoomProjectWeb folder copy the web.config file to your deepzoom folder on your website.
- In the DeepZoomProjectWeb/ClientBin Folder copy all of those files and folders (GeneratedImages, DeepZoomProject.xap, DeepZoomProjectTest.html, Silverlight.js) into your deepzoom folder on your website.
- Finally, rename your DeepZoomProjectTest.html file to default.htm (or index.html) and open your site, domain.com/deepzoom/ and the page should load fine.
That’s all there is to it. Really, just 3 simple steps and you’ll have your own Dynamic Zooming Photo Mosaic, thanks to a couple freeware apps, a little munging of data and a bit of creativity.
Here’s the cool thing. My original 4 files for my mosaic were about 25MB total. The zooming project is about 100MB but you don’t really download that full 100MB only the parts that you’re looking at and zooming into.