简体   繁体   English

如何在您的域中发布和托管MVC4应用程序?

[英]How to publish and host a MVC4 application in your domain?

I have a webdomain www.MyDomain.com and a MVC4 web application MyMVCWebApp. 我有一个网域www.MyDomain.com和一个MVC4 Web应用程序MyMVCWebApp。

First I publish the application to a local destination. 首先,我将应用程序发布到本地目的地。

For instance: C:\\TempLocation 例如:C:\\ TempLocation

And then I host it to my domain with a FTP-tool (FileZilla??) 然后使用FTP工具(FileZilla ??)将其托管到我的域中

The files will be hosted but I can't find the webpage. 这些文件将被托管,但是我找不到该网页。

Which url do I have to write? 我必须写哪个网址? http://www.MyDomain.com/MyMVCWebApp/Home/Index.chtml or something?! http://www.MyDomain.com/MyMVCWebApp/Home/Index.chtml或其他内容?

Do I have change the settings in my web.config? 我是否在web.config中更改了设置?

What do I have to do? 我需要做什么?

You can't host an application on a domain. 您不能在域上托管应用程序。

An application is hosted on a web server. 应用程序托管在Web服务器上。 A domain name is only a way to translate an easy to remember address like "www.google.com" to the web server ip address which looks like 173.194.66.104 域名只是将易于记忆的地址(例如“ www.google.com”)转换为看起来像173.194.66.104的Web服务器IP地址的一种方法

It is possible to purchase a domain without a web server. 可以在没有Web服务器的情况下购买域。

So before going further: 因此,在继续之前:

  • Check if you actually bought a domain only, or a domain with a server 检查您是否实际上只购买了一个域,或者是一个带有服务器的域
  • Your domain should redirect to your server ip address, you can see if he is correctly configured by opening a command prompt and doing 您的域应重定向到您的服务器IP地址,可以通过打开命令提示符并执行以下操作来查看他的配置是否正确

C:\\> ping www.yourdomain.com C:\\> ping www.yourdomain.com

If this is not the case you will need to update the A record of your domain, and wait for the update to be replicated on DNS server worldwird. 如果不是这种情况,则需要更新域的A记录,并等待更新复制到DNS服务器worldwird上。

  • If you have a managed server , you should check your hosting provider website. 如果您拥有托管服务器 ,则应检查托管服务提供商的网站。 They usually provide in depth documentation, and they all have a different way to do things. 它们通常提供深入的文档,并且它们都有不同的处理方式。 Most of the time indeed you will be able to upload your files using a FTP software such as Filezilla. 实际上,大多数时候,您将能够使用FTP软件(例如Filezilla)上载文件。

    However, in order to host a MVC 4 application you need a server with the IIS web server, which means that you need a Windows server. 但是,为了承载MVC 4应用程序,您需要一台带有IIS Web服务器的服务器,这意味着您需要一台Windows服务器。 So if you have a Linux server, you should contact your hosting provider support and tell them you made a mistake during your order. 因此,如果您使用的是Linux服务器,则应与托管服务提供商支持小组联系,并告诉他们您在下订单时出错。 (It is possible to host a MVC 4 application on Linux, but I don't think it is often provided on managed servers) (可以在Linux上托管MVC 4应用程序,但我认为托管服务器上通常不提供该应用程序)

  • If you have a dedicated server you are on your own. 如果您拥有专用服务器 ,则您将自己运行。

The URL you will have to write to access your application will depends on what you have configured in the RegisterRoutes method of the RouteConfigs.cs file. 访问应用程序必须编写的URL将取决于您在RouteConfigs.cs文件的RegisterRoutes方法中配置的URL

I recommend you to watch the last video on this page to have a better overview of the possibilities. 我建议您观看此页面上的最后一个视频,以更好地了解各种可能性。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM