简体   繁体   English

在 Linux 主机上部署 Asp.net 核心 mvc 网站(godaddy)

[英]Deploy Asp.net core mvc website on Linux hosting (godaddy)

I'm using Visual Studio Community 2022, I've developed a web application with MySQL database and it works fine in Windows hosting and IIS, the problem appeared when I tried to deploy it in GoDaddy Linux host not Windows host. I'm using Visual Studio Community 2022, I've developed a web application with MySQL database and it works fine in Windows hosting and IIS, the problem appeared when I tried to deploy it in GoDaddy Linux host not Windows host. I did all my best with all required steps to deploy it on Linux hosting, when I contacted with godaddy help desk they tolled me that there is no any solution for my problem.我尽了最大努力将它部署在 Linux 主机上,当我联系 godaddy 服务台时,他们告诉我没有任何解决方案可以解决我的问题。 Are there any one published ASP.NET Core MVC on Linux server especially on GoDaddy? Linux 服务器上是否有任何发布的 ASP.NET Core MVC,尤其是在 GoDaddy 上?

我使用此步骤发布了我的网站,然后将其上传到 public_html 文件夹

Well, first up, it seems to me a VERY and VERY BEYOND idea to develop on one platform, and worse yet a different OS then what you are deploying to.好吧,首先,在我看来,在一个平台上开发是一个非常非常非常好的想法,更糟糕的是,与你要部署的操作系统不同。

Next up, you have to think of a web server JUST like your desktop computer.接下来,您必须像您的台式计算机一样考虑 web 服务器。 If you say use some PDF library, then that PDF viewer or library HAS to be installed on your computer for this to work.如果您说使用一些 PDF 库,那么必须在您的计算机上安装 PDF 查看器或库才能使其正常工作。

Same goes for a web hosting server. web 托管服务器也是如此。 If you going to run the .net runtimes on Linux, then you have to setup and install the .net runtimes and system on that Linux server. If you going to run the .net runtimes on Linux, then you have to setup and install the .net runtimes and system on that Linux server.

You can no more build a program for windows desktop, and THEN decide that program is to now run on a Mac computer, or run on a Android phone.您不能再为 windows 桌面构建程序,然后决定该程序现在是在 Mac 计算机上运行,还是在 Android 手机上运行。

So, in addition to placing your web site and your .net code that drives the web site on that Linux computer?因此,除了将您的 web 站点和驱动 web 站点的 .net 代码放在该计算机上之外

You also have to get onto that Linux computer, and install the .net framework, and systems you require.您还必须进入 Linux 计算机,并安装 .net 框架和您需要的系统。

For example, if you use MySQL as the database?例如,如果您使用 MySQL 作为数据库? Then that system ALSO has to be installed on that web server.然后该系统还必须安装在 web 服务器上。

And if you using SQL server, as the database?如果您使用 SQL 服务器作为数据库? Then you have to pick and choose a hosting system that has SQL server installed.然后,您必须选择安装了 SQL 服务器的托管系统。 Or better yet, pick a hosting plan, and then YOU must develop to the systems and software that is existing on that server.或者更好的是,选择一个托管计划,然后您必须开发该服务器上现有的系统和软件。

So, if you decide to develop using PHP and say MySQL?那么,如果您决定使用 PHP 进行开发并说 MySQL? That is VERY unlikely to run on a web site that runs the windows OS.这不太可能在运行 windows 操作系统的 web 站点上运行。

And if you decide to use PHP with SQL server?如果您决定将 PHP 与 SQL 服务器一起使用? Then you have to ensure that the web hosting server (and plan) has support for PHP, and ALSO has SQL server installed and supported.然后,您必须确保 web 托管服务器(和计划)支持 PHP,并且还安装并支持 SQL 服务器。

Unless you can say install SQL server on that server?除非您可以说在该服务器上安装 SQL 服务器? And unless you can install the .net runtimes and systems on that server?除非您可以在该服务器上安装 .net 运行时和系统? Then you can't use that hosting plan, or else you go and find a hosting plan that:然后你不能使用那个托管计划,否则你 go 并找到一个托管计划:

Lets you install these systems.让您安装这些系统。 Or You choose a hosting plan that supports the set of tools you used to develop that web site and code with.或者您选择的托管计划支持您用于开发 web 站点和代码的工具集。

You can't just out of the blue install some windows software on a Mac computer.您不能突然在 Mac 计算机上安装一些 windows 软件。

And you can't out of the blue develop some software for Linux, and then expect that software to run on windows computers.而且您不能突然为 Linux 开发一些软件,然后期望该软件在 windows 计算机上运行。

So, unless that hosting plan has all the librries, and bits and parts you used to devleop your software with?那么,除非该托管计划包含您用来开发软件的所有库、位和部件? Then your software not even close to be able to work.那么您的软件甚至无法正常工作。

So, check your hosting plan.因此,请检查您的托管计划。 Does it support SQL server, or MySql?它是否支持 SQL 服务器或 MySql? Maybe it only has Postgres SQL support.也许它只有 Postgres SQL 支持。

Mabe the server does not support PHP - so you can't use that either.可能服务器不支持 PHP - 所以你也不能使用它。

Given that a windows hosting plan on go-daddy is what -- about an extra $2 or $3 dollars per month?鉴于 go-daddy 上的 windows 托管计划是什么 - 每月额外增加 2 美元或 3 美元?

