Forum Discussion
fillstrsoh_2962
Nimbostratus
Oct 26, 2011SharePoint 2010 - virtual with two pools
We are trying to implement SharePoint 2010 using one virtual server with two pools using a pool for each site. dv-strsohioportal is the virtual server which has an irule that sends traffic to a specific pool based on the URI being either dv-strsohioportal/sites/inv or dv-strsohioportal/sites/its. The irule works but it appears that the AAM is not configured correctly because SharePoint returns a 404 error once it translates the URI to dv-strsohioportal/sites/inv/default.aspx or dv-strsohioportal/sites/its/default.aspx.
irule:
when HTTP_REQUEST {
log local0. "URI - [HTTP::uri]"
if { [HTTP::host] contains "dv-strsohioportal" } {
log local0. "URI - [HTTP::uri]"
switch -regexp [string tolower [HTTP::uri]] {
"/sites/its.*" {
log local0. "This time pool - ITS"
pool dv-strsohioportal_its_pool }
"/sites/inv.*" {
log local0. "This time pool - INV"
pool dv-strsohioportal_inv_pool }
}
}
}
If they add dv-strsohioportal to the AAM configuration it redirects to 10.100.x.x/sites/inv/default.aspx or 10.100.x.x/sites/its/default.aspx. Should we abandon using AAM and try to use the IIS rewrite rules instead?
Thanks,
Mark
12 Replies
- Michael_Yates
Nimbostratus
Hi fillstrsoh,
I don't think that your iRule is working properly the way that you have it configured. In a switch statement the comparison is absolute and I don't think you are going to get a qualifying match because of the trailing "." periods that you have:
"/sites/its.*"
"/sites/its.*"
Try this and see if it works properly:when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/sites/its*" { log local0. "This time pool - ITS" pool dv-strsohioportal_its_pool } "/sites/inv*" { log local0. "This time pool - INV" pool dv-strsohioportal_inv_pool } } } - I think the original iRule is O.K. as the -glob and -regexp, as shown above, do exactly the same.
If sounds like a problem with the AAM config of sharepoint. It should not redirect to the internal IP addresses (as mentioned above).
@fillstrsoh:
1.) What is your current AAM config on both sites?
2.) Can you please add some log lines to the iRule. Then try to access sharepoint and post the logs.
log local0. "URI - [HTTP::uri]"
log local0. "URL - [HTTP::method] [HTTP::host][HTTP::uri]"
log local0. "Host: [HTTP::header Host]"
log local0. "Request: [HTTP::request]"
Regards
Kurt Knochner - fillstrsoh_2962
Nimbostratus
Michael and Kurt,
Thanks for responding. I have made some progress since my original post. The SharePoint AAM has been modified so that the inv site maps to . With the irule like this:
when HTTP_REQUEST {
if { [HTTP::host] contains "dv-strsohioportal" } {
log local0. "URI - [HTTP::uri]"
switch -regexp [string tolower [HTTP::uri]] {
"/sites/its.*" {
log local0. "This time pool - ITS" pool dv-strsohioportal_its_pool
}
"/sites/inv.*" {
log local0. "This time pool - INV" pool dv-strsohioportal_inv_pool
}
}
HTTP::uri
log local0. "URL - [HTTP::method] [HTTP::host][HTTP::uri]"
log local0. "Host: [HTTP::header Host]"
log local0. "Request: [HTTP::request]"
}
}
SharePoint performs a redirect because the URI did not contain a page request. If I append a page on the URI rewrite like this:
HTTP::uri http://paris-test[HTTP::uri]/default.aspx
the correct page is returned but the layout is broken. Also having /default.aspx appended to every URI is not good. - in your last iRule:
1.) there are no pool commands
2.) what is " HTTP::uri http://paris-test[HTTP::uri]/" supposed to do? Did you just forget the log statement?
Please try this:when HTTP_REQUEST { if { [HTTP::host] contains "dv-strsohioportal" } { switch -glob [string tolower [HTTP::uri]] { "/sites/its*" { log local0. "This time pool - ITS" pool dv-strsohioportal_its_pool } "/sites/inv*" { log local0. "This time pool - INV" pool dv-strsohioportal_inv_pool } } log local0. "URL - [HTTP::method] [HTTP::host][HTTP::uri]" log local0. "Host: [HTTP::header Host]" log local0. "Request: [HTTP::request]" } }
BTW: Why do you need the if clause at the beginning? Are there several domains terminating at that VS?
Regards
Kurt Knochner - fillstrsoh_2962
Nimbostratus
Kurt,
Sorry about that. The missing pool commands was just a typo. Here is the actual irule.
when HTTP_REQUEST {
if { [HTTP::host] contains "dv-strsohioportal" } {
log local0. "URI - [HTTP::uri]"
switch -regexp [string tolower [HTTP::uri]] {
"/sites/its.*" {
log local0. "This time pool - ITS"
pool dv-strsohioportal_its_pool }
"/sites/inv.*" {
log local0. "This time pool - INV"
pool dv-strsohioportal_inv_pool }
}
HTTP::uri "http://paris-test[HTTP::uri]/default.aspx"
log local0. "URL - [HTTP::method] [HTTP::host][HTTP::uri]"
log local0. "Host: [HTTP::header Host]"
log local0. "Request: [HTTP::request]"
}
}
HTTP::uri http://paris-test[HTTP::uri]/ is needed because SharePoint does not answer correctly unless it sees the AAM defined site in the URL. I tried to rewrite the host header to pass the domain to SharePoint but it did not function consistently. I guess the if statement is not needed because the virtual server will only be answering for dv-strsohioportal. I have logs but had trouble attaching them to the post. - O.K. now I'm a bit cinfused. You are rewrting the external URI dv-strsohioportal.tld to paris-test.tld and you distribute the requests to two different sites (/inv and /its). Is that correct? If so, why is your internal domain (paris-test.tld) different that your external (dv-strsohioportal.tld)? In that case you'll have to rewrite the Host Header as well. Furthermore you should also use a STREAM profile to rewrite any occurances of paris-test in the HTML code to dv-strsohioportal, otherwise some absolute links might not work, as the external client does not know how to access http://paris-test.tld.
TODO:
1.) Rewrite the HOST Header [HTTP::header Host]
2.) Add a STREAM profile to rewrite HTML
3.) Don't add /default.aspx to every page. Change
this: HTTP::uri "http://paris-test[HTTP::uri]/default.aspx"
to this: HTTP::uri "http://paris-test[HTTP::uri]
Hope that works. If it does not, I reccommend to capture the whole traffic between client -> LB -> backend with tcpdump and check where rewriting works and where not.
BTW: paris-test is not a FQDN. Is that just to obfusciate the domain name? If not, how does the LB resolve that name and how does the webserver handle that "domain name"?
Regards
Kurt Knochner - fillstrsoh_2962
Nimbostratus
Kurt,
I added a STREAM profile and modified the irule as you suggested. I also changed it so that it can handle traffic to both SharePoint sites correctly. The SharePoint sites now display and function as expected.when HTTP_REQUEST { if { [HTTP::host] contains "dv-strsohioportal" and [HTTP::uri] contains "inv" } { log local0. "URI - [HTTP::uri]" log local0. "This time pool - INV" pool dv-strsohioportal_inv_pool HTTP::header replace Host paris-test HTTP::uri "http://paris-test[HTTP::uri]" log local0. "URL - [HTTP::method] [HTTP::host][HTTP::uri]" log local0. "Host: [HTTP::header Host]" log local0. "Request: [HTTP::request]" } elseif { [HTTP::host] contains "dv-strsohioportal" and [HTTP::uri] contains "its" } { log local0. "URI - [HTTP::uri]" log local0. "This time pool - ITS" pool dv-strsohioportal_its_pool HTTP::header replace Host dublin-test1 HTTP::uri "http://dublin-test1[HTTP::uri]" log local0. "URL - [HTTP::method] [HTTP::host][HTTP::uri]" log local0. "Host: [HTTP::header Host]" log local0. "Request: [HTTP::request]" } }
The only issue now is that the SharePoint sites are configured with links that only contain the directory path without specifying an actual page. When these links are accessed SharePoint performs a redirect which takes it away from the BigIP.
Thanks,
Mark - Mark,
The SharePoint sites now display and function as expected.
very good.
The only issue now is that the SharePoint sites are configured with links that only contain the directory path without specifying an actual page. When these links are accessed SharePoint performs a redirect which takes it away from the BigIP.
According to your description I assume those are relative links, however they would not cause any trouble. So, how do those links look like. Please post the HTML code "surrounding" those links.
Regards
Kurt Knochner - fillstrsoh_2962
Nimbostratus
Kurt,
My SharePoint admin said that SharePoint only allows the default page link for each directory to be specified to the directory like this:
/sites/inv
/sites/inv/fi
/sites/inv/real
instead of like this:
/sites/inv/"filename"
/sites/inv/fi/"filename"
/sites/inv/real/"filename"
This seems to be the default format. Any link that does not have a specific filename defined gets redirected by SharePoint.
Thanks,
Mark - This seems to be the default format. Any link that does not have a specific filename defined gets redirected by SharePoint.
O.K., but what's the role of the LB in this game? You're not adding anything to the path in the iRule. If a link within sharepoint does not work, I suspect a misconception there.
Again, can you please post some HTML code, where we can see such a non-working link?
Regards
Kurt Knochner
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects