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

  • Question

  • User1733860820 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 4:03 PM

All replies

  • User288213138 posted

    Hi sevi,

    The 404 error message shows off the incorrect physical path c:\inetpub\wwwroot\box,

    Please try to clean cache and make sure the file is in c:\inetpub\wwwroot\box.

    Best regars,

    Sam

    Monday, April 27, 2020 8:39 AM
  • User1733860820 posted

    You mean the browser cache?

    I don't want to host the application at c:\inetpub\wwwroot\box, it is hosted at c:\inetpub\box

    Monday, April 27, 2020 3:28 PM
  • User475983607 posted

    I don't want to host the application at c:\inetpub\wwwroot\box, it is hosted at c:\inetpub\box

    Your response does not make sense.  The actual folder makes little difference.  While pointing to inerpub is odd at best, it should work.  Most likely the actual error is you IIS configuration.  The URL you are using is probably bound to wwwroot. 

    You might consider visiting an IIS support forum.

    Monday, April 27, 2020 3:36 PM
  • User1733860820 posted

    I don't understand the elements, that's for sure. This is the best guide I've found so far, but it still doesn't quite add up.

    https://docs.microsoft.com/en-us/iis/get-started/planning-your-iis-architecture/understanding-sites-applications-and-virtual-directories-on-iis

    I put the folder for box in inetpub because I found posts stating that this was the way to go. But I'm sure you're right.

    I do have a post in on an IIS forum but in the meantime, what would help make things clear to me is if someone would post a simple step by step for fulfilling this need.

    The need is to have multiple asp.net sites hosted at http://myserver. For example http://myserver/box and http://myserver/contact.

    Something like, starting in IIS, at Sites create two new websites, box and contact, and for each of those new sites create an application (box and contact) with paths (if inetpub doesn't make sense what does? I thought it would make sense because it might already have perms for this purpose), and then for each of those applications, create a virutual directory (which I haven't understood the need of, since application has a physical path already, and the virtual directory needs one too).

    If someone provides that kind of walkthrough it'd help me set this sorted.

    Monday, April 27, 2020 3:51 PM
  • User475983607 posted

    sevi

    I do have a post in on an IIS forum but in the meantime, what would help make things clear to me is if someone would post a simple step by step for fulfilling this need.

    The need is to have multiple asp.net sites hosted at http://myserver. For example http://myserver/box and http://myserver/contact.

    I'll assume you are trying to use the default site in IIS.  The default site points to %SystemDrive%\inetpub\wwwroot.  Simply create a folder in wwwroot and name it"box".  Open IIS manager, expand the "Default Web Site", right click on "box" and select "Convert to Application".  Keep the defaults.  Deploy your web application to the "box" folder.

    Monday, April 27, 2020 4:09 PM
  • User1733860820 posted

    It works, thank you.

    In most of the writeups on this topics the last step is to create a virtual directory. They are optional?

    Monday, April 27, 2020 4:27 PM
  • User1733860820 posted

    Using Webdeploy, the site fails to validate with "the site 'box' does not exist"

    The settings are:

    server: http://myserver
    site name: box
    user name: mydomain.com\myaccount
    psws: x

    Oddly it did validate, and publish, with those settings when I had the original incomplete config on the IIS side. I just couldn't browse the site.

    Monday, April 27, 2020 4:35 PM
  • User475983607 posted

    Your server named is http://myserver/box not box.  Or just deploy to the file system.  

    Monday, April 27, 2020 6:11 PM
  • User1733860820 posted

    http://myserver/box fails with the same message as box

    http://myserver/box is the url, I wonder why they use the term "site name"?

    Monday, April 27, 2020 9:46 PM
  • User288213138 posted

    Hi sevi,

    The need is to have multiple asp.net sites hosted at http://myserver. For example http://myserver/box and http://myserver/contact.

    You only need to create the corresponding folder under your myserver, and point to this folder in the physical path.

    like this:

    Best regards,

    Sam

    Tuesday, April 28, 2020 3:23 AM
  • User1733860820 posted

    Hi Sam and thanks for the reply. Maybe you didn't read all of the posts above, there are quite a few now, but I did that and other things, still not working.

    Tuesday, April 28, 2020 3:59 AM
  • User1733860820 posted

    This is what works for site name:

    Default Web Site\box

    Thank you mgebhard for all of your help with this.

    Tuesday, April 28, 2020 2:32 PM