aspnet / Hosting

[Archived] Code for hosting and starting up an ASP.NET Core application. Project moved to https://github.com/aspnet/Extensions and https://github.com/aspnet/AspNetCore
Apache License 2.0
552 stars 312 forks source link

[Announcement] Change to IIS hosting model #364

Closed DamianEdwards closed 5 years ago

DamianEdwards commented 9 years ago

Discussions for aspnet/Announcements#69

joeaudette commented 9 years ago

I have a server that is Windows 2008 Web Server, not R2. Does this mean I won't be able to run ASP.NET 5 on my server?

DamianEdwards commented 9 years ago

@joeaudette ASP.NET 5 was never supported on Windows Server 2008. The minimum requirement was always Windows Server 2008 R2.

joeaudette commented 9 years ago

I guess I understand that but it is a real bummer for me as it is the only server I have. I'm working on a new open source project for asp.net 5 and now I have nowhere to host it.

regisbsb commented 9 years ago

azure

joeaudette commented 9 years ago

yeah but Azure/SqlAzure is kind of expensive for me especially vs a free server that I already have, and especially for an open source project that isn't making me money.

tomasr commented 9 years ago

I'm not entirely sure about the whole plus story here, but this seems like a big step backwards to me.

A few downsides and questions I can see:

Bartmax commented 9 years ago

why Microsoft.AspNet.Server.WebListener server is still an option? I'm just curious.

jods4 commented 9 years ago

Does the removal of web.config have any consequence in this new model? For .net we still have app.config, but in <system.webserver> we could configure quite a lot of IIS things. I know most of the stuff is now handled (and configurable) by ASP.NET 5 but probably not everything.

Let's say for a minute that I want to do the static file serving from IIS. Is it possible? If yes, previously I could configure MIME types, compression, etc. from web.config how do I do that now?

aggieben commented 9 years ago

Can we at least have the sources for Helios for those who still want to use it? The reasons given for dropping support sound reasonable, but I kind of agree with @tomasr that there are also downsides, particularly in this early phase of vNext where tooling doesn't have the same level of maturity as tooling that has been around for IIS for a while. That's also not to mention performance impacts @DamianEdwards mentioned, but also downplayed. Maybe aspnet/Home#58 should be revisited?

JaredShaver commented 9 years ago

So is w3wp.exe totally out of the picture? We have a large number of tuning/performance settings configured for our application pools such as recycling, logging recycle events, CPU limit, idle time out, etc. Do these get flowed to the new model or are those unsupported? What about all the tools, including Microsoft's own such as SCOM APM and DebugDiag. Will those support this new model or will they need significant upgrades?

TerribleDev commented 9 years ago

its just an IIS module that will create a process and proxy requests to said process. I'd assume all of that still needs to run in an app pool as its an IIS module, so its more than likely that app pool recycling will work.

davidfowl commented 9 years ago

@joeaudette Can you use azure for hosting?

davidfowl commented 9 years ago

@aggieben Nope, Helios isn't open source and it won't be. You could always write a native IIS module from scratch but I'd recommend against it.

davidfowl commented 9 years ago

@jods4 web.config and <system.webServer> still work in this new model. IIS configuration is still there, but for .NET based configuration it's not going to be used.

joeaudette commented 9 years ago

@davidfowl I'm going to consider Azure/SqlAzure but I'm worried about the costs.

evil-shrike commented 9 years ago

Cool, but what about IIS7? Isn't it possible to host aspnet apps under IIS7 on Win7 anymore?

TerribleDev commented 9 years ago

I'm actually a huge fan of these changes. The big reason I like this, is that it simplifies the hosting model between OS's

Most likely people hosting DNX in linux will (most likely) proxy the requests through something like Nginx, so I'm glad to see the same idea being implemented in IIS.

This lets all the platforms be equal, and not have Windows seem like a first class citizen.

jods4 commented 9 years ago

