+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Sitefinity in the site root - dealing with inheritance

Sitefinity in the site root - dealing with inheritance

8 posts, 1 answered
  1. Marko
    Marko avatar
    148 posts
    Registered:
    30 Jul 2008
    26 Jul 2010
    Link to this post
    Hello.

    Our organization's main public website is a Sitefinity site, and we wanted it served up in the root so that the links can be simply www.oursite.com and so on.  The site has been running fine in the root, but now we need to add some sub-apps and I'm running into trouble with ASP.NET inheritance.  I've read few posts here (and elsewhere online) about using <location> and/or <clear> and <remove> elements, but I can't decide what would be the best approach, because Sitefinity has a very large web.config with lots of sections that can be inherited by the sub-apps (which is what I want to stop).

    I would like to avoid (as much as possible) going to the SUB-APP's web.config and putting in <clear> and <remove> elements, because there might be quite a few.  Also, if anything gets added to the Sitefinity web.config, I would need to remember to check if it gets inherited to the sub-app and whether it needs a <remove> element as well.  If there are multiple sub-apps, this process can become quite messy.

    At first, I thought I'll just wrap most of the Sitefinity web.config in <location path="." inheritInChildApplications="false">, and therefore, any sub-apps that get added to the same IIS site will not be "troubled" by the root site.  In theory, this would work fine, but there is a problem because Sitefinity has another web.config in the "Sitefinity" subfolder.  If I stop inheritance at the root, nothing would get inherited down, not even to the "Sitefinity" subfolder.

    So then, the dilemma is, what is the cleanest, most long-term proof approach?  Do I stop inheritance at the root web.config so that all sub-apps would be clean and independent, but then perform some duplication by re-adding a bunch of Sitefinity web.config stuff in the "sitefinity" subfolder (so that it can work properly)?    Or do I leave Sitefinity's root web.config untouched so that its subfolder ("sitefinity") can inherit all that it needs, but then go to the sub-apps web.configs and add a bunch of <clear> and <remove> elements?    Or perhaps some sort of a hybrid approach?

    I would really appreciate some thoughts on this from the community (and the Telerik gurus).  I realize that this is not really a Sitefinity issue but more of a general ASP.NET one, but considering the setup of a typical Sitefinity site (with a root web.config and a "sitefinity" subfolder web.config), I'd like to see what would the best solution to this.  How would YOU take care of this if you were in my place?

    Thanks!
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    27 Jul 2010
    Link to this post
    Hello Marko,

    Thank you for your questions.

    Indeed there would be some problems if you straight away lock down sections from being inherited in child applications. Mainly it needs to inherit the system.webServer (if you are running II7.0) or system.web (if you are running IIS6.0). If it does not you will experience problems with the web services we use in the Sitefinity back-end for populating result grids. In my oppinion the <clear/> approach combined with locking some sections might be easier. After all if sub applications are not Sitefinity based you will not need to inherit the <telerik> </telerik> section group in your child apps (you will however need to remember that this section is locked if you add a child sitefinity site).

    Greetings,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Marko
    Marko avatar
    148 posts
    Registered:
    30 Jul 2008
    27 Jul 2010
    Link to this post
    I'm on IIS7.5 (in the process of migrating from 6 to 7.5 actually).  Looking at the Sitefinity root web.config, here are the main sections I see, which I would be concerned with, when it comes to inheritance.  If you could tell me which ones of these MUST be inherited in the "Sitefinity" subfolder, and which ones are safest to be locked down to root, that would help me greatly.

    <system.web>
        <httpRuntime ... />
        <httpHandlers .... />
        <customErrorrs ... />
        <compilation ... />
        <roleManager ... />
        <membership ... />
        <profile ... />
        <httpModules ... />
        <authentication ... />
        <authorization ... />
        <siteMap ... />
        <healthMonitoring ... />
        <identity ... />
    </system.web>

    <system.web.extensions ... />

    <system.webServer>
        <modules ... />
        <handlers ... />
    </system.webServer>

    <system.net>
        <mailSettings ... />
    </system.net>

    <system.codedom ... />
    <telerik ... />
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    28 Jul 2010
    Link to this post
    Hi Marko,

    Thank you for getting back to me.

    My experience is with locking down the whole system.web and system.webServer configuration groups. Then I had to make the ~/Sitefinity/web.config file has the same configuration as in system.webServer/handlers and system.webServer/modules. Also when you lock down system.webServer you should not lock validateIntegradtedModeConfiguration property. Something like this can be used:
    <system.webServer>
      <validation validateIntegratedModeConfiguration="false"/>
    </system.webServer>
    <location path="." inheritInChildApplications="false">
      <system.webServer>
      ...

    The mail settings configuration section does not need to be inherited. In Sitefinity if you use Newsletters we store the mail server settings in DB not in web.config. As for the <telerik> section, as I mentioned previously if you are not going to add Sitefinity websites as sub applications you do not need to inherit it then.

    All the best,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Marko
    Marko avatar
    148 posts
    Registered:
    30 Jul 2008
    29 Jul 2010
    Link to this post
    Hmmm... ok, so if I lock down almost everything in the root web.config (system.web, system.webServer, telerik, and all those other sections I listed in the earlier post), then further down in the "sitefinity" subfolder, the only thing I have to do is manually add the system.webServer section (same way it's listed in the root)?  Nothing from system.web, or <telerik> is needed in the "sitefinity" subfolder level, correct?  My simple test, at the moment, seems to work.

    The <validation validateIntegratedModeConfiguration="false"/> element seems to be ok if I lock it down in the root, but then simply repeat it in the web.config in "sitefintiy" sub-folder level, so I would prefer to do that.

    When it comes to the <telerik> section and other Sitefinity sub-apps within the same IIS site....  Does it matter if the <telerik> section is locked in the root?  I mean, the Sitefinity sub-apps would have all things they need listed in THEIR OWN independent web.config, so they wouldn't have to inherit anything from the root (unless I wanted them to share some settings--but this is not required, correct?).

  6. Marko
    Marko avatar
    148 posts
    Registered:
    30 Jul 2008
    29 Jul 2010
    Link to this post
    By the way... I'm subscribed to this thread, but it does not send me email notifications when someone else replies to the thread.  I used to get email notifications before.
  7. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    30 Jul 2010
    Link to this post
    Hi Marko,

    Thank you for getting back to me.

    Yes you just need to copy over the system.webServer configuration section to the web.config in the Sitefinity sub directory. As for the telerik configuration section you are correct. You can make the child applications inherit it if you need them to share a data provider for example. Other wise you would have to use clear in all provider declarations.

    Could you submit a general feedback ticket regarding the issue with thread subscription? We will relay this ticket to our web team to investigate if there are any issues.

    All the best,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  8. Marko
    Marko avatar
    148 posts
    Registered:
    30 Jul 2008
    30 Jul 2010
    Link to this post
    Will do.

    Thanks for the discussion about the inheritance.  I think I will proceed by locking down the root very heavily, then copying the needed sections in the sitefinity subfolder.  This will keep Sitefinity working correctly with minimal extra effort, while allowing me to have clean and independent sub-apps.
Register for webinar
8 posts, 1 answered