Network Load Balancing - Same Server Two Sites
<p>We've had to come up with a solution at work to do day-time releases of our intranet application whilst maintaining 100% uptime.  This is because we do builds during the day with high-priority bug fixes that have to go out on the same day.</p>

<p><a href="http://stackoverflow.com/questions/1544206/asp-net-application-daytime-release">An option suggested to me</a> was using network load balancing with two sites on the same server, which is really a great solution for our needs (we can't afford another server with the same hardware, they're £5k+ for our setup).</p>

<p>So I've taken a look at <a href="http://www.c-sharpcorner.com/UploadFile/gopenath/Page107182007032219AM/Page1.aspx" rel="nofollow">this article</a> where it states the following:</p>

<blockquote>
  <p>For session state to be maintained across different web servers in the web farm, the application path of the website (for example. \LM\W3SVC\2) in the IIS metabase should be identical in all the webservers in the web farm. </p>
</blockquote>

<p>This is a problem as the application paths will <em>have</em> to be different if the same website is NLB'd on the same server.  We <em>need</em> to maintain session state across the two sites (as opposed to web servers) otherwise we'll be flooded with calls from angry users.</p>

<p>So can we set up two sites, on one server that uses NLB and can maintain all state?  The sites are identical by the way, just one will be more of a recent build for bugfixes.</p>

<p><strong>EDIT</strong> <em>(SOLVED)</em></p>

<p>So following this I had a hunt around to find <a href="http://devilswork.wordpress.com/2009/01/28/login-failed-for-user-networkservice/" rel="nofollow">this article</a>.  It describes issues around the use of the <code>SQLServer</code> option in <code>sessionState</code> in your web.config.  It works just fine, except for one thing; session data is not being stored anymore, which breaks all security for us.  In <code>Session_Start</code> of my Global.asax file I have some DB-calling code which sets session data which is used throughout the intranet site for quick access to user details.</p>

<pre><code>&lt;sessionState mode="SQLServer" sqlConnectionString="Data Source=localhost;Integrated Security=True" /&gt;
</code></pre>

<p>Is it because of the DB-access issues or because of the <code>sessionState</code>?</p>

<p><strong>EDIT EDIT</strong></p>

<p>Okay, I figured I hadn't restarted the web service after playing around with the authentication which caused it to break.  So the last thing I need to know how to do is switch between the websites whilst whilst pointing at the same location.  So say we had a URL of <a href="http://mycompanyintranet/" rel="nofollow">http://mycompanyintranet/</a> that pointed to the "CompanyIntranet1" and we also had a site of "CompanyIntranet2" in IIS, how would we get <a href="http://mycompanyintranet/" rel="nofollow">http://mycompanyintranet/</a> to point to "CompanyIntranet2"?</p>
