locked
404 error where physical path is wrong for "subsite" RRS feed

  • Question

  • User1503005938 posted

    I am trying to publish some internal use only asp.net projects to a server on our lan. There are several aspects of this that I'm confused about.

    Using vs 2017, webdeploy successfully published the site. However when I try to access the site, I get a 404 error. I get this error regardless of whether I spec the ip address of the server, and/or the default.aspx page, or index.html which I manually created for testing purposes after this issue arose.

    What is particularly noteworthy is that while the project has been published to c:\inetpub\box on the server (2012 r2), the 404 error lists the physical path as c:\inetpub\wwwroot\box, which does not exist.

    I suspect that the issue may be that I misunderstand how to configure what I'll call a "subsite". I would like several asp.net projects to be published on this server, at addresses like

    http://myserver/box

    http://myserver/contact

    the root website, http://myserver, might just contain a page with links to the subsites.

    I can reach http://myserver and it shows the default.aspx that I have in wwwroot, which is a good indication that wwwroot is regarded as the go-to site for iis.

    In IIS I created the new website box and the physical path there is listed as c:\inetpub\box

    There are other websites on the same server from earlier tests. All of them run on port 80.

    The 404 error message shows off the incorrect physical path c:\inetpub\wwwroot\box, it seems that wwwroot somehow has precedence and gets injected into url request like http://myserver/box. How do I adjust this?

    Sunday, April 26, 2020 3:54 PM

Answers

  • User1503005938 posted

    What worked is to deploy the several subsites under Default Web Site, which on my system is c:\inetpub\wwwroot. The site name is "box"

    [1] create a folder in wwwroot and name it"box"

    [2] Open IIS manager, expand the "Default Web Site". The new "box" folder appears there. Right click on "box" and select "Convert to Application". Keep the defaults.

    [3] Deploy with asp.net WebDeploy with these settings

    Server: http://myserver
    Site Name: Default Web Site\box
    User Name: domain\account
    Pswd: x

    Not sure if this is the ideal manner but it does work for the purpose.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Tuesday, April 28, 2020 2:45 PM

All replies

  • User-460007017 posted

    Hi sevi,

    It sounds like IIS is not understanding your web application path. Please ensure you are hosting your application as an virtual application and clean cache so everything will be isolated.

    https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/site/application/

    Best Regards,

    Jokies Ding

    Monday, April 27, 2020 6:15 AM
  • User1503005938 posted

    What worked is to deploy the several subsites under Default Web Site, which on my system is c:\inetpub\wwwroot. The site name is "box"

    [1] create a folder in wwwroot and name it"box"

    [2] Open IIS manager, expand the "Default Web Site". The new "box" folder appears there. Right click on "box" and select "Convert to Application". Keep the defaults.

    [3] Deploy with asp.net WebDeploy with these settings

    Server: http://myserver
    Site Name: Default Web Site\box
    User Name: domain\account
    Pswd: x

    Not sure if this is the ideal manner but it does work for the purpose.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Tuesday, April 28, 2020 2:45 PM