launchsettings.json - commandName, IIS or Project for Production? - iis

For an MVC core live production website, I am trying to understand which commandName setting I should be using in my launchsettings.json. My understanding is that if I set Project it will use the Kestrel server to host the website. If I set IIS it will then use IIS.
From my research into Kestrel, it is said that Kestrel should be used behind one of the main host servers such as IIS due to its lack of features as it was scaled for performance. This begs me to wonder how I would accomplish such a thing. In my current setup, I am using shared hosting to host a website and I would like to know if I should be putting the commandName setting to IIS or Project, will it even make a difference in my case?

Related

Deployment of a React (Front-end) and Nodejs (Back-end) application on Windows Server 2019

Questions:
I'm looking for a way to deploy my React and Node application on the internet?
Context:
I have a dedicated server at OVH under Windows Server 2019.
I looked at several tutorials to try to deploy my application with IIS (Microsoft web server) but I read that it was not the best solution to host his website.
Here is the link of the tuto :
https://muffinman.io/blog/react-router-subfolder-on-server/
I have two websites for my company (one on the admin side and one on the client side), so I would like to make both accessible via the internet (make them public), I also have a nodejs server (express and sequelize).
Having knowledge in Network I have already set up the DNS server which will allow me to have the domain name for each site, I have also set up the firewall (open and closed port).
I have heard about nginx under windows but it can only manage one website and is not suitable for my needs.
At the moment I am stuck for a dedicated server, because the fastest solution would have been to take a web hosting under a known platform
Have you ever heard of another solution for a dedicated windows server?
Have you already configured a web server react under IIS?
I'm open to any help that could help me with this task!
Information :
My application is built like this:
architecture
Thanks in advance.

How inprocess asp.net hosting model working in Linux container

Hi I am new to container. Thus asking this, may be a foul question.
The default hosting model of asp.net core is InProcess that requires IIS.
Now if we create an Linux image on a default asp.net core web app it is running and serving request.
I am confused here, how a Linux based image of .net core could serve InProcess hosting model
After lot of research, it is evident to me that running application through dotnet CLI ignores the hosting model settings. The same could be seen as when running the application with dotnet run command from local machine. It then always returned response that could be seen be returned from kestrel no matter what is the hosting model settings.
Hope it will help other to understand the trick that could not see any where documented.

How can I set my ASP.NET Core web app to be "always running" in local development?

I am in the process of converting a set of web applications from ASP.NET MVC 5 to ASP.NET Core.
Under the old ASP.NET, our applications were typically set up to run under "Local IIS" at a specific port and route. The benefit of this was that you could have multiple applications checked out and running locally without having to explicitly start or debug them all. After making a code change and rebuilding, IIS would spin up a new app domain and you could immediately start hitting the up-to-date code.
In contrast, all the ASP.NET Core apps I've seen so far use IIS Express instead of local IIS (as specified in launchSettings.json). How can I configure local IIS (or at least equivalent behavior)?

Can you host a ServiceStack Web App in IIS?

I have made a ServiceStack Web App that uses a custom AppHost from a plugin (similar to the example https://github.com/NetCoreWebApps/WebApp/tree/master/src/apps/chat). I can run it on macOS with the dotnet command as per the examples.
Can I host my Service Stack Web App on IIS? What approach should I take? Reverse-proxying Kestrel like this https://learn.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x
or will I need to have different AppHost/Startup code for the two hosting situations?
Or maybe there's a fundamental reason why it will never work?
WebApp is a standard .NET Core 2.0 App so you'll be able to host it as you would any other .NET Core App. Normally reverse proxies don't require anything except the internal url where the request is proxied to, but it looks like IIS wants you to explicitly call .UseIISIntegration() which is an issue that may have prevented the existing WebApp binary as it didn't call .NET Core 2.0 WebHost.CreateDefaultBuilder(args) which among other things would turn on IISIntegration when the .NET Core App is hosted in IIS/Windows which is now being done from this commit.
You can find the updated Web App binaries with this change in the /web folder of the https://github.com/NetCoreWebApps/Chat project.

How to replace IIS with Node.js for simple websites

I am coming from Microsoft world so please bear with me on this. I was told I could install node.js and use that as a web server instead of IIS. This is a very small business application. In IIS I can create virtual directory and point to the location of the web page and everything works just fine. Based on very little I read, I have few questions;
Is it possible to run node js as a windows service or any other form so that it runs for ever? I did find the forever package that I think I can use.
In IIS, I can create virtual directory set the port and thats it, I have myself a website.
I do not see any examples where I can use a directory where I have a web page, written in java script and point it to run as a web site. All the examples have some thing like server.js and that runs and routes the call. what is the other way to host web sites and use node.js to simple run as a fast web server.
I was told I could install node.js and use that as a web server instead of IIS.
This is true, but as you already found out then you are in charge of providing for things that IIS was already doing for you (e.g. automatically restart on reboot, or on crashes, hosting multiple sites by creating virtual folders, et cetera.)
You can indeed get all of these things worked out in Node.js and there are several libraries that help on each of these areas. It's not too hard but you'll need to do a bit of researching.
You can also run Node.js behind IIS. Take a look at iisnode http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html
Is it possible to run node js as a windows service or any other form so
that it runs for ever?
The library Forever takes care of restarting the site when it crashes...but I don't know if you can run it as a Windows Service. I haven't tried that.
In IIS, I can create virtual directory set the port and thats it,
I have myself a website.
I assume you are talking about a site that serves static HTML files, right? If that's the case that's very easy to support in Node.js either writing your own web server or using Express.js to serve static files.
I do not see any examples where I can use a directory where I have a web page,
written in java script and point it to run as a web site. All the examples
have some thing like server.js and that runs and routes the call.
Here is an extremely simple example to serve plain HTML files in Node.js https://gist.github.com/2573391 Don't use this in production, though. It's just an example and it does not have any kind of error handling or security.
what is the other way to host web sites and use node.js to simple run
as a fast web server.
As others have said, you should look into Express.js http://expressjs.com/ It provides some of the infrastructure that you are very likely going to need when building traditional web sites.
You say you're running a "very small business application" behind IIS. Unless it's written for Node.js (in JavaScript), it won't work.
There are no examples pointing to a directory and running that as a website, because that's not how things are done in Node.js. You write a Node.js-application and pull in a webserver-library.
Put simply, In Node.js, you don't embed the appliation in the webserver; you embed the webserver in the application.
When I used node.js, I redirected HTTP requests by a proxy server, nginx. I don’t know if you can directly bind node.js as an HTTP server, but for what’s it worth, nginx is pretty nice!
First things first, allow me to share an introduction. IMHO you should take this decision ( of moving from IIS to nodeJS) by adding various parameters. I belong to the Java & PHP community yet I use NodeJS to achieve extremely specific implementation where NodeJS perform the fastest ( fast IO, AJAX-JSON responses & more ). As you are coming with a Microsoft background you should bare with less comfortable solutions.
Yes, its possible to run NodeJs as a windows service and Forever will do fine.
and yes you can create "Virtual Directories" but by creating symbolic links to each of your customer's web site.
I recommend to take a good look at bouncy & express, If you're willing to take this step then these packages is just what you need.
Cheers!

Resources