How to deploy .Net Core publish files on Apache sever - apache

I am exploring .Net core 2.0 have created sample web api project in using VS2017 and deployed on Apache web server, but it is not running from Apache however running fine when deployed on IIS.
Am I missing something in publish configuration? currently I can see dlls and folder by the name 'runtime' with subfolders 'unix', 'win', 'win7'.

Related

IIS + ASP.NET Core 6 + Hosting Pack resulting in default document/directory listing error

I'm attempting to get IIS to serve our ASP.NET 6 web application, but every time it complains of needing a default document. If I run the exe (kestrel) one it will serve it, but we want it to be hosted by IIS with the other components of the site.
I installed the 6.0.10 runtime w/ hosting package and these are the results when listing runtimes:
When looking at the site modules, I think it should have what is needed (think the AspNetCoreModuleV2 one handles the compiled routing scenario?):
Have rebooted the server and the app pool specifically, set to No Managed Code, and whenever I attempt to load the page at the localhost level, I get:
The views are compiled so I don't think I even need IIS to open views locally in any capacity.
Everything you've posted ticks off the major deployment steps for hosting a .NET 6 project on IIS:
Installed the .NET Core 6.0 Runtime Windows Hosting Bundle
Set up the IIS app pool with "No Managed Code"
Rebooted the server: "Have you turned it off and on again?"
After our exchange in the comments, the only thing that appeared to be missing is to use the .NET publish command; not the build command.
When deploying to IIS, you'll want to run the dotnet publish command and then deploy those artifacts to your IIS server. From the docs:
The dotnet publish command's output is ready for deployment to a hosting system (for example, a server, PC, Mac, laptop) for execution. It's the only officially supported way to prepare the application for deployment. Depending on the type of deployment that the project specifies, the hosting system may or may not have the .NET shared runtime installed on it.
You also may want to review: Publish .NET apps with the .NET CLI.

Deploy website to IIS from linux build agent

Problem description
I have a jenkins master that uses a linux build agent to build my ASP.NET Core websites using official MS linux docker containers.
I previously used a windows VM with the necessary tooling installed to build these projects and used MSDeploy.exe to deploy the sites to an IIS webserver. For this deployment I created a web package.
In my linux docker container I obviously can't use MSDeploy.exe.
Question
How can I savely deploy an ASP.NET Core website to an IIS webserver from a linux docker container?
MSDeploy.exe connects to the IIS using a local IIS Users credentials, shutsdown the app, replaces all files that are also present in the new package, so it not just replaces the files but also does some safety settings around the actual replacement.
Misc
I've found this question here, but unfortunately no real answer was found there.
Thanks in advance

How to start a released Asp.net Core project?

I'm an asp.net developer and recently trying to archive asp.net-core.
Since it's quite new, I would like to ask, how do you launch a asp.net-core project in a Windows machine?
For normal asp.net, my approach is publishing the project using Visual Studio, bring everything to a Windows machine, use IIS to create a website and point the directory to my physical file.
How about a website that created by asp.net-core?
Do I need to install asp.net-core in server machine? (i don't prefer this)
What should I do with the published file? There are two folders generated after publishing the project:
netcoreapp1.0
PublishOutput
Well, you still can use the file system mechanism to publish an ASP.NET Core project from Visual Studio. But VS uses the dotnet CLI under the hood to do the same stuff. Usually you configure your deployment depending upon your hosting environment such as Windows Server and Linux Server.
For Windows Server
You have to install ASP.NET Core Module in order to publish on IIS successfully. This will also install .NET Core SDK. You can than have the advantages of SSL Terminations and others provided by IIS on Windows Server.
For Linux
You have to use the .NET Core SDK here as well for a published app to acquire the .NET Core runtime (This is why you get those 2 folders). You use Nginx or HAProxy to get all SSL Terminations, Port-Forwarding etc.

dotnet publish with an Apache server

I have a .NET Core application ready to deploy. I've already tested this application on my Linux (CentOS) server with the command:
dotnet run
and everything is running smothly. Now I want to publish this web application on my Apache server. So far I've runned the command
dotnet publish
which created a folder named netcoreapp1.0. I've moved that folder to the var/www/mywebsite folder and created the respective sites-enabled and sites-avaliable conf files. The problem is I cannot access application at all.
With this, I would like to know if there is anyone out there that had published a .NET Core application into an Apache server in order to give some tutorial on how they did it.

How do I manually deploy a .NET MVC app to AWS via Elastic Beanstalk

I'm trying to deploy a simple Hello World ASP.NET MVC 4 app to an free tier EC2 instance using elastic beanstalk. I'm using Visual Web Developer Express (2010) which doesn't support the AWS Toolkit extensions, so how do I deploy the site without the extension?
It seems that with the Elastic Beanstalk web console, you can upload a file as a new applicaiton. But I can't figure out what's supposed to be in the file. Is it a zip containing a published mvc app? I tried that, and when navigating to the instance after it loaded it just displayed the IIS 8 logo. There's a sample zip on a walkthrough page, but it's an old ASP.NET page with 3 xml files in the root. I have no idea what to change in those files for MVC, .NET 4, Server 2012, or IIS 8. I can't find this information anywhere.
I tried creating some EC2 instances manually, remoting in and deploying the site myself. However the free Windows Server 2008 images don't have .NET 4. And the free Windows Server 2012 image doesn't have IIS... I couldn't figure out how to actually deploy my site.
The command line tool that's called by the AWS Toolkit extension can be used manually. Here is the documentation I found on deploying using this tool.
You have to publish your site as a Web Deploy Package in Visual Studio. Then use the tool located in Windows by default at
C:\Program Files (x86)\AWS Tools\Deployment Tool>awsdeploy.exe
You have to pass it a text file that contains the deployment configuration. There's a template for the file at
C:\Program Files (x86)\AWS Tools\Deployment Tool\Samples\ElasticBeanstalkDeploymentSample.txt
The first time I used the tool, deploying the package archive generated by Visual Studio, I still got the plain IIS 8 landing page. However, when I did an incremental deployment, which is done via an extracted version of the archive being pushed to the server, it worked fine.