Wednesday, April 25, 2012

Twitter Bootstrap, Less and PHP Setup on IIS 7.5 and Windows 7

It’s certainly not news to me that setting up any technology on Windows that’s typically associated with the LAMP stack can be a bit tricky. Today, I found myself wanting to run a Twitter Bootstrap site that was built in PHP. I use Windows 7 and IIS 7.5 on my laptop, so I had to get through a few minor setup considerations. Here are some of them—hopefully, this will help others get going quickly.

Essentially, you need to download PHP (http://windows.php.net/download or http://php.iis.net/), configure it to work with IIS. Download Twitter bootstrap, configure it to work with IIS… etc. etc. etc. Here are some quick tips for getting going. The PHP.net article on Enabling FastCGI support in IIS was helpful. There are some steps that are optional, so you might want to first check whether the handler mapping is already in IIS, but for the most part, it’s a useful page to follow. For example, installing the CGI component for IIS is required. Without that feature, you won’t be able to run any PHP code in IIS.

If you want to use the short form of the PHP server-side tag (“<? … ?>” instead of “<?php … ?>” ), you’ll need to turn the option on in your php.ini configuration file. Since this file is typically being used, you can’t just open it and save change. The easiest way to edit it is to search for the php.ini file, copy it to some other location, then open the file and search for the “short_open_tag =” line. Change it to On to use the short form and then copy the PHP.ini file back to it’s original location and restart IIS.

; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It's been
; recommended for several years that you not use the short tag "short cut" and
; instead to use the full <?php and ?> tag combination. With the wide spread use
; of XML and use of these tags by other languages, the server can become easily
; confused and end up parsing the wrong code in the wrong context. But because
; this short cut has been a feature for such a long time, it's currently still
; supported for backwards compatibility, but we recommend you don't use them.
; Default Value: On
; Development Value: Off
; Production Value: Off
;
http://php.net/short-open-tag
short_open_tag = On

To test whether PHP is working, you can run <?php phpinfo() ?> or <? phpinfo() ?> in a .php file under wwwroot. Call it whatever you want .php. Then open the page (e.g., http://localhost/phpinfo.php) and see what’s displayed. If everything is working, you’ll see a page that shows verbose information about your environment (see screen below). If you try to run the command with the short form notation, and you haven’t enabled that option, the page will be completely blank.

image
- PHPINFO() shown in Internet Explorer

If you have any issues getting Less or Bootstrap files to load, open up your site in Chrome or IE and use the developer tools to inspect what’s going on with the scripts.

image
- Chrome developer tools showing Resources (scripts)

For example, I had to add an IIS mime type for “.less” files to get Less to work on my machine (IIS 7.5). Without setting the mime type, I was getting a 404.3 error for the file bootstrap.less. This isn’t difficult to do, just open Internet Information Services (IIS) Manager and find the “Mime Types” feature under “HTTP Features.” Make sure you’ve selected the website in the left panel before you look for this option on the right side. I just add a new mime type for .less files and set it to “text/plain” and everything worked.

image

Tuesday, March 27, 2012

ASP.NET MVC 3: A default document is not configured

I ran into a strange issue and so many different solutions have been posted online that I thought I’d add what worked for my scenario. I have an ASP.NET MVC 3 “Razor” web application which I ran successfully on W2K8 R2 and when I tried to open it on Windows 7  (IIS 7.5), it wouldn’t run. The error message was “HTTP Error 403.14 – Forbidden. A default document is not configured for the requested URL.” I know that I don’t need to set a default document, so what is wrong?

image

There are an awful lot of posts about this error, but the key here is that this solution worked fine on one machine and wouldn’t run on another. I found the solution that worked for me on StackOverflow.com. It was the suggestion from Dommer that helped with my issue. (Note that there is a 32bit version of the same fix.)

“did you try running the aspnet_regiis -i command in the Visual Studio 64 bit command prompt (with admin privileges)? When I did that it fixed it for the 64-bit mode. To clarify, I right clicked on Visual Studio x64 Win64 Command Prompt (2010) and chose Run as Administrator. Then I went here: C:\Windows\Microsoft.NET\Framework64\v4.0.30319
And did this: aspnet_regiis –i And now it works perfectly.”

image

Yes, yes it does. Thanks!

Tuesday, March 06, 2012

BPOS Upgraded to Office 365–Why Does it Look the Same?

Obviously, there’s a lot more to Office 365 than SharePoint Online. The Microsoft Online Services offering also includes Exchange Online for email, Lync Online for communication, the Office Web Apps, and some plans even include a copy of Office Professional Plus. But I’ll let others blog about the various pieces—this post is about SharePoint Online.

If you have a Business Productivity Online Suite (BPOS) account, you’ll know that BPOS comes with Microsoft Office SharePoint Server 2007 (MOSS) and Office 365 comes with SharePoint Server 2010. Since I work for a Microsoft Partner, Metalogix Software, my GovernanceHx project is part of the BizSpark program, and I’m a Microsoft MVP, I have a few different SharePoint Online accounts—including both BPOS and Office 365. One of these accounts was recently upgraded from BPOS to Office 365, so I’ve experienced the SharePoint upgrade firsthand.

BPOS Site Upgraded Office 365 geeklit.com stephen cawood
- A BPOS SharePoint site upgraded to Office 365

The funny thing about the SharePoint Online portion of the upgrade is that it’s really hard to tell that anything has happened. Sure, you get an email that advises you that your site is ready for upgrade, but when you actually visit your SharePoint Online site, it looks exactly the same. Well, we all know that looks can be deceiving.

If, however, you enter using the Team Site link from the Office 365 customer portal, you’ll be taken to a spanky new SharePoint Server 2010 site. This is actually a new page; the BPOS content retains the same URL after the upgrade and a link will be added to your new home page.

Office365SharePointOnline_Edit
- The SharePoint “Team Site” home page after BPOS (MOSS 2007) is upgraded to Office 365 (SharePoint 2010)

So why does the BPOS SharePoint Online content still look like MOSS? It’s actually a feature of SharePoint Server 2010. Specifically, the “Visual Upgrade” feature. Visual Upgrade allows MOSS sites to be upgraded to 2010 without changing the look and feel. This is meant to ease the transition to the new version of SharePoint. A site admin can go to the site settings and choose to upgrade to the SharePoint 2010 look and feel. When a BPOS site is upgraded to Office 365, the SharePoint Online content is put in a site collection under the Office 365 account.

To see the site collections, go to the Microsoft Online Services (Office 365) Administration portal and scroll down to SharePoint Online. Once there, click the “Manage” link. This opens the SharePoint Online Administration Center. Next, click on “Site Collections” to see the Office 365 site collections that were provisioned for you during the upgrade.

Office 365 Admin geeklit.com stephen cawood
- The Office 365 administration interface

Here you’ll see that there’s a new site collection under your Office 365 domain name (yes, the Office 365 URLs are much nicer than the old BPOS mouthful), and that there’s one for your MySites (a feature that wasn’t available in BPOS), as well as one for your old BPOS content. If you don’t want to use the new SharePoint 2010 interface, that’s your choice, but personally, I’d go for it.

Office 365 SharePoint Online geeklit.com stephen cawood
- The new SharePoint Online Administration Center interface

I only wanted one site collection, so I used Metalogix Migration Manager for SharePoint, to migrate the old BPOS content to the main Office 365 site collection.

Having my site (and my MySite) on SharePoint 2010 means I can take advantage of great features that are only available in SharePoint 2010. For example, Enterprise Metadata Management (a.k.a. SharePoint taxonomy), the new SharePoint UI with the fluent ribbon and a tighter integration with Microsoft Office.

Thursday, February 23, 2012

Microsoft MVP Summit 2012 is Coming

Microsoft MVP Banner geeklit.com

Next week is the Microsoft Most Valuable Professional (MVP) Summit. I enjoyed last year’s summit very much, so I’m looking forward to this year’s event. You can read about the summit on the MVP Award Program Blog:

“This year, more than 1,500 MVPs will travel from 70 countries to meet with members of the Microsoft community. They share their valuable real-world feedback with our product teams to help drive improvements and innovation in Microsoft technologies, and they learn about what’s new and what’s coming in our products.”

The summit takes place in Redmond and Bellevue and it the best chance to spend time with other MVP award recipients. The tracks are divided by topic, so I’ll mainly be seeing the SharePoint and Office 365 MVPs.

The sessions are presented by SharePoint team members, so it’s a great chance to pick the brains of the product team members. Not to mention there are still a few people who I worked with during my time on the MCMS and SharePoint teams, so it will be great to see some old friends as well.

Stephen Cawood Microsoft MVP Summit 2011 Safeco Field geeklit.com
- last year’s attendee party was at Safeco Field

Wednesday, January 18, 2012

The Web Goes Dark Thanks to SOPA

SOPA Wikipedia geeklit.com

Wikipedia and O’Reilly Media are just two of the websites that went dark today in protest of the proposed Stop Online Piracy Act (SOPA) legislation in the United States. The US already has anti-piracy legislation and this new bill goes too far. As an author, I understand how terrible it feels to have your work stolen. My first Halo book was actually hand scanned then posted online and many of my other books have also been pirated in one way or another. I also have an interesting perspective on this issue because I was also wrongly accused of violating a legal agreement by writing one of my books—something I put to rest when I hired a lawyer and then went on to write two more books on the subject (one for O’Reilly Media BTW). The publisher in that case handled the issue extremely poorly and it’s precisely the sort of thing that would enable SOPA to shut down an innocent website. Copyright infringement is awful, but this bill simply isn’t the right way to deal with the issue.

What’s in this bill? Here’s some text from the summary: “This bill would establish a system for taking down websites that the Justice Department determines to be dedicated to copyright infringment [sic]. The DoJ or the copyright owner would be able to commence a legal action against any site they deem to have "only limited purpose or use other than infringement," and the DoJ would be allowed to demand that search engines, social networking sites and domain name services block access to the targeted site.”

From the Washington Post: “Why are tech start-ups so vehemently opposed? These companies have argued that the bills are tantamount to Internet censorship. Rather than receiving a notification for copyright violations, sites now face immediate action — up to and including being taken down before they have a chance to respond”

If you would like a quick visual explanation of this issue, visit americancensorship.org.

SOPA Oreilly geeklit.com

From today’s O’Reilly message…

Today, we’re going dark to show the world that O’Reilly Media does not support the Stop Online Piracy Act (SOPA) in the U.S. House of Representatives or the PROTECT IP Act (PIPA) in the U.S. Senate.

These legislative attacks are not motivated by clear thinking about the future of the Internet or the global economy, but instead seek to protect entrenched companies with outdated business models. Rather than adapting and competing with new and better services, these organizations are asking Congress for cover.

Any forward-looking country must encourage its emerging industries, not protect its laggards. Yet, in a time when the American economy needs to catalyze domestic innovation to succeed in a hyper-competitive global marketplace, members of the United States Congress have advanced legislation that could damage the industries of the future.

Here’s what you can do:

1) Learn if your U.S. Representative or Senators support SOPA or PROTECT IP through SOPAOpera.org.

2) Use the tools at AmericanCensorship.org, StopTheWall.us and POPVOX to tell Congress where you stand.

