4

net mvc 5 web application writen in Visual Studio 2017 on a windows machine. I need to deploy this web app on a linux machine where there is an apache server.

I've tried to deploy the entire app in the /var/www/ directory but I think that I have to compile the app before somehow. I've heard that I can do that using mono or using docker. Anyone knows which one is better? I've also heard that maybe I need to make an asp.net core project because mvc is not supported on apache. I'm sure that many people have done that before so there has to be a good solution for that but I can't find it on internet. Anyone has a good and easy solution for that? Thank you in advance.

This is what I have now with my apache configured.

enter image description here

8
  • Docker doesn't compile, it composes. For a C#/ .NET application to run on Linux you need to target a runtime that runs on Linux, with the two most popular being Mono and .NET Core. Which are you targeting? Commented May 14, 2019 at 6:08
  • okay I understand, which one is better mono or .NET Core? Thanks @MindSwipe Commented May 14, 2019 at 6:12
  • 1
    There is not definitive answer for a "Which is better?" question, some people will even defend the undefendable. Personally? I highly recommend .NET Core (especially .NET Core 3.0 Preview 5 but not necessarily for publicly accessible production apps). It's faster (and smaller) than Mono, open-source, and the .NET Core 3.0 is almost feature complete. Plus, the .NET Core was originally built so you can host an ASP project on Linux (hence ASP.NET) Commented May 14, 2019 at 6:19
  • Okay so what I have to do is a new project using asp.net core and develop my project. Then I will be able to deploy this project in linux. Is it right? Thanks @MindSwipe Commented May 14, 2019 at 6:29
  • 1
    You don't necessarily need to create a new project, you can port your code as described here. Also then you will be able to compile the source code to something that runs on Linux. Deploying is a whole different story. But, there is a how to from Microsoft on deploying ASP.NET Core on Linux with an Apache server here Commented May 14, 2019 at 6:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.