locked
It doesn't work to use virtual directory when physical directory is under C:\User\Tony RRS feed

  • Question

  • User1366894300 posted

    First some basic information
    I use Windows Vista Home Premium so the IIS is 7.0.

    If I create a virtual directory Foo and assign it to this physical directory C:\temp\Mytest
    it works just fine when I write in the browser localhost/Foo
    In the virtual directory Foo I have just the file Default.aspx with just a literal text

    Now I copy my folder C:\temp\Mytest and put it here
    C:\Users\tony
    so Mytest is below C:\Users\tony
    Now I delete the old virtual directory Foo and create a new virtual Directory Foo and assign it to this physical directory
    C:\Users\tony\Foo

    When I now use the browser and write localhost/Foo I get this error
    HTTP Error 401.3 - Unauthorized
    You do not have permission to view the directory or page according to access control list (ACL) or encryption settings for this resource on the Web server.

    It also works if I put Mytest under C:\Users but as soon as I put it under C:\Users\tony I get the error


    I always use the built-in web server in asp.net so this is not a huge problem.
    But in some cases I might want to test my program by using the real IIS.
    I could of course copy my folder I want to test so they are not within the C:\Users\tony folder but I still
    want to know if I can fix so I can use IIS when my physical directory is within the C:\Users\tony folder.
    All my programs is stored under C:\Users\tony

    I have even changed this.
    In IIS manager select applicationpools and select DefaultAppPool and click advanced setting.
    select identity and change this to local system which have all privs.
    But it gave the same error.

    One thing that is interesting is if I have a physical directory that is located under C:\Users\tony and I do this it works just fine.
    When I use add program in IIS manager and select connect as in field direct autentisering and
    enter my user name tony and my password it works just fine.

    What is very strange to me is that even when the account is local system I get this error when the physical directory is below the C:\Users\tony
    HTTP Error 401.3 - Unauthorized
    You do not have permission to view the directory or page according to access control list (ACL) or encryption settings for this resource on the Web server.


    //Tony

    Thursday, February 6, 2014 4:34 AM

Answers

  • User-760709272 posted

    The Users folder is a restricted folder that the account your site is running under doesn't have access to.  Change the account your code runs under to one that has the rights (look at the authentication settings for the site and the app pool in IIS Admin), or just don't put your sites in the User folder :)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 6, 2014 4:46 AM