3) Participate in Better Activism Day, a free livestream of experts discussing ways to "improve your power in Washington from people who’ve been successful at moving it."

4) Call or meet with your representatives in Congress. The single most effective action any concerned citizen who wants to talk to Congress can take is to see your Senator or Representative in person. Failing that, call them. Write them a letter. Make sure your voice is heard.

– Tim O’Reilly, CEO and Founder of O’Reilly Media


Wednesday, December 07, 2011

SharePoint Saturday Honolulu 2011

This year marked the first SharePoint Saturday Honolulu event. And to distinguish themselves, they held the event on a Friday. I greatly enjoyed this event and it was well organized, so hats off to the organizing committee and the volunteers. It also didn’t hurt that I got to spend the week in Oahu, Hawaii.

Stephen Cawood SharePoint Saturday Honolulu SPSHNL
- Yes, it was on a Friday

At the event, I presented a session about the SharePoint 2010 SP1 supportability changes and how these changes affect real-world storage considerations. Naturally, since Remote BLOB Storage (BLOB offloading) is the future of SharePoint storage management, I spent a good deal of my time talking about RBS.

Ask the Experts Stephen Cawood SharePoint Saturday Honolulu SPSHNL

I also enjoyed being on the Ask the Experts panel, which featured some prominent SharePoint community characters and some great conversation.

Stephen Cawood SharePoint Saturday Honolulu SPSHNL
- Yes, that’s a dinosaur foot behind me. Honolulu Community College has dinosaurs

Thank you to the organizers and thanks for the invite to return next year. BTW –the real flower leis upon arrival were a nice touch.

Ask the Experts Stephen Cawood speaker SharePoint Saturday Honolulu SPSHNL

Friday, November 25, 2011

Movember Coming to an End

Well, it’s the final week of Movember and I’m only $23 out of 2nd place on my Metalogix team. If you can space a few bucks for a good cause (men's health), please visit my page and make a donation.

clip_image002

You can contribute to my Movember effort here: http://mobro.co/cawood

“During November each year, Movember is responsible for the sprouting of moustaches on thousands of men’s faces, in Canada and around the world. With their “Mo’s”, these men raise vital funds and awareness for men's health, specifically prostate cancer.”

IMG_0094

At the end of the month, I’ll be posting the “after” photo showing my Tom Selleck-esque look.