SharePoint 2010 - Reverse Proxy

by Aaron 18. January 2012 00:23

We have two web servers.  One server accepts traffic from the WAN on port 80.  The other accepts traffic from the WAN on port 443.  Our SharePoint 2010 instance lives on the former, but we only want public traffic coming to the SharePoint server over SSL.  Which, as you probably know, is port 443 by default.

What to do, what to do?

We had several options including opening up another port and allowing SSL traffic over a different port to the port 80 server.  I didn't like that idea.  In the past, for various things, I've used the IIS URL Rewrite module for various things, so I decided to see if I could put some rules in place with that.

What I found is that URL Rewrite has a template for doing a reverse proxy.  Brilliant!  Fortunately for me, it's a common enough scenario that Microsoft decided to add a rules template to version 2 of the Rewrite Module.

If you haven't done so already, and I recommend doing it regardless of whether or not you're doing a reverse proxy, download and install the URL Rewrite module.  If you already have the IIS Manager open, you'll need to close it and reopen it for the extension to show up.

image

Select your site in the Sites under your server on the left.  Open the URL Rewrite extension, and click Add Rule from the Actions bar on the right-hand side.  You'll be presented with a dialog.  Choose Reverse Proxy from the Inbound and Outbound Rules category.

image

You are likely to be presented with a dialog saying that you need Application Request Routing installed to do the reverse proxy.  Not a problem, just follow the instructions and install it.

image

This one doesn't have a standalone installer.  At least not one that I could find.  You'll need to install it using the Microsoft Web Platform Installer.  I didn't care for that because I wanted to keep the number of components on the server to a minimum, but I didn't have much choice.

After installing it, closing IIS Manager, and opening it again, I repeated the previous steps and this time, I was presented with a dialog related to ARR, but asking if I wanted to enable it.  Of course I clicked OK.

image

Finally, I was presented with a simple data entry screen to configure some server and routing  information.  I filled it out similar to this:

image

If you're doing what I'm doing and taking an HTTPS connection and forwarding it to an internal URL over HTTP, then make sure that the Enable SLL Offloading checkbox is checked.  Also, if SharePoint is configured properly, as I'll explain below, you won't need an Outbound Rule for rewriting URLs in the response.

Now SharePoint needs to be configured properly.  The internal domain that you use needs to be configured as an internet address in the Alternate Access Mappings, and the public URL needs to be the primary internet URL for the site.  Let me show you what I'm talking about.

In Central Administration, go to Application Management and select Configure alternate access mappings.  On the top right, there's a drop down named Alternate Access Mapping Collection.  Choose the SharePoint site that you're putting the reverse proxy in front of.

Whatever you used as the server name in the Inbound Rules for the reverse proxy, this needs to be an internal URL for the internet zone.  If it's not already, click on Add Internal URLs and add it.

image

If the URL that you're using is one of your public URLs for the SharePoint site, like mine was the public URL for the intranet zone, you'll need to either choose a different internal URL for your inbound rule, or you'll need to change the public URL.  I changed the public URL.

The internet URL is what your HTTPS web server is using.  So if the URL that you're using on the receiving web server is https://sharepoint.domain.com, then the internet zone in the public rules for your SharePoint site should be https://sharepoint.domain.com.

I believe that's it!  Because of the alternate access mapping, SharePoint 2010 will do the work for you of updating all of the URLs in the responses to use the internet URL for any requests coming in on http://sharepoint.internaldomain.internal alleviating you of the need to have an outbound rule to rewrite responses.

Tags: , , , , ,

SharePoint 2010 - Can't Delete Search Service Application

by Aaron 17. January 2012 04:47

Yesterday, I discussed my issue where my Search Service Application wasn't working.  It wasn't crawling, couldn't connect to some back end, and searching was returning an error.  After I created the new Search Service Application, I had to delete the old one.

Sounds simple, right?  Sure, if you understand that you might not be able to delete it from the SharePoint Central Administration.

Here's the problem: the Search Service Application is selected.  Delete is clicked.  You get a fancy-looking popup with a swirling logo asking you to please wait.  And you do!  FOREVER!

image

That spinning logo never goes away regardless of how long you wait.  You close out and go back into the Manage Service Applications page to see that it's still there.

The solution is to use stsadm.exe.  I found this solution.  Following the solution on that page, I executed:

stsadm.exe -o deleteconfigurationobject -id "<insert Application Service GUID here>"

It didn't complete instantaneously, but it did complete.  When I went back into Central Administration, the extra Search Service Application was gone!

Tags: , , , ,

SharePoint 2010 - The search service is not able to connect to the machine that hosts the administration component

by Aaron 16. January 2012 05:05