@davidfowl OK thanks. That's important because it's a lot easier to ship an application to a customer and say "just copy those files over" rather than try to explain them how to configure IIS, which -- although they're supposed to be the server admin -- they are often somehow unable to do properly.

I assume web sockets go through cross-process as well?

DamianEdwards commented 9 years ago

@jods4 websockets flow across the process just fine

DamianEdwards commented 9 years ago

@evil-shrike Windows 7 has IIS 7.5, not IIS 7. We require IIS 7.5 as a minimum and the HttpPlatformHandler is being updated to support running on IIS 7.5

DamianEdwards commented 9 years ago

@Bartmax WebListener is based on HTTP.SYS which has some unique features that certain customers desire that can't be achieved otherwise, e.g. multiple apps listening on a single port. It also serves as the out-of-band replacement for System.Net.HttpListener for traditional .NET self-host applications.

davidfowl commented 9 years ago

@JaredShaver That all continues to work. IIS app pool management works the same way it did. The http platform handler uses windows job objects to keep track of child processes.

JaredShaver commented 9 years ago

@davidfowl thanks for the clarification. @DamianEdwards might want to update the announcement with how this will flow to avoid some IIS administrators being confused.

Bartmax commented 9 years ago

@DamianEdwards thank you for the detailed response. I like very much the decision taken here. :+1:

DamianEdwards commented 9 years ago

@tomasr

tomasr commented 9 years ago

@DamianEdwards

Also, I get why you want to have an entirely separate configuration story from IIS, but it is not great news for a lot of scenarios: It makes remote management difficult, and makes implementing some of the support services we offer a lot harder, as all of those are built on top of the IIS management model.

davidfowl commented 9 years ago

Do the IIS settings for things like memory limits monitor the entire job, or just the direct W3WP usage? if it's the latter, then no, it's not the same. Also, things like deadlock detection, process orphaning, etc are important, and I don't think they'd work out of the box with the new model.

Yes, several people asked this question and yes it does. IIS uses job objects to monitor the child process and handles limits like normal.

Great that ASPNET5 has good logging story, but having it integrated into IIS troubleshooting mechanisms was a huge plus. FREB in particular is a great tool, and if it can be supported somehow, it would be a huge benefit.

What things does ASP.NET itself put in FREB today that's related to managed code? Is it even as relevant without integrated pipeline support.

Also, I get why you want to have an entirely separate configuration story from IIS, but it is not great news for a lot of scenarios: It makes remote management difficult, and makes implementing some of the support services we offer a lot harder, as all of those are built on top of the IIS management model.

That's already the case today, the <system.web> section does not and will not work. We're taking it a step further and not supporting web.config at all for managed code. It unifies our hosting model and simplifies things (by removing the obscure differences). It'll take people a while to get used to but this is the new direction.

justinvp commented 9 years ago

Is WebListener open source? If not, why not?

tomasr commented 9 years ago

What things does ASP.NET itself put in FREB today that's related to managed code? Is it even as relevant without integrated pipeline support.

The value comes more from having a unified view of the entire request being processed. That existing ASP.NET didn't make as good use as it should've isn't reason to give it up :). That said, even with the little info ASP.NET wrote it was still pretty useful.

That's already the case today, the <system.web> section does not and will not work. We're taking it a step further and not supporting web.config at all for managed code. It unifies our hosting model and simplifies things (by removing the obscure differences). It'll take people a while to get used to but this is the new direction.

I wasn't referring about <system.web>. I was referring about having a unified configuration model that was accessible through the IIS management tools. That doesn't need <system.web> at all given the extensibility of the model. Frankly, unifying app.config and web.config is really a non-issue for me, never heard anyone in the last 12 years complaining about it, either :) I'm sure it simplifies stuff on your end, though.

I do appreciate you taking the time to answer the comments/questions. I'll definitely be on the lookout to see how the support story evolves.

PureKrome commented 9 years ago

