Optionally provide private feedback to help us improve this article...

Thank you for your feedback!


Installing InstantForum in a standard child directory

New

If you're installing InstantForum on a shared hosting account you may not have the option to install InstantForum within a dedicated IIS web application. Your hosting company may only allow one IIS web application for the root of your web site.

This article only applies if your not able to install InstantForum within the root of a IIS web application / virtual directory also sometimes referred to as application starting point.

To install InstantForum in a standard child directory of a IIS web site or web application you'll need to follow the steps below.

Our Example

We'll use the InstantForum Single Sign-On example as a basis for this article. This example offers a single IIS web application with InstantForum installed in a standard child directory / folder called "InstantForum". You can see this below…

As you can see the "InstantForum2010SSOSample" folder is our IIS web application / web site root and InstantForum is installed in a standard child directory called "InstantForum" - this is not a web applicaiton. The name of the child folder you choose to install InstantForum to is important as we'll need to use this to update our URLRewrite.config & web.config file.

If you're using InstantForum 2010-2 or below you'll need to ensure you also copy the "App_Code" folder from the InstantForum folder into the root of your web site. This is not required for InstantForum 2010-3 or above however you will still need to follow the steps below.

1. Copy the InstantForum assemblies into your web site root "bin" directory

You'll need to copy all .NET assemblies used by InstantForum into your root /bin directory. We would suggest simply copying the InstantForum/Bin folder into your main web site. If your main web site already contains references to assemblies used by InstantForum such as "Microsoft.AspNet.Identity.Core.dll" we would suggest leaving your existing versions in place and only copying the assemblies from InstantForum that don't already exist in your main web site.

InstantASP_Licenses.config

Ensure you leave the "InstantASP_Licenses.config" file within the InstantForum2010SSOSample\InstantForum\Bin folder.

2. Add the following entries to your web.config within your web site root

Application Settings

You'll need to add the InstantASP_VirtualPath application setting as shown below. This should be the relative path to your InstantForum folder from the root of your webs site. For example we've installed InstantForum to a child folder called "InstantForum" so we simply enter this name...

<add key="InstantASP_VirtualPath" value="InstantForum"/>

This will ensure our HTTP modules are able to find the configuration & localization files.

IMPORTANT: You should leave the InstantForum web.config file within the "InstantForum" standard child folder. You should remove completely the InstantASP_VirtualPath  application setting from the InstantForum web.config. This will ensure the InstantASP_VirtualPath setting in your root web.config as defined above is always used.

You can optionally add the InstantForum database connection string to your web sites web.config file.This is only needed if you wish to references our assemblies from your website code and use our .NET API to query data objects from your own web application.

<connectionStrings>
<add name="InstantASP_ConnectionString" connectionString="server=localhost;trusted_connection=true; database=InstantForum;" />
</connectionStrings>

HttpModules

You'll need to add the following HTTP Modules to your root web sites web.config file. This should be placed inside the <System.Web> element.

<httpModules>
<add type="InstantASP.Common.HttpModule.SecurityModule, InstantASP.Common" name="SecurityModule"/>
<add type="InstantASP.Common.HttpModule.ServiceModule, InstantASP.Common" name="ServiceModule"/>
<add type="InstantASP.Common.HttpModule.EmailModule, InstantASP.Common" name="EmailModule"/>
<add type="InstantASP.Common.HttpModule.ExceptionModule, InstantASP.Common" name="ExceptionModule"/>
<add type="InstantASP.InstantForum.HttpModule.URLRewritterModule, InstantASP.InstantForum" name="RewriterModule"/>
<add type="InstantASP.InstantForum.HttpModule.ForumModule, InstantASP.InstantForum" name="ForumModule"/>
</httpModules>

Or if your using IIs 7 "Integrated" application pools you'll need to add the same HTTP modules to your <System.WebServer> element as shown below…

<modules>
<add name="SecurityModule" preCondition="managedHandler" type="InstantASP.Common.HttpModule.SecurityModule, InstantASP.Common"/>
<add name="ServiceModule" preCondition="managedHandler" type="InstantASP.Common.HttpModule.ServiceModule, InstantASP.Common"/>
<add name="EmailModule" preCondition="managedHandler" type="InstantASP.Common.HttpModule.EmailModule, InstantASP.Common"/>
<add name="RewriterModule" preCondition="managedHandler" type="InstantASP.InstantForum.HttpModule.URLRewritterModule, InstantASP.InstantForum"/>
<add name="ForumModule" preCondition="managedHandler" type="InstantASP.InstantForum.HttpModule.ForumModule, InstantASP.InstantForum"/>
</modules>

3. Ensure you only have 1 <authentication> element in your root web.config

You may need to remove the following tag from the forum web.config file if the forum is installed in a standard child folder.

<authentication mode="Forms">
<forms name="InstantASP" cookieless="UseUri" loginUrl="Logon.aspx" protection="All" slidingExpiration="true" path="/" />
</authentication>

You should ensure this tag is present in your root web.config. InstantForum requires forms authentication to be enabled.

That's It!

I hope this information has been helpful. As always if you have any questions please don't hesitate to contact us.