2 Project in same WebRoot

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default 2 Project in same WebRoot

    I've 2 projects in same WEbRoot. Each project has is own Subdirectory.
    Project #1: /Journal/ '<-- Anonymous
    /Journal/Admin/ ' <-- WebForm Authentication for each web
    page

    Project #2: /Recettes/ '<--- Anonymous
    /Recettes/Admin/ '<--- WebForm Authentication for each web
    page

    I've a Web.Config file that work perfectly for Form authentication. But I
    really don't know how to add security for my second project. I ask this
    because the hosting server only allow ONE (1) web.Config file in webroot
    folder... I show you my present Web.Config file. The two project must have
    distinct login page and if possible distinct custom error page... They are
    completly different in subject and design.

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>

    <system.web>
    <pages validateRequest="false" />
    <compilation defaultLanguage="vb" debug="true" />
    <customErrors mode="On" defaultRedirect="Journal/Err.aspx">
    <error statusCode="404" redirect="Journal/Err.aspx" />
    <error statusCode="403" redirect="Journal/Err.aspx" />
    </customErrors>
    <authentication mode="Forms">
    <forms loginUrl="Journal/admin/Login.aspx" path="/">
    </forms>
    </authentication>
    </system.web>
    <location path="Journal/Admin">
    <system.web>
    <authorization>
    <deny users ="?" />
    </authorization>
    </system.web>
    </location>

    </configuration>


    The only thing I think is to add some kind of location to the main
    <configuration> tag . I'm in the right direction?
    Thanks
    Francois


    Francois Soucy Guest

  2. Similar Questions and Discussions

    1. Conflicts with Webroot Spy Sweeper
      I notice that some of the graphics don't load on either my IE or Mozilla browsers. I think I isolated it to the Webroot Spy Sweeper software I...
    2. ColdFusion on Apache webroot question
      My goal is to be able to instantiate a ColdFusion component that is stored in a common components directory. My webserver is Apache. I have...
    3. change webroot of integrated webserver CFMX 7
      I'm using the integrated webserver of MX but want the webroot to be on a different directory. How can I change it?
    4. How to upload file outside webroot
      Hi.... may i know how i can using html forms on a webpage to upload a file to outside the webroot? is this possible? do i have to chmod any...
    5. Large PHP Project... Need Project Manager
      Hey, I've got a nice CMS (in quite stable 2.0 form) that I need a Project Manager who can just deal with some bugs/answer questions for the next...
  3. #2

    Default RE: 2 Project in same WebRoot

    Hi Francois,

    I think the <location> element is the right solution for the problem. By
    setting its path property, we can specify configrations for a sub folder or
    even a particular page, including the authention settings.

    Luke

    [MSFT] Guest

  4. #3

    Default RE: 2 Project in same WebRoot

    Hi Francois,

    Still any concerns on this issue? If so, please feel free to post here.

    Regards,

    Luke

    [MSFT] Guest

  5. #4

    Default Re: 2 Project in same WebRoot

    I've discuted a lot of that in another groups. I can't use web.config to do
    what It seem that a single web.config file can't handle 2 directory with
    each one a login page.. For now I check for a completly personal solution
    for authentification or I must also check for a new Web Hosting..

    "[MSFT]" <lukezhan@online.microsoft.com> wrote in message
    news:1LJM4c2fEHA.2644@cpmsftngxa06.phx.gbl...
    > Hi Francois,
    >
    > Still any concerns on this issue? If so, please feel free to post here.
    >
    > Regards,
    >
    > Luke
    >

    Francois Soucy Guest

  6. #5

    Default Re: 2 Project in same WebRoot

    Hi Francois,

    I don't understood why you said "I can't use web.config to do what It seem
    that a single web.config file can't handle 2 directory with each one a
    login page." A Web.config can contains multiple <location> elements. You
    may specify different configration with them.

    Additionally, are "Journal" and "Recettes" all web application? If so, they
    can also have web.config file intead of the one in web root.

    Luke

    [MSFT] Guest

  7. #6

    Default Re: 2 Project in same WebRoot

    Because my web hosting doesn't allow me to put more than 1 web.config file.
    The only one I can use MUST be located in webroot.


    "[MSFT]" <lukezhan@online.microsoft.com> wrote in message
    news:5rT$rKEgEHA.540@cpmsftngxa06.phx.gbl...
    > Hi Francois,
    >
    > I don't understood why you said "I can't use web.config to do what It seem
    > that a single web.config file can't handle 2 directory with each one a
    > login page." A Web.config can contains multiple <location> elements. You
    > may specify different configration with them.
    >
    > Additionally, are "Journal" and "Recettes" all web application? If so,
    they
    > can also have web.config file intead of the one in web root.
    >
    > Luke
    >

    Francois Soucy Guest

  8. #7

    Default Re: 2 Project in same WebRoot

    Then, how about the solution with <location> element? Did it not help on
    the issue?

    Luke

    [MSFT] Guest

  9. #8

    Default Re: 2 Project in same WebRoot

    Nope this solution didn't work for me. I can put wich directory is protected
    but I can't put a second login page... Users who try to access protected
    page from second project are redirected to the login page of the first
    project.. But I've find another solution for the login.. For now I'm also
    searching a host provider that will permit me to have 2 projects in same
    webroot.. I did't not even understant why Brinkster (My present web hosting)
    in cautioned by Microsoft.....

    Francois

    "[MSFT]" <lukezhan@online.microsoft.com> wrote in message
    news:KbP9owPgEHA.3452@cpmsftngxa06.phx.gbl...
    > Then, how about the solution with <location> element? Did it not help on
    > the issue?
    >
    > Luke
    >

    Francois Soucy Guest

  10. #9

    Default Re: 2 Project in same WebRoot

    Hi Francois,

    How did you set the <authentication> element in web.config? For its
    loginUrl property, we also can set a path like:

    <authentication mode="Forms">
    <forms name=".ASPXFORMSDEMO" loginUrl=". /Journal/Admin/logon.aspx"
    protection="All" path=" ./Journal/Admin/" timeout="30" />
    </authentication>


    Luke

    [MSFT] Guest

  11. #10

    Default Re: 2 Project in same WebRoot

    See this. This is what I've for this moment..

    <configuration>

    <system.web>
    <pages validateRequest="false" />
    <compilation defaultLanguage="vb" debug="true" />
    <customErrors mode="On" defaultRedirect="Journal/Err.aspx">
    <error statusCode="404" redirect="Journal/Err.aspx" />
    <error statusCode="403" redirect="Journal/Err.aspx" />
    </customErrors>
    <authentication mode="Forms">
    <forms loginUrl="Journal/admin/Login.aspx" path="/">
    </forms>
    </authentication>
    </system.web>
    <location path="Journal/Admin">
    <system.web>
    <authorization>
    <deny users ="?" />
    </authorization>
    </system.web>
    </location>

    </configuration>

    Francois

    "[MSFT]" <lukezhan@online.microsoft.com> wrote in message
    news:qk7heo1gEHA.2876@cpmsftngxa06.phx.gbl...
    > Hi Francois,
    >
    > How did you set the <authentication> element in web.config? For its
    > loginUrl property, we also can set a path like:
    >
    > <authentication mode="Forms">
    > <forms name=".ASPXFORMSDEMO" loginUrl=". /Journal/Admin/logon.aspx"
    > protection="All" path=" ./Journal/Admin/" timeout="30" />
    > </authentication>
    >
    >
    > Luke
    >

    Francois Soucy Guest

  12. #11

    Default Re: 2 Project in same WebRoot



    I think you should put the <authentication mode="Forms"> inner the
    <location> element, because only Journal/admin/ need form authentication.
    For example
    :
    <location path="Journal/Admin">
    <system.web>

    <authentication mode="Forms">
    <forms loginUrl="Journal/admin/Login.aspx" path="/">
    </forms>
    </authentication>

    <authorization>
    <deny users ="?" />
    </authorization>
    </system.web>
    </location>

    Luke



    [MSFT] Guest

  13. #12

    Default Re: 2 Project in same WebRoot

    Hello Francois,

    I was reviewing the issue thread. How is everything going? If you have any
    more concerns on it, please feel free to reply here and we will follow up.

    Thanks very much.

    Best regards,
    Yanhong Huang
    Microsoft Community Support

    Get Secure! ¨C [url]www.microsoft.com/security[/url]
    Register to Access MSDN Managed Newsgroups!
    -http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
    p&SD=msdn

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Yan-Hong Huang[MSFT] Guest

  14. #13

    Default Re: 2 Project in same WebRoot

    It's not only Journal/Admin that need form authentication ( Recette/Admin
    also need a form authentification). My 2 projects need forms
    authentications. Each project are different so user will not been the same.
    But I've a big constraint, I can have ONLY ONE web.config in all my folder.
    This unique file MUST be in webroot folder.. For the moment my Journal
    project is working well with authentication form for Admin folder. For my
    other project ( Recette ), I was working on everething except forms that are
    in Admin folder of this project. the only solution i can consider for now is
    to change my web hosting... Brinkster is really not what they said...

    Thank,
    Francois

    "[MSFT]" <lukezhan@online.microsoft.com> wrote in message
    news:ZzaqsmChEHA.3356@cpmsftngxa06.phx.gbl...
    >
    >
    > I think you should put the <authentication mode="Forms"> inner the
    > <location> element, because only Journal/admin/ need form authentication.
    > For example
    > :
    > <location path="Journal/Admin">
    > <system.web>
    >
    > <authentication mode="Forms">
    > <forms loginUrl="Journal/admin/Login.aspx" path="/">
    > </forms>
    > </authentication>
    >
    > <authorization>
    > <deny users ="?" />
    > </authorization>
    > </system.web>
    > </location>
    >
    > Luke
    >
    >
    >

    Francois Soucy Guest

  15. #14

    Default Re: 2 Project in same WebRoot

    Hello Yan-Hong,

    You can read my last reply to [MSFT]. It was written 2 min
    ago! :) My only concerns is only this technical limitation of my Web
    Hosting. Only one web.config in webroot. No more at any other place... Every
    book I read said that I can put 1 configuration file in each folder that
    need a different setting from the master file... Even microsoft tell that in
    MSDN. I really think I must change my webhosting and microsoft MUST stop to
    sustain Brinkster.

    I post you the link to brinkster that concerne Web.Config file.:
    [url]http://www.brinkster.com/Kb/Kb.asp?kb=81832[/url]

    Thanks
    Francois

    P.S.: Sorry for my english!

    "Yan-Hong Huang[MSFT]" <yhhuang@online.microsoft.com> wrote in message
    news:2Vp$3schEHA.3936@cpmsftngxa10.phx.gbl...
    > Hello Francois,
    >
    > I was reviewing the issue thread. How is everything going? If you have any
    > more concerns on it, please feel free to reply here and we will follow up.
    >
    > Thanks very much.
    >
    > Best regards,
    > Yanhong Huang
    > Microsoft Community Support
    >
    > Get Secure! ¨C [url]www.microsoft.com/security[/url]
    > Register to Access MSDN Managed Newsgroups!
    > -http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
    > p&SD=msdn
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >

    Francois Soucy Guest

  16. #15

    Default Re: 2 Project in same WebRoot

    Hi Francois,

    Thank you for the reply. What I suggested is a solution without changing
    the webhost. It can be applied within only one web.config in the web root
    folder. If you have to work with the original web host, you may consider it:

    As I said before, we can add multiple <location> elements in a web.config
    file, for example:

    <location path="Journal/Admin">
    <system.web>

    <authentication mode="Forms">
    <forms loginUrl="Journal/admin/Login.aspx" path="/">
    </forms>
    </authentication>

    <authorization>
    <deny users ="?" />
    </authorization>
    </system.web>
    </location>

    <location path=" Recette/Admin">
    <system.web>

    <authentication mode="Forms">
    <forms loginUrl="Recette/admin/Login.aspx" path="/">
    </forms>
    </authentication>

    <authorization>
    <deny users ="?" />
    </authorization>
    </system.web>
    </location>

    As you see, I have two <location> elements and set different login form for
    the two subs.

    If you still have questions, please feel free to let me know.

    Luke

    [MSFT] Guest

  17. #16

    Default Re: 2 Project in same WebRoot

    Hi Francois,

    Thanks for your update. Luke has replied to your recent post on technical
    part.

    I also checked that article in brinkster. As we all know, ASP.NET supports
    web.config in subdirectories. There should be some limitation on brinkster
    which cause them not directly support it. You may contact them for the
    reason of it. However, it is a third party company and so we have no
    control over them. Or you may try to select some other web hosting provider
    who can support it.

    If you feel there is any we can do, please feel free to let me know. Thanks
    very much for your understanding.

    Best regards,
    Yanhong Huang
    Microsoft Community Support

    Get Secure! ¨C [url]www.microsoft.com/security[/url]
    Register to Access MSDN Managed Newsgroups!
    -http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
    p&SD=msdn

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Yan-Hong Huang[MSFT] Guest

  18. #17

    Default Re: 2 Project in same WebRoot

    Hi yan-Hong,

    I know that is a third party compagny but it's a
    compagny that is listed INSIDE VS.Net in section "Web Hosting" !!! This is
    where I find the situation funny!
    Maybe a little word from Microsoft to this company could make big change...
    Don't you think? :)

    Thank for the reply
    Francois


    "Yan-Hong Huang[MSFT]" <yhhuang@online.microsoft.com> wrote in message
    news:U7d%23JsZiEHA.2632@cpmsftngxa10.phx.gbl...
    > Hi Francois,
    >
    > Thanks for your update. Luke has replied to your recent post on technical
    > part.
    >
    > I also checked that article in brinkster. As we all know, ASP.NET supports
    > web.config in subdirectories. There should be some limitation on brinkster
    > which cause them not directly support it. You may contact them for the
    > reason of it. However, it is a third party company and so we have no
    > control over them. Or you may try to select some other web hosting
    > provider
    > who can support it.
    >
    > If you feel there is any we can do, please feel free to let me know.
    > Thanks
    > very much for your understanding.
    >
    > Best regards,
    > Yanhong Huang
    > Microsoft Community Support
    >
    > Get Secure! ¨C [url]www.microsoft.com/security[/url]
    > Register to Access MSDN Managed Newsgroups!
    > -http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
    > p&SD=msdn
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >

    Francois Soucy Guest

  19. #18

    Default Re: 2 Project in same WebRoot

    Thank,

    I will consider that when I will construct my Admin section of
    my project. I'.ve never think off that because on every documentation I've
    read the location tag is located inside System.web tag.

    Francois

    "[MSFT]" <lukezhan@online.microsoft.com> wrote in message
    news:nmYWIFOiEHA.2132@cpmsftngxa10.phx.gbl...
    > Hi Francois,
    >
    > Thank you for the reply. What I suggested is a solution without changing
    > the webhost. It can be applied within only one web.config in the web root
    > folder. If you have to work with the original web host, you may consider
    > it:
    >
    > As I said before, we can add multiple <location> elements in a web.config
    > file, for example:
    >
    > <location path="Journal/Admin">
    > <system.web>
    >
    > <authentication mode="Forms">
    > <forms loginUrl="Journal/admin/Login.aspx" path="/">
    > </forms>
    > </authentication>
    >
    > <authorization>
    > <deny users ="?" />
    > </authorization>
    > </system.web>
    > </location>
    >
    > <location path=" Recette/Admin">
    > <system.web>
    >
    > <authentication mode="Forms">
    > <forms loginUrl="Recette/admin/Login.aspx" path="/">
    > </forms>
    > </authentication>
    >
    > <authorization>
    > <deny users ="?" />
    > </authorization>
    > </system.web>
    > </location>
    >
    > As you see, I have two <location> elements and set different login form
    > for
    > the two subs.
    >
    > If you still have questions, please feel free to let me know.
    >
    > Luke
    >

    Francois Soucy Guest

  20. #19

    Default Re: 2 Project in same WebRoot

    Yes, <location> element should be in the <System.web> tag. But it can have
    a sub <System.web> tag inside, to indicate the different configration data
    for the <location> element.

    Luke

    [MSFT] Guest

  21. #20

    Default Re: 2 Project in same WebRoot

    Hi Francois,

    I think they are partners of Microsoft. But we can't force them to
    implement anything.

    I will try to provide your feedback to some team to see whether we can do
    something for it. Don't expect too much. :) If this feature is quite
    important for you, my suggestion for you is to talk with them. If they
    can't provide, you may change to another hosting company who can provide
    it.

    Thanks very much.

    Best regards,
    Yanhong Huang
    Microsoft Community Support

    Get Secure! ¨C [url]www.microsoft.com/security[/url]
    Register to Access MSDN Managed Newsgroups!
    -http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
    p&SD=msdn

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Yan-Hong Huang[MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139