A couple of months ago, I set up a SharePoint 2010 instance.  I had some issues, but the site was up and working for the most part.

One of the issues was the Search Application Service.  For some reason, the service wouldn't crawl the site, and it was giving me an error in Central Administration in the System Status.  The message said, "The search service is not able to connect to the machine that hosts the administration component.  Verify that the administration component '<guid goes here>' in search application 'Search Service Application' is in a good state and try again.

Also, when running a search from within a SharePoint site, I would get the error message, "The search request was unable to connect to the Search Service."  Of course it can't.  The search service isn't working, right?

I read several things that told me to change the app pool to a different one [link], make sure the indexing service is running [link], and to make sure that the search application is associated with the proxy group (same thread in the previous link).  This latter solution is what helped me out.  Not only did the contributor mention the association, but he also said that he deleted the old service and created a new one.

The first thing I tried was following his instructions of checking the "Service Application Associations."  This is under Central Administration > Application Management > Service Applications > Configure service application associations.

image

After clicking on the "Configure" link, you're presented with a page that has your web applications and an Application Proxy Group associated with the web applications.  Mine was named "Default" and was associated with the user site and the main site.

image

So, clicking on Default, I get a dialog showing me all of the application services associated with the Application Proxy Group.

image

I noticed that there was no Search Service in the list at all!  Looking at the "Type" I did see that everything was a whatever-service "Proxy".  My search service wasn't there, and after looking in the service applications, I didn't have a Search Service Application Proxy on the Search Service Application.  Either it was never there, or I accidentally deleted it.

image

I created a new Search Service Application.  After creating it, I verified the proxy was there:

image

Then I verified that the search service was associated with my web application:

image

After that, all the bells and whistles came on for the crawl status:

image

Finally, I now get results in my searches through the SharePoint site.

Tags: , , , ,

Nook Feedback - Reading Textbooks

by Aaron 22. December 2011 07:24

I may have mentioned once or twice, I really like my Nook. I bought a Samsung Galaxy Tab 10.1 not long ago. I installed the Nook app on there and use it as another reader on occasion. It's a fantastic compliment to the Nook. I'll get into that later.

Because I like the Nook so much for reading, I decided to take it a step further. I bought a technical book (textbook) to read on it. The book was "The Art of Unit Testing" by Roy Osherove. I reviewed it in my last post. My opinion of reading textbooks on the Nook wasn't as positive as my review of Mr. Osherove's book. Which, if you read my review, you're probably making a face right now. The kind of face like you just watched a video of some guy getting kicked in the nuts. That face!

Here are what I feel the pros and cons are for reading tech books on the Nook.

Pros

First of all, think of the biggest, thickest, heaviest tech book (or any kind of book for that matter) that you've read or own. If you have it handy, pick it up. try reading a page from it. If you don't have it handy, visualize it in your mind. Feel or picture the strain on your wrists. Maybe the book is so unwieldy that you have to set it down and read it on a table or desk.

Now picture reading that same book, except it's height and width are similar to a paperback. It's about 1/4" thick, and it's held easily in one hand. That's the major pro! On the Nook, a book that's wide, thick, 500 pounds, or some other undesirable attribute, is now easy to hold and read! Aching wrists and losing your place are things of the past!

Another pro, if the book is part of your Barnes & Noble library (read: you bought it from Barnes & Noble), you can read the same book on multiple devices: phone, tablet, laptop, Nook, whatever device there's an app for it. If you bought your eBook from, say, Manning for example, you don't have that page sync feature. I want to find something for that, but its not a priority yet.

Searching for keywords is another pro. It's not something that you can do easily on device though. I just tested it out on my tablet using the Android Nook app, and I got a nice listing of what chapter and page the keyword was on, and a snippet of the line that contains it. Very nice since if I'm searching for a keyword, I'm probably not going to do it from my Nook itself. I'm more likely to look for specific things while on my tablet or PC.

If you've got an eReader, or have read about them, then you're probably familiar with the other pros of using them. I'm not going to elaborate anymore on them here.

Cons

There are a couple of things that I don't really care for with reading textbooks on the Nook. After looking into it, I think they're probably just obstacles for a device like the Nook and probably the Kindle.

The first thing was the font. The font for the majority of the text is fine, but the code samples in the book I read were in a fixed width font that was really thin. It was like a really thin Courier New. It was difficult to read. I tried changing fonts without much, if any, improvement. It's not as bad in the Nook app on my tablet.