The IIS AppPool doesn't need to run any managed code (you can literally configure it to not load the CLR at all)

So, we don't use app pools any more? Also, how can we configure this to not load the CLR? (link?).

I also take it, that we (the developers) don't need to worry about any of this if we're using Azure Websites? It's all magical :sparkles: that are configured in the background...

DamianEdwards commented 9 years ago

@PureKrome app pools are still used, you can just configure it to not load a CLR via the standard IIS app pool configuration dialog.

As mentioned in the announcement, the templates, VS and Azure hosting will all be updated to make this seamless.

DamianEdwards commented 9 years ago

@tomasr the short of it is that ASP.NET 5 isn't integrated into IIS the same way previous versions were because doing so introduces such tight coupling that hosting outside of IIS (and indeed on other platforms, e.g. Linux) becomes very difficult. ASP.NET 5 is completely new, and designed to be server agnostic from the outset. We acknowledge that there will be gaps when compared to the current experience as a result of this but we'll work hard to address them over time as ASP.NET 5 matures, and indeed the new model will allow us to make more impactful changes than we've been able to on ASP.NET 4.x due to its integrated nature. This new model is intended to carry us forward in a cross-platform, portable world for the next "generation" of .NET and we're very keen to hear people's experiences WRT to using and managing it in real-world scenarios.

davidfowl commented 9 years ago

@tomasr

Great that ASPNET5 has good logging story, but having it integrated into IIS troubleshooting mechanisms was a huge plus. FREB in particular is a great tool, and if it can be supported somehow, it would be a huge benefit.

I might be missing something but AFAIK, the integration with FREB is pretty shallow WRT managed code execution. In a world without the integrated IIS pipeline (this was the same with Helios) it might be even less useful.

On the positive side, the error handling with the new model will be consistent inside and outside of IIS and within IIS. Which is a constant source of trouble today e.g. http://benfoster.io/blog/aspnet-mvc-custom-error-pages

davidfowl commented 9 years ago

@justinvp it will eventually be OSS.

janpieterz commented 9 years ago

Is it possible to install IIS modules (this one in particular) through PowerShell? I've been looking for it but couldn't find any reference for this.

Reason I'm asking for this is that our application is managed by automatic deployment and I'd like to be able to automate this step for new sites, without manual admin work. Certainly would save a lot of time when we're talking 200+ running instances.

davidfowl commented 9 years ago

@janpieterz http://blogs.iis.net/satishl/webpi-command-line should be sufficient

guardrex commented 9 years ago

The existing ASP.NET Windows component does not need to be installed to run on Windows Servers

The Windows Server Core Team explains how the OS requires the .NET 4.5/4.5.1 Framework: Removing .NET Framework 4.5/4.5.1 removes Windows 2012/2012R2 UI and other features. Just to be clear, are you saying we will be able to uninstall ASP.NET 4.5? shot

Second ? ... HttpPlatformHandler is v1.0 right now, so we'll be looking for v1.1 when beta8 releases?

davidfowl commented 9 years ago

@GuardRex do you remember how we always said there's no more System.Web? That was mostly true, but Helios actually used System.Web to bootstrap CoreCLR and .NET Framework (via the DNX) so there was a little bit of goop left. This change means there's literally no System.Web in the picture, it never gets loaded. If you don't need any ASP.NET 4.x features then you don't need to install that component. I'll admit I haven't tried going that far and removing the component, but it should work.

If you're still using .NET Framework you'll need to install .NET itself :smile: . In the future, when CoreCLR gains more traction, there'll be no need to install any system component to get running (though we'll still have an MSI for convenience).

guardrex commented 9 years ago

when CoreCLR gains more traction

It has with me. I was born to run the Core CLR runtime. Besides, I think "4" is highly overrated as a number and we might be better off getting rid of it as soon as possible. I already changed my phone number ... and I smashed my digital clock when it read "4:52" this afternoon.

