<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MRVirtual &#187; IIS 7.0</title>
	<atom:link href="http://mrvirtual.de/category/iis-70/feed/" rel="self" type="application/rss+xml" />
	<link>http://mrvirtual.de</link>
	<description>Blogging about Microsoft Software</description>
	<lastBuildDate>Fri, 03 Jul 2009 23:40:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>URL Rewrite through ISA Server ends in a loop</title>
		<link>http://mrvirtual.de/2009/07/04/url-rewrite-through-isa-server-ends-in-a-loop/</link>
		<comments>http://mrvirtual.de/2009/07/04/url-rewrite-through-isa-server-ends-in-a-loop/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 23:33:09 +0000</pubDate>
		<dc:creator>MRVirtual</dc:creator>
				<category><![CDATA[IIS 7.0]]></category>
		<category><![CDATA[ISA Server]]></category>
		<category><![CDATA[URL Rewrite]]></category>

		<guid isPermaLink="false">http://mrvirtual.de/?p=20</guid>
		<description><![CDATA[Recently I’ve been having some trouble with the IIS 7 URL Rewrite module in combination with ISA Server 2006 which took me a serious amount of time to figure out the root of the behavior.
The task was pretty simple: I set up a website in IIS 7 with multiple bindings: example.net:80 and www.example.net:80. For SEO [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Recently I’ve been having some trouble with the IIS 7 URL Rewrite module in combination with ISA Server 2006 which took me a serious amount of time to figure out the root of the behavior.</p>
<p style="text-align: left;">The task was pretty simple: I set up a website in IIS 7 with multiple bindings: example.net:80 and www.example.net:80. For SEO reasons the user shall always be redirected to example.net/… regardless of the URL he entered in the first place. This can easily be done with the following URL-Rewrite rule:<br />
<code><br />
&lt;rewrite&gt;<br />
&lt;rules&gt;<br />
&lt;rule name="Enforce Hostname" stopProcessing="true"&gt;<br />
&lt;match url="(.*)" /&gt;<br />
&lt;conditions&gt;<br />
&lt;add input="{HTTP_HOST}" negate="true" pattern="^example\.net$" /&gt;<br />
&lt;/conditions&gt;<br />
&lt;action type="Redirect" url="http://example.net/{R:0}" redirectType="Permanent" /&gt;<br />
&lt;/rule&gt;<br />
&lt;/rules&gt;<br />
&lt;/rewrite&gt;<br />
</code></p>
<p style="text-align: left;">This rule works without problems if the client can access the web server directly. However, if the site is published through ISA server I wasn’t able to get it working. The relevant portion of the publishing rule can be seen below</p>
<p style="text-align: left;">
<div id="attachment_29" class="wp-caption aligncenter" style="width: 414px"><img class="size-full wp-image-29" title="Web Site Publishing Rule Properties" src="http://mrvirtual.de/wp-content/uploads/2009/07/WebPublishing_properties.PNG" alt="Web Site Publishing Rule Properties" width="404" height="484" /><p class="wp-caption-text">Web Site Publishing Rule Properties</p></div>
<p style="text-align: left;">The public names were set to example.net; www.example.net.</p>
<p style="text-align: left;">If an external client tried to browse the website via http://example.net/site.html everything worked fine. However, if the user typed http://www.example.net/site.html he got stuck in a loop redirecting exactly to the site he came from instead of being redirected to http://example.net/site.html.</p>
<p style="text-align: left;">A Netmon trace on the client confirmed this behavior. It received an HTTP response with a response header<br />
StatusCode: 301<br />
Location: http://www.example.net/site.html</p>
<p style="text-align: left;">Furthermore the payload of the response contained a link to http://www.example.net/site.html</p>
<p style="text-align: left;">By disabling link translation in the settings of the web site publishing rule, the contents of the payload represented the URL rewrite rule correctly, but still the relevant part in the response header wasn’t like expected.<br />
To investigate this further, I installed a great free tool called <a title="CollectiveSoftware TrafficLog" href="http://www.collectivesoftware.com/Products/TrafficLog" target="_blank">TrafficLog</a>. Using TrafficLog I could see how the client requested the website (Raw Request Header) and how the ISA server altered the request (Processed Request Header) before sending it to the internal web server:</p>
<p style="text-align: left;"><code><br />
Raw Request Header (1)<br />
GET /site.html HTTP/1.1<br />
Via: 1.1 ISATOP01<br />
If-None-Match: "94802358f0fbc91:0"<br />
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)<br />
Host: www.example.net<br />
If-Modified-Since: Fri, 03 Jul 2009 15:10:04 GMT<br />
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*<br />
Accept-Language: de<br />
UA-CPU: x86<br />
Connection: Keep-Alive</code><br />
<code><br />
Processed Request Header (1)<br />
GET /site.html HTTP/1.1<br />
Via: 1.1 ISATOP01, 1.1 ISAEX<br />
Host: www.example.net<br />
If-None-Match: "94802358f0fbc91:0"<br />
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)<br />
If-Modified-Since: Fri, 03 Jul 2009 15:10:04 GMT<br />
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*<br />
Accept-Language: de<br />
UA-CPU: x86<br />
Connection: Keep-Alive<br />
</code></p>
<p style="text-align: left;">This resulted in the following response from the IIS web server, which is exactly what you expect as a result of the URL rewrite rule above:</p>
<p style="text-align: left;"><code><br />
Raw Response Header (1)<br />
HTTP/1.1 301 Moved Permanently<br />
Content-Type: text/html; charset=UTF-8<br />
Location: <span style="color: #008000;">http://example.net/site.html</span><br />
Server: Microsoft-IIS/7.0<br />
X-Powered-By: ASP.NET<br />
Date: Fri, 03 Jul 2009 19:18:34 GMT<br />
Content-Length: 155<br />
</code><br />
<code><br />
Raw Response Body bytes (1)<br />
&lt;head&gt;&lt;title&gt;Document Moved&lt;/title&gt;&lt;/head&gt;<br />
&lt;body&gt;&lt;h1&gt;Object Moved&lt;/h1&gt;This document may be found &lt;a HREF="<span style="color: #008000;">http://example.net/site.html</span>"&gt;here&lt;/a&gt;&lt;/body&gt;<br />
</code></p>
<p style="text-align: left;">But now the ISA Server does it&#8217;s part of messing up the situation. If link translation is enabled, the client will receive the following answer by ISA:</p>
<p style="text-align: left;"><code><br />
Processed Response Header (1)<br />
HTTP/1.1 301 Moved Permanently<br />
Connection: Keep-Alive<br />
Content-Length: 155<br />
Date: Fri, 03 Jul 2009 19:18:34 GMT<br />
Location: http://<span style="color: #ff0000;">www.</span>example.net/site.html<br />
Content-Type: text/html; charset=UTF-8<br />
Server: Microsoft-IIS/7.0<br />
X-Powered-By: ASP.NET<br />
</code><br />
<code><br />
Processed Response Body bytes (1)<br />
&lt;head&gt;&lt;title&gt;Document Moved&lt;/title&gt;&lt;/head&gt;<br />
&lt;body&gt;&lt;h1&gt;Object Moved&lt;/h1&gt;This document may be found &lt;a HREF="http://<span style="color: #ff0000;">www.</span>example.net/site.html"&gt;here&lt;/a&gt;&lt;/body&gt;<br />
</code></p>
<p style="text-align: left;">As described earlier, after disabling link translation in the properties of the Web Site Publishing Rule, the body of the response was correct, but the response header still contained the &#8216;www&#8217;.</p>
<p style="text-align: left;">Somehow the ISA Server still applied link translation to the response header. My next step was to completely disable the link translation Web-Filter. To do so, navigate to Configuration -&gt; Add-Ins in the ISA Management Console, choose Web Filters and disable the Link Translation Filter. At this point the web site could be access for the first time like expected. The Processed Header now looked like</p>
<p style="text-align: left;"><code><br />
Processed Response Header (1)<br />
HTTP/1.1 301 Moved Permanently<br />
Connection: Keep-Alive<br />
Content-Length: 155<br />
Date: Fri, 03 Jul 2009 20:10:51 GMT<br />
Location: <span style="color: #008000;">http://example.net/site.html</span><br />
Content-Type: text/html; charset=UTF-8<br />
Server: Microsoft-IIS/7.0<br />
X-Powered-By: ASP.NET<br />
</code><br />
<code><br />
Processed Response Body bytes (1)<br />
&lt;head&gt;&lt;title&gt;Document Moved&lt;/title&gt;&lt;/head&gt;<br />
&lt;body&gt;&lt;h1&gt;Object Moved&lt;/h1&gt;This document may be found &lt;a HREF="<span style="color: #008000;">http://example.net/site.html</span>"&gt;here&lt;/a&gt;&lt;/body&gt;<br />
</code></p>
<p style="text-align: left;">As you can imagine, it isn&#8217;t a very good idea to disable link translation server-wide because you will need this functionality in a lot of situations.</p>
<p style="text-align: left;">After a long time of trial and error I finally found the setting which caused all the trouble. Somehow it seems to be a problem if the internal site name (see screenshot above again) equals the location to which the web server redirects. In my scenario, the internal site name was set to example.net, exactly the host header enforced by the URL rewrite rule. So the simple solution to this weird  problem was to change the internal site name. You can set it to whatever you want. Since the option &#8220;Forward the original host header instead of the actual one&#8221; is selected, there is no need for a meaningful internal site name. In this case, I set it to www.example.net, but null would have been possible as well.</p>
<p style="text-align: left;">I can&#8217;t say why ISA acts the way it does in this situation. But I&#8217;m sure happy, that I could finally solve the problem. If anybody can add further information on this topic, please leave a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://mrvirtual.de/2009/07/04/url-rewrite-through-isa-server-ends-in-a-loop/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>Installing Symphony CMS on IIS 7.0</title>
		<link>http://mrvirtual.de/2009/05/29/installing-symphony-cms-on-iis-70/</link>
		<comments>http://mrvirtual.de/2009/05/29/installing-symphony-cms-on-iis-70/#comments</comments>
		<pubDate>Fri, 29 May 2009 00:54:08 +0000</pubDate>
		<dc:creator>MRVirtual</dc:creator>
				<category><![CDATA[IIS 7.0]]></category>
		<category><![CDATA[Symphony CMS]]></category>
		<category><![CDATA[URL Rewrite]]></category>
		<category><![CDATA[Windows Server 2008]]></category>

		<guid isPermaLink="false">http://mrvirtual.de/?p=13</guid>
		<description><![CDATA[Perhaps some of you know the Symphony Content Management System. A customer of mine wanted to run it on Windows Server 2008 with IIS 7.0 (in fact on the very same server this WordPress installation is running on). But sadly Symphony doesn’t run out of the box on IIS.
Of course as a base setup you [...]]]></description>
			<content:encoded><![CDATA[<p>Perhaps some of you know the <a href="http://symphony-cms.com/" target="_blank">Symphony Content Management System</a>. A customer of mine wanted to run it on Windows Server 2008 with IIS 7.0 (in fact on the very same server this <a href="http://wordpress.org/" target="_blank">WordPress</a> installation is running on). But sadly Symphony doesn’t run out of the box on IIS.</p>
<p>Of course as a base setup you need PHP and MySQL running. A great source that describes how to achieve this would be the article <a href="http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/" target="_blank">Using FastCGI to Host PHP Applications on IIS 7.0</a> over at iis.net. The same is true for MySQL, so check out <a href="http://learn.iis.net/page.aspx/610/setting-up-mysql-for-php-applications/" target="_blank">Setting up MySQL for PHP applications</a>.<br />
In order to install Symphony CMS with full functionality make sure you have the following PHP extensions enabled:</p>
<ul>
<li> php_mbstring.dll</li>
<li> php_mcrypt.dll</li>
<li>php_mysql.dll</li>
<li>php_xsl.dll</li>
<li>php_zip.dll</li>
</ul>
<p>Before you can start the installation process of Symphony, you have to alter 2 files. Please locate the index.php file in the root folder of the Symphony website. There you should see the lines<br />
<code><br />
define('DOCROOT', rtrim(dirname(dirname(__FILE__)), '/'));<br />
define('DOMAIN', rtrim(rtrim($_SERVER['HTTP_HOST'], '/') . dirname(dirname($_SERVER['PHP_SELF'])), '/'));<br />
</code><br />
right at the beginning.<br />
Change those to<br />
<code><br />
define('DOCROOT', rtrim(dirname(dirname(__FILE__)), '/\\'));<br />
define('DOMAIN', rtrim(rtrim($_SERVER['HTTP_HOST'], '/\\') . dirname(dirname($_SERVER['PHP_SELF'])), '/\\'));<br />
</code><br />
(notice the added double backslashes) and apply the same procedure to the index.php located inside the /symphony folder. As a result you should get:<br />
<code><br />
define('DOCROOT', rtrim(dirname(__FILE__), '/\\'));<br />
define('DOMAIN', rtrim(rtrim($_SERVER['HTTP_HOST'], '/\\') . dirname($_SERVER['PHP_SELF']), '/\\'));<br />
</code><br />
After this step you should be able to install Symphony CMS as you’re used to! The installation process will work now, but there is one more thing you have to adjust. Symphony CMS utilizes the mod_rewrite engine if installed on an Apache web server. The IIS 7.0 pendant to that is called <a href="http://learn.iis.net/page.aspx/460/using-url-rewrite-module/" target="_blank">URL Rewrite Module</a>. You’re gonna have to download and install this to get Symphony running. With the Rewrite Module installed you finally need to set up the rules equally to the mod_rewrite rules defined in the .htaccess files. The relevant portion of the web.config file in the root of your website should look like this:<br />
<code><br />
&lt;rewrite&gt;<br />
&lt;rules&gt;<br />
&lt;rule name="Favicon Rule Stopper" stopProcessing="true"&gt;<br />
&lt;match url="favicon.ico$" /&gt;<br />
&lt;conditions logicalGrouping="MatchAll" /&gt;<br />
&lt;/rule&gt;<br />
&lt;rule name="Image Rule" stopProcessing="true"&gt;<br />
&lt;match url="^image\/(.+\.(jpg|gif|jpeg|png|bmp))$" /&gt;<br />
&lt;conditions logicalGrouping="MatchAll" /&gt;<br />
&lt;action type="Rewrite" url="/extensions/jit_image_manipulation/lib/image.php?param={R:1}" appendQueryString="false" /&gt;<br />
&lt;/rule&gt;<br />
&lt;rule name="Add Trailing Slash" stopProcessing="true"&gt;<br />
&lt;match url="^(.*)$" ignoreCase="false" /&gt;<br />
&lt;conditions logicalGrouping="MatchAll"&gt;<br />
&lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt;<br />
&lt;add input="{URL}" negate="true" pattern="/$" ignoreCase="false" /&gt;<br />
&lt;add input="{URL}" negate="true" pattern="(.*)/$" ignoreCase="false" /&gt;<br />
&lt;/conditions&gt;<br />
&lt;action type="Redirect" url="/{R:1}/" redirectType="Permanent" /&gt;<br />
&lt;/rule&gt;<br />
&lt;rule name="Main Rewrite" stopProcessing="true"&gt;<br />
&lt;match url="^(.*)\/$" ignoreCase="false" /&gt;<br />
&lt;conditions logicalGrouping="MatchAll"&gt;<br />
&lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt;<br />
&lt;/conditions&gt;<br />
&lt;action type="Rewrite" url="/index.php?page={R:1}&amp;amp;{QUERY_STRING}" appendQueryString="false" /&gt;<br />
&lt;/rule&gt;<br />
&lt;/rules&gt;<br />
&lt;/rewrite&gt;<br />
</code><br />
The folder /symphony needs separate rewrite rules. Set up a new web.config file there and set the rewrite-section to<br />
<code><br />
&lt;rewrite&gt;<br />
&lt;rules&gt;<br />
&lt;remove name="Add Trailing Slash" /&gt;<br />
&lt;remove name="Main Rewrite" /&gt;<br />
&lt;remove name="Image Rule" /&gt;<br />
&lt;rule name="Main Rewrite" stopProcessing="true"&gt;<br />
&lt;match url="^(.*)\/$" ignoreCase="false" /&gt;<br />
&lt;conditions logicalGrouping="MatchAll"&gt;<br />
&lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt;<br />
&lt;/conditions&gt;<br />
&lt;action type="Rewrite" url="/symphony/index.php?page={R:1}&amp;amp;{QUERY_STRING}" appendQueryString="false" /&gt;<br />
&lt;/rule&gt;<br />
&lt;rule name="Add Trailing Slash" stopProcessing="true"&gt;<br />
&lt;match url="^(.*)$" ignoreCase="false" /&gt;<br />
&lt;conditions logicalGrouping="MatchAll"&gt;<br />
&lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt;<br />
&lt;add input="{URL}" negate="true" pattern="/symphony$" ignoreCase="false" /&gt;<br />
&lt;add input="{URL}" negate="true" pattern="(.*)/$" ignoreCase="false" /&gt;<br />
&lt;/conditions&gt;<br />
&lt;action type="Redirect" url="/symphony/{R:1}/" redirectType="Permanent" /&gt;<br />
&lt;/rule&gt;<br />
&lt;/rules&gt;<br />
&lt;/rewrite&gt;<br />
</code><br />
So this really was the last step and your installation of Symphony CMS on IIS 7.0 should be up and running!</p>
<p>In this case, I used the latest release of Symphony, which has the version number 2.0.2. I hope I could help some of you out there.</p>
]]></content:encoded>
			<wfw:commentRss>http://mrvirtual.de/2009/05/29/installing-symphony-cms-on-iis-70/feed/</wfw:commentRss>
		<slash:comments>247</slash:comments>
		</item>
	</channel>
</rss>