The other issue was with the code samples themselves. Most of them were fine, but there were a couple of samples that were so long they ran off the bottom of the screen. That would be fine if the sample continued on the next page, which happened with most of the samples. But a couple of them ran off the page and I'm assuming into oblivion. I'll never know how those code samples ended. I wish that I had kept track of them because I wanted to compare with the PC and Android versions to see if it was simply a device issue. I skimmed through the samples on my tablet and on the desktop to see if I could find the same kind of issue on the apps, but they appeared to be fine. I also compared the look to how the Kindle app rendered the mobi version, and while there were some differences, it rendered fine there too. So I think that it's a shortcoming of the device.

Another con is that you can't put your books on display. How are people going to know that you're smart if you can't put all of your tech books on display for them to see? Nobody's going to be able to "oh" and "ah" over your big brain made smrter by reading yor big books.

Summary

Initially I really had hoped for better. After finishing "The Art of Unit Testing", I vowed that I wasn't going to buy another tech book in eBook format! I swore that I was going to tell the world about how horrible it is to read a tech book on an eReader!

I bought two more eBooks from Manning a few days ago...

Since the initial read, I've played with the Nook apps for PC and Android. Now, I think the freely available Nook apps help overcome the pain I felt when reading on the Nook itself. And the reality is that I'm moving more toward the convenience and awesomeness of the Nook and the free Nook apps. I'm finding it harder and harder to justify having a physical book when I can carry so many books around in such a convenient package and be able to search through them easily like I would a white paper or the internet.

I'm going to continue to grow my eBook collection and eventually stop buying printed books. Though for tech books, I might use my tablet more for reading instead of the Nook itself. Unfortunately, I won't be able to show off my growing book collection, but my officemate has died or moved away (spiders hate cold weather?) and wouldn't appreciate what he was seeing anyway.

Tags: , , , , ,

Book Review: The Art of Unit Testing by Roy Osherove

by Aaron 13. September 2011 22:19

Let me start off by saying, I didn't seek this book out.  It was recommended by a friend after I read "Working Effectively with Legacy Code" by Michael Feathers (see my review here).  With that, here's the bad, the good, and the summary (in that order!).

The Bad

First, the bad.  The book (official site) itself wasn't bad.  Unfortunately, I didn't learn much from the book.  I had followed up Michael Feathers book with this one, and maybe that was the issue.  Michael Feathers book was densely packed with tons of information.  "The Art of Unit Testing" felt pretty light in comparison.

There was nothing really ground breaking about the book.  A good amount of the information presented is information that can be easily found around the web, in samples from the unit testing tools available, and in other books that maybe aren't even about unit testing (link). It made more than a couple of references back to Michael Feathers book encouraging the reader to maybe go look at that book.

The Good

It was written well and easily understood. I feel like it's organized well.  It also goes into detail about techniques you can use to try to integrate unit testing into your organization.  The author himself has been through the scenario multiple times and is able to relate his experiences.

The first thing that was new to me was how to hide some of the constructors from the public interface, but make them visible for testing.  Declare them as internal and add the InternalsVisibleTo attribute in the AssemblyInfo file.  That helped settle a disagreement I was having with one of my former coworkers.  He felt reflection should be used to set fields and properties instead of using dependency injection techniques like overloaded constructors.  Declaring the constructors as internal gave him more of a warm, fuzzy feeling than having them public, and it let me do what I felt was best.  So thanks for settling that Roy!

The author was working for Typemock while writing the book.  He even gave that disclosure multiple times throughout the book in an attempt to dissuade the user from feeling like he was secretly trying to sell the reader on Typemock products like Isolator.  He did give lots of examples using Typemock Isolator, but they were to demonstrate what's possible with various tools.  Typemock Isolator definitely has a lot of power and features, as it should since it's a commercial product.

While a lot of examples were around Typemock Isolator, many (and probably more) examples were given using Moq and Rhino Mocks.

The other place that I found useful information was in the appendices.  The appendices went through and described various tools that can fill various needs in testing (unit, integration, and even acceptance).  The listings and descriptions were really good.  It pointed out some tools that I didn't know about and plan on investigating.  For now though, I'm pretty happy with xUnit.net, MS Test, and Moq.

Summary

Overall the content in the book really felt too too basic for me.  Maybe that's my fault for following up the Michael Feathers book with this one.  Maybe I expected the same level of detail and amount of content that was in my previous read.  Maybe I'm just wicked smart!  Who knows?

I wouldn't recommend this book to anybody except people that are looking to get started with unit testing and haven't read Michael Feathers book yet.  I feel like this might be a better book to start with and followed up with Michael Feathers book "Working Effectively with Legacy Code".  Reading in that order may lead to better enlightenment.

While it was pretty basic, I did get some useful information out of it.  Now though, it'll probably just collect cyber dust sitting on my cyber bookshelf (I got the eBook version if you're wondering what the hell I'm talking about).

Tags: , , , ,