On my second question ... and on a more serious note ... we'll be keeping an eye out for HttpPlatformHandler v1.1 at the beta8 release, correct? Does this new version of that module have a release in step with the release of beta8?

davidfowl commented 9 years ago

@GuardRex Ah I missed that question sorry. HttpPlatformHandler of some version (I hope they call it 1.1) will be in sync with beta8 that's correct. We're working on with the IIS team to get all of the changes required to make ASP.NET 5 apps work well with it.

If you're interested, you can see we've filed a bunch of beta8 issues https://github.com/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+%5BHttpPlatformHandler%5D+user%3Aaspnet+ to deal with the changes.

sandorfr commented 9 years ago

@davidfowl will Azure Web Apps receive the required update in sync with beta8 release?

Speaking of CoreCLR traction is there any hope to see more support from Microsoft itself especially when it comes to Web Jobs or Document Db.

davidfowl commented 9 years ago

@sandorfr Yes, we'll be updating azure web apps to have the new http platform handler version. FWIW The existing one works today but there are a few features that we added.

davidfowl commented 9 years ago

Speaking of CoreCLR traction is there any hope to see more support from Microsoft itself especially when it comes to Web Jobs or Document Db.

Slowly but surely!

jruckert commented 9 years ago

@davidfowl I've just tried out the existing HttpPlatformHandler 1.0 with the latest beta8 (dnx-clr-win-x64.1.0.0-beta8-15653) live feed without any success. I've manually updated the web.config with the updated structure as per the above, and no matter what i try, it keeps on bugging out with "502 - Web server received an invalid response while acting as a gateway or proxy server." and "Process '0' failed to start. Port = 31685, Error Code = '-2147024894'."

the web.cmd file contains:

@"%~dp0approot\runtimes\dnx-clr-win-x64.1.0.0-beta8-15653\bin\dnx.exe" --appbase "%~dp0approot\packages\MyWebApp\1.0.0\root" Microsoft.Dnx.ApplicationHost --configuration Release kestrel %*

Where kestrel is:

"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://mytestwebsite"

Running the cmd file manually works fine, just no dice with IIS.

Any ideas?

davidfowl commented 9 years ago

@jruckert yes, your application is misconfigured. You need to pass the port into server.urls. I'm not sure why you have http://mytestwebsite, did you look the the examples here?:

http://www.iis.net/learn/extensions/httpplatformhandler/httpplatformhandler-configuration-reference#_HttpPlatformHandler_Configuration_E

We're making a few changes to the platform handler to make it work better but if you want to test something out today you can do something like this:

https://github.com/ahmelsayed/KestrelServerOnAzure

jruckert commented 9 years ago

@davidfowl thanks for the suggestions, however still no luck. I had to install VC++ 2015 runtime to get:

Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://mytestwebsite.mydomain.com:80 to actually load from the batch file, but it still does not work through IIS no matter what i try.

Is it because i have NTLM authentication enabled maybe?

davidfowl commented 9 years ago

@jruckert Did you look at the example?

jruckert commented 9 years ago

@davidfowl yes, i made an exact replica of

https://github.com/ahmelsayed/KestrelServerOnAzure/blob/master/wwwroot/web.config

apart from processPath="%HOME%\site\kestrel.cmd" arguments="http://localhost:%HTTP_PLATFORM_PORT%"

and replaced with "..\kestrel.bat" (an output from the dnu --publish) and arguments="http://mytestwebsite.mydomain.com:80"

I'm thinking the issue is within my project.json file and my definition of

"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://mytestwebsite.mydomain.com:80"

Sorry as this was a breaking change, i'm trying to wrap my head around the new way of proxying through IIS and looking at the code you checked in about 20hrs ago.

anfomin commented 9 years ago

@davidfowl is there any sample how to run beta8 project with IIS / Azure?

davidfowl commented 9 years ago

https://github.com/aspnet/Hosting/issues/364#issuecomment-142518032