简体   繁体   中英

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

I have a webdomain www.MyDomain.com and a MVC4 web application MyMVCWebApp.

First I publish the application to a local destination.

For instance: C:\\TempLocation

And then I host it to my domain with a FTP-tool (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?!

Do I have change the settings in my 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. 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

It is possible to purchase a domain without a web server.

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

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.

  • 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.

    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. So if you have a Linux server, you should contact your hosting provider support and tell them you made a mistake during your order. (It is possible to host a MVC 4 application on Linux, but I don't think it is often provided on managed servers)

  • 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.

I recommend you to watch the last video on this page to have a better overview of the possibilities.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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