Then why not use and choose and adopt a plan that is windows based in place of Linux based.那么为什么不使用并选择并采用基于 windows 的计划,而不是基于 Linux 的计划。

The simple matter?简单的事情?

You either buy a hosting plan, check tools and software systems it supports.您可以购买托管计划,检查它支持的工具和软件系统。 And then YOU MUST then choose those same developer tools for development.然后你必须选择那些相同的开发工具进行开发。

Or you pick a set of development tools to use, and THEN go find a hosting plan that supports the software and systems you used for development.或者您选择一组开发工具来使用,然后 go 找到一个支持您用于开发的软件和系统的托管计划。

However, be it desktop or web development?但是,是台式机还是 web 开发?

You can no more install Android software on windows or Mac.您不能再在 windows 或 Mac 上安装 Android 软件。 And you can no more install Mac software on a windows desktop.而且您不能再在 windows 桌面上安装 Mac 软件。

So, you have to ensure the given computer in question (your web server) has all the software systems and bits and parts installed on that server for YOUR software to run.因此,您必须确保给定的计算机(您的 web 服务器)在该服务器上安装了所有软件系统和位和部件,以便您的软件运行。

After you say been developing for a few years in .net, then I would suggest you get a local Linux computer up and running, and then say spend a month or two, and learning how to run a .net web site on that Linux computer. After you say been developing for a few years in .net, then I would suggest you get a local Linux computer up and running, and then say spend a month or two, and learning how to run a .net web site on that Linux computer. It certainly can be done, but there is a huge number of bits and parts you have to install, setup, learn to use, and quite a bit more to get this all working.这当然可以完成,但是您必须安装、设置、学习使用大量的部件和部件,以及更多的东西才能让这一切正常工作。

But you MUST drop this silly idea that any old web server will run any old web site you create.但是您必须放弃这个愚蠢的想法,即任何旧的 web 服务器都将运行您创建的任何旧的 web 站点。

in fact, EVEN WHEN you say develop using Linux tools, unless that target web server has the same database system, and all of the required systems you used for development?事实上,即使您说使用 Linux 工具进行开发,除非目标 web 服务器具有相同的数据库系统,以及您用于开发所需的所有系统? Then you can't even deploy software developed for and on a Linux computer to that Linux web server (unless it supports and has all of the systems and frameworks installed that YOU used to develop your site with).然后,您甚至无法将为 Linux 计算机开发的软件部署到该 Linux web 服务器(除非它支持并安装了所有系统和框架)。

Until you spend say a 6 months or maybe year or 2 at this?直到您在此花费 6 个月或 1 年或 2 年?

I would fork out the extra $2 for a windows hosting plan on go-daddy, and go with that.我会为 go-daddy 上的 windows 托管计划和 go 支付额外的 2 美元。 But, even then, you have to determine if that web server in question supports say .net core and you used .net core.但是,即使那样,您也必须确定有问题的 web 服务器是否支持 .net 内核,而您使用的是 .net 内核。 Or if not, then what .net framework version did you use for development?或者如果不是,那么你使用什么.net框架版本进行开发? If the web server does not have that framework, then you can't use that hosting plan.如果 web 服务器没有该框架,则无法使用该托管计划。 For example, the latest .net framework (non core) is version 4.8, but some web hosting plans only recent adopted and support .net 4.8.例如,最新的 .net 框架(非核心)是 4.8 版本,但一些 web 托管计划仅最近采用并支持 .net 4.8。 As a result, you have to use .net 4.5, or even maybe .net 4.0 for your development platform.因此,您的开发平台必须使用 .net 4.5,甚至可能是 .net 4.0。

So, you MUST ALWAYS develop your software based on what software and systems EXIST on the target web server.因此,您必须始终根据目标 web 服务器上存在的软件和系统来开发您的软件。

No such thing as "just publish" to any old web server EVER existed in our industry.在我们的行业中,从来没有像“发布”到任何旧的 web 服务器这样的东西。 How this works for desktop computers, or a web server computer box is not really different.这对于台式计算机或 web 服务器计算机机箱的工作原理并没有真正的不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Asp.net mvc 不在 godaddy 托管中发送 email - Asp.net mvc does not send email in godaddy hosting 在共享Linux主机上托管ASP.NET Core应用程序 - Hosting ASP.NET Core application on shared Linux hosting 将ASP.NET MVC网站部署到IIS 8 - Deploy asp.net mvc website to iis 8 如何将我的 linux (cntose) 服务器上的 asp.net mvc 网站主机或此网站代码转换为 asp.net 核心 - how to my asp.net mvc website host on linux (cntose) server or this website code convert into asp.net core Asp.net MVC4网站托管问题 - Asp.net MVC4 Website hosting issue 在服务器上托管ASP.NET MVC 5网站后更改模型 - Altering models after hosting ASP.NET MVC 5 website on server 如何使用VS2013在Godaddy中部署具有SQL Server数据库(启用成员身份)的ASP.NET网站 - How to deploy ASP.NET website with SQL Server database (membership enabled) in Godaddy using VS2013 GoDaddy中托管的ASP.NET MVC - ASP.NET MVC hosted in GoDaddy 如何将 ASP.Net MVC 5 代码从 Visual Studio 部署到 GoDaddy Plesk 服务器 - 代码优先 - How to deploy ASP.Net MVC 5 code from Visual Studio to GoDaddy Plesk Server- Code First 构建 ASP.Net Core 在 Linux 上部署 Package - Build ASP.Net Core Deploy Package on Linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM