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
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?
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
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
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.
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.
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.
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.
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.
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
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
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.
Member
10 Points
84 Posts
404 error where physical path is wrong for "subsite"
Apr 26, 2020 04:03 PM|sevi|LINK
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?
Contributor
3370 Points
1409 Posts
Re: 404 error where physical path is wrong for "subsite"
Apr 27, 2020 08:39 AM|samwu|LINK
Hi sevi,
Please try to clean cache and make sure the file is in c:\inetpub\wwwroot\box.
Best regars,
Sam
Member
10 Points
84 Posts
Re: 404 error where physical path is wrong for "subsite"
Apr 27, 2020 03:28 PM|sevi|LINK
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
All-Star
53031 Points
23611 Posts
Re: 404 error where physical path is wrong for "subsite"
Apr 27, 2020 03:36 PM|mgebhard|LINK
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.
Member
10 Points
84 Posts
Re: 404 error where physical path is wrong for "subsite"
Apr 27, 2020 03:51 PM|sevi|LINK
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.
All-Star
53031 Points
23611 Posts
Re: 404 error where physical path is wrong for "subsite"
Apr 27, 2020 04:09 PM|mgebhard|LINK
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.
Member
10 Points
84 Posts
Re: 404 error where physical path is wrong for "subsite"
Apr 27, 2020 04:27 PM|sevi|LINK
It works, thank you.
In most of the writeups on this topics the last step is to create a virtual directory. They are optional?
Member
10 Points
84 Posts
Re: 404 error where physical path is wrong for "subsite"
Apr 27, 2020 04:35 PM|sevi|LINK
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.
All-Star
53031 Points
23611 Posts
Re: 404 error where physical path is wrong for "subsite"
Apr 27, 2020 06:11 PM|mgebhard|LINK
Your server named is http://myserver/box not box. Or just deploy to the file system.
Member
10 Points
84 Posts
Re: 404 error where physical path is wrong for "subsite"
Apr 27, 2020 09:46 PM|sevi|LINK
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"?
Contributor
3370 Points
1409 Posts
Re: 404 error where physical path is wrong for "subsite"
Apr 28, 2020 03:23 AM|samwu|LINK
Hi sevi,
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
Member
10 Points
84 Posts
Re: 404 error where physical path is wrong for "subsite"
Apr 28, 2020 03:59 AM|sevi|LINK
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.
Member
10 Points
84 Posts
Re: 404 error where physical path is wrong for "subsite"
Apr 28, 2020 02:32 PM|sevi|LINK
This is what works for site name:
Default Web Site\box
Thank you mgebhard for all of your help with this.